In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Viewing Issue Advanced Details Jump to Notes ] Wiki ]  Related Changesets ] View Simple ] Issue History ] Print ]
ID Category Type Reproducibility Date Submitted Last Update
0000239 [In-Portal CMS] Optimization task always 2009-08-24 03:20 2010-01-11 22:05
Reporter alex View Status public Project Name In-Portal CMS
Assigned To alex Developer
Priority normal Resolution fixed Platform
Status closed   OS
  OS Version
ETA none Fixed in Version 5.0.2-B1 Product Version 5.0.0
  Target Version 5.0.2 Product Build
Time EstimateNo estimate
Summary 0000239: Replace "kApplication::IsAdmin" method with "kApplication::isAdmin" class attribute
Description Currently "kApplication::IsAdmin" method only checks for ADMIN constant and it's value. This method is called almost at every script run. I propose to add "isAdmin" class variable and calculate it's value on application initialization and get rid of this method. This should boost performance in cases, where this method is called in loops.
Steps To Reproduce
Additional Information
Tags No tags attached.
Reference
Change Log Message
Estimate Points 0
Attached Files patch file icon is admin refactoring.patch [^] (101,683 bytes) 2009-10-06 10:47 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
User avatar (0000531)
alex (manager)
2009-09-23 13:16

Plan:
1. 74 files with IsAdmin usage, check them all and be sure, that new kApplication::isAdmin class variable is defined before it will be used, otherwise it will result to incorrect admin detection.
User avatar (0000824)
alex (manager)
2009-10-06 10:50

Added two properties:
kApplication::isAdmin - checks, that "admin/index.php" is used (as before)
kApplication::isAdminUser - checks that that "admin/index.php" is used and user is logged in.

How to use/upgrade your code:

All front-end limitation filters in SetCustomQuery method should also be added while admin is not logged in!

* $this->Application->IsAdmin() becomes $this->Application->isAdminUser;
* !$this->Application->IsAdmin() becomes $this->Application->isAdmin;
User avatar (0000906)
Dmitry (manager)
2009-10-18 00:52

Tested ok, but you'll need to adjust your patch due to changes in 5.0.x occurred after the patched was produced, in core/kernel/processors/main_processor.php file (line 603):

I have replaced " elseif ($this->Application->IsAdmin()) { " with corresponding ->IsAdmin


Part from the patch:

Index: core/kernel/processors/main_processor.php
===================================================================
--- core/kernel/processors/main_processor.php (revision 12650)
+++ core/kernel/processors/main_processor.php (working copy)


@@ -599,7 +599,7 @@
                 $module_prefix = $module_data['TemplatePath'];
             }
             else {
- $module_prefix = $this->Application->IsAdmin() ? $module_key.'/' : rtrim($module_data['TemplatePath'], '/').'/';
+ $module_prefix = $this->Application->isAdmin ? $module_key.'/' : rtrim($module_data['TemplatePath'], '/').'/';
             }
 
             $block_params['t'] = $module_prefix.$this->SelectParam($params, $module_key.'_template,'.$module_key.'_t,template,t');
User avatar (0000938)
alex (manager)
2009-10-20 10:31

Fix committed to 5.0.x branch. Commit Message:

Fixes 0000239: Replace "kApplication::IsAdmin" method with "kApplication::isAdmin" class attribute
User avatar (0000947)
alex (manager)
2009-10-23 01:48

Fix committed to 5.0.x branch. Commit Message:

1. Fixes 0000239: Replace "kApplication::IsAdmin" method with "kApplication::isAdmin" class attribute
2. Forgot to commit modules_helper.php
User avatar (0001367)
Dmitry (manager)
2010-01-11 22:05

Closing completed tasks.

- Related Changesets
In-Portal CMS: r12775
Timestamp: 2009-10-23 09:03:11
Author: alex
Details ] Diff ]
1. Bug 0000239: Replace "kApplication::IsAdmin" method with "kApplication::isAdmin" class attribute
2. Merge from "branches/5.0.x" to "releases/5.0.2-B1".
mod - /in-portal/releases/5.0.2-B1/core/units/helpers/modules_helper.php Diff ] File ]
In-Portal CMS: 5.0.x r12774
Timestamp: 2009-10-23 01:48:10
Author: alex
Details ] Diff ]
1. Fixes 0000239: Replace "kApplication::IsAdmin" method with "kApplication::isAdmin" class attribute
2. Forgot to commit modules_helper.php
mod - /in-portal/branches/5.0.x/core/units/helpers/modules_helper.php Diff ] File ]
In-Portal CMS: 5.0.x r12726
Timestamp: 2009-10-20 10:31:22
Author: alex
Details ] Diff ]
Fixes 0000239: Replace "kApplication::IsAdmin" method with "kApplication::isAdmin" class attribute
mod - /in-portal/branches/5.0.x/core/kernel/application.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/constants.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/db/cat_dbitem.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/db/cat_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/db/cat_tag_processor.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/db/db_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/db/db_tag_processor.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/db/dbitem.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/event_manager.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/kbase.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/languages/phrases_cache.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/nparser/template_cache.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/processors/main_processor.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/session/inp_session.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/session/session.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/utility/formatters/formatter.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/kernel/utility/http_query.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/admin/admin_events_handler.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/categories/categories_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/categories/categories_item.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/categories/categories_tag_processor.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/custom_fields/custom_fields_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/email_events/email_events_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/fck/fck_eh.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/files/file_eh.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/form_submissions/form_submissions_eh.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/helpers/captcha_helper.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/helpers/category_helper.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/helpers/permissions_helper.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/helpers/themes_helper.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/images/image_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/images/image_tag_processor.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/languages/languages_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/languages/languages_item.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/phrases/phrases_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/reviews/reviews_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/theme_files/theme_file_eh.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/themes/theme_item.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/themes/themes_eh.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/thesaurus/thesaurus_eh.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/users/users_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.0.x/core/units/visits/visits_event_handler.php Diff ] File ]
Modules :: Custom: 1.0.x r12725
Timestamp: 2009-10-20 10:27:34
Author: alex
Details ] Diff ]
Bug 0000239: Replace "kApplication::IsAdmin" method with "kApplication::isAdmin" class attribute
mod - /custom/branches/1.0.x/custom/units/sections/e_link_eh.php Diff ] File ]
mod - /custom/branches/1.0.x/custom/units/sections/e_product_eh.php Diff ] File ]
mod - /custom/branches/1.0.x/custom/units/sections/e_user_eh.php Diff ] File ]
Modules :: In-Bulletin: 5.0.x r12723
Timestamp: 2009-10-20 10:14:46
Author: alex
Details ] Diff ]
Bug 0000239: Replace "kApplication::IsAdmin" method with "kApplication::isAdmin" class attribute
mod - /in-bulletin/branches/5.0.x/in-bulletin/units/poll_comments/poll_comment_eh.php Diff ] File ]
mod - /in-bulletin/branches/5.0.x/in-bulletin/units/polls/poll_eh.php Diff ] File ]
mod - /in-bulletin/branches/5.0.x/in-bulletin/units/posts/post_eh.php Diff ] File ]
mod - /in-bulletin/branches/5.0.x/in-bulletin/units/private_messages/private_message_eh.php Diff ] File ]
mod - /in-bulletin/branches/5.0.x/in-bulletin/units/topics/topics_event_handler.php Diff ] File ]
Modules :: In-Commerce: 5.0.x r12722
Timestamp: 2009-10-20 10:12:10
Author: alex
Details ] Diff ]
Bug 0000239: Replace "kApplication::IsAdmin" method with "kApplication::isAdmin" class attribute
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/addresses/addresses_event_handler.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/affiliates/affiliates_event_handler.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/currencies/currencies_event_handler.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/gateways/gw_classes/authorizenet.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/gateways/gw_event_handler.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/manufacturers/manufacturers_event_handler.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/orders/orders_event_handler.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/orders/orders_item.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/pricing/pricing_event_handler.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/products/products_event_handler.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/products/products_item.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/shipping/shipping_tag_processor.php Diff ] File ]
mod - /w/in-commerce/branches/5.0.x/in-commerce/units/shipping_quote_engines/custom_shipping_quote_engine.php Diff ] File ]
Modules :: In-Link: 5.0.x r12721
Timestamp: 2009-10-20 09:49:04
Author: alex
Details ] Diff ]
Bug 0000239: Replace "kApplication::IsAdmin" method with "kApplication::isAdmin" class attribute
mod - /in-link/branches/5.0.x/in-link/units/links/link_tag_processor.php Diff ] File ]
mod - /in-link/branches/5.0.x/in-link/units/links/links_event_handler.php Diff ] File ]
mod - /in-link/branches/5.0.x/in-link/units/listings/listings_event_handler.php Diff ] File ]
Modules :: In-News: 5.0.x r12720
Timestamp: 2009-10-20 09:46:17
Author: alex
Details ] Diff ]
Bug 0000239: Replace "kApplication::IsAdmin" method with "kApplication::isAdmin" class attribute
mod - /in-news/branches/5.0.x/in-news/units/articles/articles_event_handler.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2010-01-11 22:05 Dmitry Note Added: 0001367
2010-01-11 22:05 Dmitry Status resolved => closed
2009-10-23 09:03 alex Changeset attached r12775
2009-10-23 01:48 alex Changeset attached 5.0.x r12774
2009-10-23 01:48 alex Note Added: 0000947
2009-10-23 01:48 alex Fixed in Version 5.0.2 => 5.0.2-B1
2009-10-20 10:31 alex Note Added: 0000938
2009-10-20 10:31 alex Status reviewed and tested => resolved
2009-10-20 10:31 alex Fixed in Version => 5.0.2
2009-10-20 10:31 alex Resolution open => fixed
2009-10-20 10:31 alex Changeset attached 5.0.x r12726
2009-10-20 10:27 alex Changeset attached 1.0.x r12725
2009-10-20 10:26 alex Changeset attached 5.0.x r12724
2009-10-20 10:14 alex Changeset attached 5.0.x r12723
2009-10-20 10:12 alex Changeset attached 5.0.x r12722
2009-10-20 09:49 alex Changeset attached 5.0.x r12721
2009-10-20 09:46 alex Changeset attached 5.0.x r12720
2009-10-18 00:52 Dmitry Assigned To !COMMUNITY => alex
2009-10-18 00:52 Dmitry Status needs testing => reviewed and tested
2009-10-18 00:52 Dmitry Note Added: 0000906
2009-10-06 14:24 alex Type bug report => task
2009-10-06 10:50 alex Time Estimate Removed 3 =>
2009-10-06 10:50 alex Note Added: 0000824
2009-10-06 10:50 alex Assigned To alex => !COMMUNITY
2009-10-06 10:50 alex Status active => needs testing
2009-10-06 10:47 alex File Added: is admin refactoring.patch
2009-10-03 07:52 administrator Status reviewed and tested => active
2009-09-30 06:59 alex Assigned To andrew => alex
2009-09-30 06:58 alex Status active => reviewed and tested
2009-09-30 06:58 alex Assigned To => andrew
2009-09-23 13:16 alex Time Estimate Added 3
2009-09-23 13:16 alex Note Added: 0000531
2009-09-20 15:11 alex Target Version 5.1.0 => 5.0.2
2009-08-24 11:15 Dmitry Target Version => 5.1.0
2009-08-24 03:20 alex New Issue



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker