Attached Files |
user_constants_core.patch [^] (31,830 bytes) 2010-05-18 07:28
[Show Content]
Index: units/visits/visits_tag_processor.php
===================================================================
--- units/visits/visits_tag_processor.php (revision 13557)
+++ units/visits/visits_tag_processor.php (working copy)
@@ -18,7 +18,7 @@
function UserFound($params)
{
- $virtual_users = Array(-1,-2, 0);
+ $virtual_users = Array(USER_ROOT, USER_GUEST, 0);
$object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params );
return !in_array( $object->GetDBField( $params['user_field'] ) , $virtual_users );
}
Index: units/visits/visits_config.php
===================================================================
--- units/visits/visits_config.php (revision 13557)
+++ units/visits/visits_config.php (working copy)
@@ -85,10 +85,10 @@
'CalculatedFields' => Array (
'' => Array (
- 'UserName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = -1, \'root\', IF (%1$s.PortalUserId = -2, \'Guest\', \'n/a\')), u.Login)',
+ 'UserName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = ' . USER_ROOT . ', \'root\', IF (%1$s.PortalUserId = ' . USER_GUEST . ', \'Guest\', \'n/a\')), u.Login)',
),
'incommerce' => Array (
- 'UserName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = -1, \'root\', IF (%1$s.PortalUserId = -2, \'Guest\', \'n/a\')), u.Login)',
+ 'UserName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = ' . USER_ROOT . ', \'root\', IF (%1$s.PortalUserId = ' . USER_GUEST . ', \'Guest\', \'n/a\')), u.Login)',
'AffiliateUser' => 'IF( LENGTH(au.Login),au.Login,\'!la_None!\')',
'AffiliatePortalUserId' => 'af.PortalUserId',
'OrderTotalAmount' => 'IF(ord.Status = 4, ord.SubTotal+ord.ShippingCost+ord.VAT, 0)',
@@ -134,7 +134,7 @@
'Referer' => Array ('type' => 'string','not_null' => '1','default' => ''),
'IPAddress' => Array ('type' => 'string','not_null' => '1','default' => ''),
'AffiliateId' => Array ('type' => 'int','formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (0 => 'lu_None'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Affiliates af LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = af.PortalUserId WHERE `%s` = \'%s\'','left_key_field' => 'AffiliateId','left_title_field' => 'Login','not_null'=>1,'default'=>0),
- 'PortalUserId' => Array ('type' => 'int','not_null' => '1','default' => -2),
+ 'PortalUserId' => Array ('type' => 'int','not_null' => '1','default' => USER_GUEST),
),
'VirtualFields' => Array (
Index: units/users/users_tag_processor.php
===================================================================
--- units/users/users_tag_processor.php (revision 13557)
+++ units/users/users_tag_processor.php (working copy)
@@ -211,7 +211,7 @@
function LoginName($params)
{
$object =& $this->getObject($params);
- return $object->GetID() != -1 ? $object->GetDBField('Login') : 'root';
+ return $object->GetID() != USER_ROOT ? $object->GetDBField('Login') : 'root';
}
function CookieUsername($params)
Index: units/users/users_event_handler.php
===================================================================
--- units/users/users_event_handler.php (revision 13559)
+++ units/users/users_event_handler.php (working copy)
@@ -108,7 +108,7 @@
$user_id = $this->Application->RecallVar('user_id');
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
- if ($event->Name == 'OnCreate' && $user_id == -2) {
+ if ($event->Name == 'OnCreate' && $user_id == USER_GUEST) {
// "Guest" can create new users
return true;
}
@@ -226,7 +226,7 @@
$object->SetError('ValidateLogin', 'no_permission', 'lu_no_permissions');
}
else {
- $object->SetID(-2);
+ $object->SetID(USER_GUEST);
$object->SetError('ValidateLogin', 'invalid_password', 'la_invalid_password');
}
@@ -1122,7 +1122,7 @@
if (!$items_info) return ;
list ($id, $field_values) = each($items_info);
$user_id = $this->Application->RecallVar('user_id');
- if ($id == $user_id && ($user_id > 0 || $user_id == -1)) {
+ if ($id == $user_id && ($user_id > 0 || $user_id == USER_ROOT)) {
$user_dummy =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true));
/* @var $user_dummy kDBItem */
@@ -1135,7 +1135,7 @@
}
}
- if ($user_id == -1) {
+ if ($user_id == USER_ROOT) {
$object =& $event->getObject( Array('skip_autoload' => true) );
/* @var $object UsersItem */
@@ -1251,7 +1251,7 @@
return true;
}
- $virtual_users = Array (-1, -2); // root, Guest
+ $virtual_users = Array (USER_ROOT, USER_GUEST);
return ($object->GetDBField('Status') == STATUS_ACTIVE) || in_array($object->GetID(), $virtual_users);
}
Index: units/structure/structure_config.php
===================================================================
--- units/structure/structure_config.php (revision 13557)
+++ units/structure/structure_config.php (working copy)
@@ -138,7 +138,7 @@
'MetaKeywords' => Array('type' => 'string', 'default' => null),
'CachedDescendantCatsQty' => Array('type' => 'int', 'default' => 0),
'CachedNavbar' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'default' => null),
- 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0),
+ 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(USER_ROOT => 'root', USER_GUEST => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0),
'ResourceId' => Array('type' => 'int', 'default' => null),
'ParentPath' => Array('type' => 'string', 'default' => null),
'TreeLeft' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
@@ -149,7 +149,7 @@
'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
- 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0),
+ 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(USER_ROOT => 'root', USER_GUEST => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0),
'CachedTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
Index: units/reviews/reviews_config.php
===================================================================
--- units/reviews/reviews_config.php (revision 13557)
+++ units/reviews/reviews_config.php (working copy)
@@ -69,17 +69,17 @@
'CalculatedFields' => Array (
'' => Array (
- 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = ' . USER_ROOT . ', \'root\', IF (%1$s.CreatedById = ' . USER_GUEST . ', \'Guest\', \'n/a\')), pu.Login )',
),
'products' => Array (
- 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = ' . USER_ROOT . ', \'root\', IF (%1$s.CreatedById = ' . USER_GUEST . ', \'Guest\', \'n/a\')), pu.Login )',
'ItemName' => 'pr.l1_Name',
'ProductId' => 'pr.ProductId',
),
'product' => Array (
- 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = ' . USER_ROOT . ', \'root\', IF (%1$s.CreatedById = ' . USER_GUEST . ', \'Guest\', \'n/a\')), pu.Login )',
'ItemName' => 'pr.l1_Name',
'ProductId' => 'pr.ProductId',
),
@@ -146,12 +146,12 @@
'CreatedById' => Array (
'type' => 'int',
'formatter' => 'kLEFTFormatter',
- 'options' => Array (-1 => 'root', -2 => 'Guest'),
+ 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'),
'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'PortalUser
WHERE `%s` = \'%s\' ',
'left_key_field' => 'PortalUserId',
'left_title_field' => 'Login',
- 'required' => 1, 'not_null' => 1, 'default' => -1,
+ 'required' => 1, 'not_null' => 1, 'default' => USER_ROOT,
'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'),
),
'ItemType' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
Index: units/modules/modules_tag_processor.php
===================================================================
--- units/modules/modules_tag_processor.php (revision 13557)
+++ units/modules/modules_tag_processor.php (working copy)
@@ -23,7 +23,7 @@
function _hasPrivileges()
{
- return $this->Application->RecallVar('user_id') == -1;
+ return $this->Application->RecallVar('user_id') == USER_ROOT;
}
function AlreadyInstalled($params)
Index: units/modules/modules_event_handler.php
===================================================================
--- units/modules/modules_event_handler.php (revision 13557)
+++ units/modules/modules_event_handler.php (working copy)
@@ -117,7 +117,7 @@
parent::OnAfterListQuery($event);
$new_modules = $this->_getNewModules();
- if (!$new_modules || $this->Application->RecallVar('user_id') != -1) {
+ if (!$new_modules || $this->Application->RecallVar('user_id') != USER_ROOT) {
return ;
}
Index: units/mailing_lists/mailing_lists_config.php
===================================================================
--- units/mailing_lists/mailing_lists_config.php (revision 13557)
+++ units/mailing_lists/mailing_lists_config.php (working copy)
@@ -97,9 +97,9 @@
'PortalUserId' => Array(
'type' => 'int',
'formatter' => 'kLEFTFormatter',
- 'options' => Array (-1 => 'root'),
+ 'options' => Array (USER_ROOT => 'root'),
'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login',
- 'required' => 1, 'not_null' => 1, 'default' => -1,
+ 'required' => 1, 'not_null' => 1, 'default' => USER_ROOT,
),
'To' => Array ('type' => 'string', 'required' => 1, 'default' => NULL),
Index: units/logs/session_logs/session_logs_config.php
===================================================================
--- units/logs/session_logs/session_logs_config.php (revision 13557)
+++ units/logs/session_logs/session_logs_config.php (working copy)
@@ -75,7 +75,7 @@
'CalculatedFields' => Array(
'' => Array(
- 'UserLogin' => 'IF(%1$s.PortalUserId=-1, \'root\', u.Login)',
+ 'UserLogin' => 'IF(%1$s.PortalUserId = ' . USER_ROOT . ', \'root\', u.Login)',
'UserFirstName' => 'u.FirstName',
'UserLastName' => 'u.LastName',
'UserEmail' => 'u.Email',
Index: units/logs/change_logs/change_logs_config.php
===================================================================
--- units/logs/change_logs/change_logs_config.php (revision 13557)
+++ units/logs/change_logs/change_logs_config.php (working copy)
@@ -89,7 +89,7 @@
'CalculatedFields' => Array (
'' => Array (
- 'UserLogin' => 'IF(%1$s.PortalUserId = -1, \'root\', u.Login)',
+ 'UserLogin' => 'IF(%1$s.PortalUserId = ' . USER_ROOT . ', \'root\', u.Login)',
'UserFirstName' => 'u.FirstName',
'UserLastName' => 'u.LastName',
'UserEmail' => 'u.Email',
Index: units/languages/languages_event_handler.php
===================================================================
--- units/languages/languages_event_handler.php (revision 13559)
+++ units/languages/languages_event_handler.php (working copy)
@@ -305,7 +305,7 @@
$this->Application->Session->SetField('Language', $language_id);
// remember last user language in administrative console
- if ($this->Application->RecallVar('user_id') == -1) {
+ if ($this->Application->RecallVar('user_id') == USER_ROOT) {
$this->Application->StorePersistentVar('AdminLanguage', $language_id);
}
else {
@@ -504,10 +504,10 @@
'l' . $object->GetID() . '_Body' => NULL,
);
$this->Conn->doUpdate($fields_hash, $this->Application->getUnitOption('emailevents', 'TableName'), 1);
-
+
// clean Phrases table
$fields_hash = Array (
- 'l' . $object->GetID() . '_Translation' => NULL,
+ 'l' . $object->GetID() . '_Translation' => NULL,
);
$this->Conn->doUpdate($fields_hash, $this->Application->getUnitOption('phrases', 'TableName'), 1);
}
Index: units/helpers/user_helper.php
===================================================================
--- units/helpers/user_helper.php (revision 13557)
+++ units/helpers/user_helper.php (working copy)
@@ -66,7 +66,7 @@
}
if (!$dry_run) {
- $user_id = -1;
+ $user_id = USER_ROOT;
$object->Load($user_id);
$object->SetDBField('Login', 'root');
$this->Application->StoreVar('user_id', $user_id);
@@ -178,7 +178,7 @@
$this->Application->HandleEvent($dummy, 'session-log:OnEndSession');
- $user_id = -2;
+ $user_id = USER_GUEST;
$this->Application->SetVar('u.current_id', $user_id);
$object =& $this->Application->recallObject('u.current', null, Array('skip_autoload' => true));
$object->Load($user_id);
@@ -263,7 +263,7 @@
return ;
}
- $is_root = $this->Application->RecallVar('user_id') == -1;
+ $is_root = $this->Application->RecallVar('user_id') == USER_ROOT;
$object =& $this->getUserObject();
Index: units/helpers/spam_helper.php
===================================================================
--- units/helpers/spam_helper.php (revision 13557)
+++ units/helpers/spam_helper.php (working copy)
@@ -93,7 +93,7 @@
$user_id = $this->Application->RecallVar('user_id');
if ($user_id == 0) {
- $user_id = -2;
+ $user_id = USER_GUEST;
}
$keys = Array (
Index: units/helpers/permissions_helper.php
===================================================================
--- units/helpers/permissions_helper.php (revision 13557)
+++ units/helpers/permissions_helper.php (working copy)
@@ -188,7 +188,7 @@
}
$event->setEventParam('raise_warnings', $raise_warnings);
- $owner_id = -1; // owner is root if not detected
+ $owner_id = USER_ROOT; // owner is root if not detected
if (!$id) {
// item being created -> check by current (before editing started, saved in OnPreCreate event) category permissions
// note: category in session is placed on catalog data import start
@@ -522,7 +522,7 @@
function CheckUserPermission($user_id, $name, $type = 1, $cat_id = null)
{
- if ($user_id == -1) {
+ if ($user_id == USER_ROOT) {
// "root" is allowed anywhere
return $name == 'SYSTEM_ACCESS.READONLY' ? 0 : 1;
}
Index: units/files/files_config.php
===================================================================
--- units/files/files_config.php (revision 13557)
+++ units/files/files_config.php (working copy)
@@ -90,7 +90,7 @@
'not_null' => 1, 'default' => 1,
),
'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
- 'CreatedById' => Array ('type' => 'int', 'not_null' => 1, 'default' => -1),
+ 'CreatedById' => Array ('type' => 'int', 'not_null' => 1, 'default' => USER_ROOT),
'MimeType' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
),
Index: units/categories/categories_tag_processor.php
===================================================================
--- units/categories/categories_tag_processor.php (revision 13557)
+++ units/categories/categories_tag_processor.php (working copy)
@@ -1942,7 +1942,7 @@
*/
function AllowedCategoriesJSON($params)
{
- if ($this->Application->RecallVar('user_id') == -1) {
+ if ($this->Application->RecallVar('user_id') == USER_ROOT) {
$categories = true;
}
else {
Index: units/categories/categories_event_handler.php
===================================================================
--- units/categories/categories_event_handler.php (revision 13557)
+++ units/categories/categories_event_handler.php (working copy)
@@ -309,7 +309,7 @@
}
$object->addFilter('perm_filter', 'PermId = 1'); // check for CATEGORY.VIEW permission
- if ($this->Application->RecallVar('user_id') != -1) {
+ if ($this->Application->RecallVar('user_id') != USER_ROOT) {
// apply permission filters to all users except "root"
$groups = explode(',',$this->Application->RecallVar('UserGroups'));
foreach ($groups as $group) {
Index: units/categories/categories_config.php
===================================================================
--- units/categories/categories_config.php (revision 13557)
+++ units/categories/categories_config.php (working copy)
@@ -338,7 +338,7 @@
'MetaKeywords' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
'CachedDescendantCatsQty' => Array ('type' => 'int', 'default' => 0),
'CachedNavbar' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'default' => null),
- 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0),
+ 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0),
'ResourceId' => Array ('type' => 'int', 'default' => null),
'ParentPath' => Array ('type' => 'string', 'default' => null),
'TreeLeft' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
@@ -349,7 +349,7 @@
'NewItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'PopItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
- 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0),
+ 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0),
'CachedTemplate' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
Index: kernel/utility/temp_handler.php
===================================================================
--- kernel/utility/temp_handler.php (revision 13557)
+++ kernel/utility/temp_handler.php (working copy)
@@ -949,8 +949,8 @@
if ($sids) {
// detect who is it
$sql = 'SELECT
- CONCAT(IF (s.PortalUserId = -1, \'root\',
- IF (s.PortalUserId = -2, \'Guest\',
+ CONCAT(IF (s.PortalUserId = ' . USER_ROOT . ', \'root\',
+ IF (s.PortalUserId = ' . USER_GUEST . ', \'Guest\',
CONCAT(FirstName, \' \', LastName, \' (\', Login, \')\')
)
), \' IP: \', s.IpAddress, \'\') FROM ' . TABLE_PREFIX . 'UserSession AS s
Index: kernel/startup.php
===================================================================
--- kernel/startup.php (revision 13557)
+++ kernel/startup.php (working copy)
@@ -167,6 +167,6 @@
include_once(KERNEL_PATH . '/utility/adodb-time.inc.php');
}
- // global constants
- define ('KG_TO_POUND', 2.20462262);
- define ('POUND_TO_KG', 0.45359237);
\ No newline at end of file
+ // system users
+ define('USER_ROOT', -1);
+ define('USER_GUEST', -2);
\ No newline at end of file
Index: kernel/session/session.php
===================================================================
--- kernel/session/session.php (revision 13557)
+++ kernel/session/session.php (working copy)
@@ -353,7 +353,7 @@
function LoadPersistentVars(&$session)
{
$user_id = $session->RecallVar('user_id');
- if ($user_id != -2) {
+ if ($user_id != USER_GUEST) {
// root & normal users
$sql = 'SELECT VariableValue, VariableName
FROM '.TABLE_PREFIX.'PersistantSessionData
@@ -375,7 +375,7 @@
function StorePersistentVar(&$session, $var_name, $var_value)
{
$user_id = $session->RecallVar('user_id');
- if ($user_id == -2 || $user_id === false) {
+ if ($user_id == USER_GUEST || $user_id === false) {
// -2 (when not logged in), false (when after u:OnLogout event)
$session->StoreVar($var_name, $var_value);
return ;
@@ -414,7 +414,7 @@
*/
function RecallPersistentVar(&$session, $var_name, $default = false)
{
- if ($session->RecallVar('user_id') == -2) {
+ if ($session->RecallVar('user_id') == USER_GUEST) {
if ($default == ALLOW_DEFAULT_SETTINGS) {
$default = null;
}
@@ -427,7 +427,7 @@
elseif ($default == ALLOW_DEFAULT_SETTINGS) {
$default_user_id = $this->Application->ConfigValue('DefaultSettingsUserId');
if (!$default_user_id) {
- $default_user_id = -1;
+ $default_user_id = USER_ROOT;
}
$sql = 'SELECT VariableValue, VariableName
FROM '.TABLE_PREFIX.'PersistantSessionData
@@ -450,7 +450,7 @@
$user_id = $session->RecallVar('user_id');
- if ($user_id != -2) {
+ if ($user_id != USER_GUEST) {
$sql = 'DELETE FROM '.TABLE_PREFIX.'PersistantSessionData
WHERE PortalUserId = '.$user_id.' AND VariableName = '.$this->Conn->qstr($var_name);
$this->Conn->Query($sql);
@@ -1398,7 +1398,7 @@
$user_id = $this->RecallVar('user_id');
$ret = $user_id > 0;
- if (($this->RecallVar('admin') == 1 || defined('ADMIN')) && ($user_id == -1)) {
+ if (($this->RecallVar('admin') == 1 || defined('ADMIN')) && ($user_id == USER_ROOT)) {
$ret = true;
}
return $ret;
Index: kernel/session/inp_session.php
===================================================================
--- kernel/session/inp_session.php (revision 13557)
+++ kernel/session/inp_session.php (working copy)
@@ -114,7 +114,7 @@
function StoreSession(&$session, $additional_fields = Array())
{
$fields_hash = Array (
- 'PortalUserId' => $this->Application->isAdmin ? 0 : -2, // Guest
+ 'PortalUserId' => $this->Application->isAdmin ? 0 : USER_GUEST,
'Language' => $this->Application->GetDefaultLanguageId(true),
'Theme' => $this->Application->GetDefaultThemeId(),
'IpAddress' => $_SERVER['REMOTE_ADDR'], // getenv('REMOTE_ADDR') won't work on IIS, so use $_SERVER instead
Index: kernel/event_manager.php
===================================================================
--- kernel/event_manager.php (revision 13557)
+++ kernel/event_manager.php (working copy)
@@ -412,7 +412,7 @@
}
$event->setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix, true));
- if (($this->Application->RecallVar('user_id') == -1) || $event_handler->CheckPermission($event)) {
+ if (($this->Application->RecallVar('user_id') == USER_ROOT) || $event_handler->CheckPermission($event)) {
$this->HandleEvent($event);
}
@@ -744,7 +744,7 @@
$events_source = $agents[$event_type];
$user_id = $this->Application->RecallVar('user_id');
- $this->Application->StoreVar('user_id', -1, true); // to prevent permission checking inside events, true for optional storage
+ $this->Application->StoreVar('user_id', USER_ROOT, true); // to prevent permission checking inside events, true for optional storage
foreach ($events_source as $short_name => $event_data) {
$next_run = $event_data['NextRunOn'];
Index: kernel/event_handler.php
===================================================================
--- kernel/event_handler.php (revision 13557)
+++ kernel/event_handler.php (working copy)
@@ -187,6 +187,7 @@
function CheckPermission(&$event)
{
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
+ /* @var $perm_helper kPermissionsHelper */
return $perm_helper->CheckEventPermission($event, $this->permMapping);
}
Index: kernel/db/db_event_handler.php
===================================================================
--- kernel/db/db_event_handler.php (revision 13557)
+++ kernel/db/db_event_handler.php (working copy)
@@ -533,14 +533,14 @@
$user_id = $this->Application->RecallVar('user_id');
$event->setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix, true));
$status_checked = false;
- if ($user_id == -1 || $this->CheckPermission($event)) {
+ if ($user_id == USER_ROOT || $this->CheckPermission($event)) {
// don't autoload item, when user doesn't have view permission
$this->LoadItem($event);
$status_checked = true;
$editing_mode = defined('EDITING_MODE') ? EDITING_MODE : false;
- if ($user_id != -1 && !$this->Application->isAdmin && !($editing_mode || $this->checkItemStatus($event))) {
+ if ($user_id != USER_ROOT && !$this->Application->isAdmin && !($editing_mode || $this->checkItemStatus($event))) {
// non-root user AND on front-end AND (not editing mode || incorrect status)
$perm_status = false;
}
@@ -2647,7 +2647,7 @@
$admin_ses =& $this->Application->recallObject('Session.admin');
/* @var $admin_ses Session */
- if ($admin_ses->RecallVar('user_id') == -1) {
+ if ($admin_ses->RecallVar('user_id') == USER_ROOT) {
return true;
}
Index: kernel/db/cat_tag_processor.php
===================================================================
--- kernel/db/cat_tag_processor.php (revision 13557)
+++ kernel/db/cat_tag_processor.php (working copy)
@@ -890,7 +890,7 @@
*/
function AllowedCategoriesJSON($params)
{
- if ($this->Application->RecallVar('user_id') == -1) {
+ if ($this->Application->RecallVar('user_id') == USER_ROOT) {
$categories = true;
}
else {
Index: kernel/db/cat_event_handler.php
===================================================================
--- kernel/db/cat_event_handler.php (revision 13557)
+++ kernel/db/cat_event_handler.php (working copy)
@@ -608,7 +608,7 @@
}
// add permission filter
- if ($this->Application->RecallVar('user_id') == -1) {
+ if ($this->Application->RecallVar('user_id') == USER_ROOT) {
// for "root" CATEGORY.VIEW permission is checked for items lists too
$view_perm = 1;
}
Index: kernel/constants.php
===================================================================
--- kernel/constants.php (revision 13559)
+++ kernel/constants.php (working copy)
@@ -166,4 +166,7 @@
// site domains
define('SITE_DOMAIN_REDIRECT_CURRENT', 1);
- define('SITE_DOMAIN_REDIRECT_EXTERNAL', 2);
\ No newline at end of file
+ define('SITE_DOMAIN_REDIRECT_EXTERNAL', 2);
+
+ define ('KG_TO_POUND', 2.20462262);
+ define ('POUND_TO_KG', 0.45359237);
Index: kernel/application.php
===================================================================
--- kernel/application.php (revision 13559)
+++ kernel/application.php (working copy)
@@ -2212,8 +2212,8 @@
$session =& $this->recallObject('Session');
$user_id = $session->GetField('PortalUserId');
- if (!$user_id && $user_id != -1) {
- $user_id = -2;
+ if (!$user_id && $user_id != USER_ROOT) {
+ $user_id = USER_GUEST;
}
$this->SetVar('u.current_id', $user_id);
@@ -2223,7 +2223,7 @@
$this->SetVar('u_id', $user_id);
}
- $this->StoreVar('user_id', $user_id, $user_id == -2); // storing Guest user_id (-2) is optional
+ $this->StoreVar('user_id', $user_id, $user_id == USER_GUEST); // storing Guest user_id (-2) is optional
$this->isAdminUser = $this->isAdmin && $this->LoggedIn();
@@ -2233,12 +2233,12 @@
$user->SetError('ValidateLogin', 'session_expired', 'la_text_sess_expired');
}
- if (($user_id != -2) && constOn('DBG_REQUREST_LOG') ) {
+ if (($user_id != USER_GUEST) && constOn('DBG_REQUREST_LOG') ) {
$http_query =& $this->recallObject('HTTPQuery');
$http_query->writeRequestLog(DBG_REQUREST_LOG);
}
- if ($user_id != -2) {
+ if ($user_id != USER_GUEST) {
// normal users + root
$this->LoadPersistentVars();
}
@@ -3081,11 +3081,11 @@
function getUserGroups($user_id)
{
switch ($user_id) {
- case -1:
+ case USER_ROOT:
$user_groups = $this->ConfigValue('User_LoggedInGroup');
break;
- case -2:
+ case USER_GUEST:
$user_groups = $this->ConfigValue('User_LoggedInGroup') . ',' . $this->ConfigValue('User_GuestGroup');
break;
Index: install.php
===================================================================
--- install.php (revision 13557)
+++ install.php (working copy)
@@ -354,7 +354,7 @@
}
if ($this->errorMessage == '') {
- $user_id = -1;
+ $user_id = USER_ROOT;
$session =& $this->Application->recallObject('Session');
$session->SetField('PortalUserId', $user_id);
$this->Application->SetVar('u.current_id', $user_id);
@@ -573,7 +573,7 @@
$fields_hash = Array (
'l1_Name' => 'Content', 'Filename' => 'Content', 'AutomaticFilename' => 0,
- 'CreatedById' => -1, 'CreatedOn' => time(), 'ResourceId' => $resource_id - 1,
+ 'CreatedById' => USER_ROOT, 'CreatedOn' => time(), 'ResourceId' => $resource_id - 1,
'l1_Description' => 'Content', 'Status' => 4,
);
user_constants_modules.patch [^] (36,982 bytes) 2010-05-18 07:29
[Show Content]
Index: in-news/units/articles/articles_event_handler.php
===================================================================
--- in-news/units/articles/articles_event_handler.php (revision 13557)
+++ in-news/units/articles/articles_event_handler.php (working copy)
@@ -300,7 +300,7 @@
$object->SetDBField('EndOn_time', $expiration_time);
$object->SetDBField('Status', STATUS_ACTIVE);
$object->SetDBField('Author', 'root');
- $object->SetDBField('CreatedById', -1);
+ $object->SetDBField('CreatedById', USER_ROOT);
$status = $object->isLoaded() ? $object->Update() : $object->Create();
} while (($current_node =& $current_node->NextSibling()));
@@ -392,7 +392,7 @@
$object->SetDBField('EndOn_time', $expiration_time);
$object->SetDBField('Status', STATUS_ACTIVE);
$object->SetDBField('Author', 'root');
- $object->SetDBField('CreatedById', -1);
+ $object->SetDBField('CreatedById', USER_ROOT);
$status = $object->isLoaded() ? $object->Update() : $object->Create();
} while (($current_node =& $current_node->NextSibling()));
Index: in-news/units/articles/articles_config.php
===================================================================
--- in-news/units/articles/articles_config.php (revision 13557)
+++ in-news/units/articles/articles_config.php (working copy)
@@ -346,7 +346,7 @@
'CalculatedFields' => Array (
'' => Array (
- 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)',
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = ' . USER_ROOT . ', "root", IF (%1$s.CreatedById = ' . USER_GUEST . ', "Guest", "n/a")), u.Login)',
'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
'CategoryFilename' => TABLE_PREFIX.'Category.NamedParentPath',
@@ -410,7 +410,7 @@
'Hits' => Array ('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0),
'CachedRating' => Array ('type' => 'string', 'default' => 0),
'CachedVotesQty' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'required' => 1, 'default' => -1),
+ 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'required' => 1, 'default' => USER_ROOT),
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Status' => Array (
'type' => 'int',
@@ -444,7 +444,7 @@
'HotItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'Archived' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 2 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
- 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1),
+ 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => USER_ROOT),
'OrgId' => Array ('type' => 'int', 'default' => null),
'MetaKeywords' => Array ('type' => 'string', 'default' => null),
'MetaDescription' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
Index: in-news/install.php
===================================================================
--- in-news/install.php (revision 13557)
+++ in-news/install.php (working copy)
@@ -34,7 +34,7 @@
$application =& kApplication::Instance();
$application->Init();
- if ($application->RecallVar('user_id') != -1) {
+ if ($application->RecallVar('user_id') != USER_ROOT) {
die('restricted access!');
}
Index: in-link/units/listings/listings_config.php
===================================================================
--- in-link/units/listings/listings_config.php (revision 13557)
+++ in-link/units/listings/listings_config.php (working copy)
@@ -106,7 +106,7 @@
'CalculatedFields' => Array (
'' => Array (
'LinkName' => 'CONCAT(item_table.Name, " (", item_table.Url, ")")',
- 'LinkOwner' => 'IF (ISNULL(u.Login), IF (item_table.CreatedById = -1, "root", IF (item_table.CreatedById = -2, "Guest", "n/a")), u.Login)',
+ 'LinkOwner' => 'IF (ISNULL(u.Login), IF (item_table.CreatedById = ' . USER_ROOT . ', "root", IF (item_table.CreatedById = ' . USER_GUEST . ', "Guest", "n/a")), u.Login)',
),
),
'Fields' => Array (
@@ -114,21 +114,21 @@
'ListingTypeId' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
- 'options_sql' => 'SELECT %s
- FROM '.TABLE_PREFIX.'ListingTypes
+ 'options_sql' => 'SELECT %s
+ FROM '.TABLE_PREFIX.'ListingTypes
ORDER BY Name',
'option_key_field' => 'ListingTypeId', 'option_title_field' => 'Name',
'default' => 0,
),
'ItemResourceId' => Array (
'type' => 'int',
- 'required' => 1, 'unique' => Array ('ItemResourceId'), 'default' => null,
+ 'required' => 1, 'unique' => Array ('ItemResourceId'), 'default' => null,
'error_field' => 'LinkName',
),
'PurchasedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
'ExpiresOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'required' =>1),
'Status' => Array (
- 'type' => 'int',
+ 'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 2,
Index: in-link/units/links/links_config.php
===================================================================
--- in-link/units/links/links_config.php (revision 13557)
+++ in-link/units/links/links_config.php (working copy)
@@ -410,7 +410,7 @@
'CalculatedFields' => Array (
'' => Array (
- 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)',
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = ' . USER_ROOT . ', "root", IF (%1$s.CreatedById = ' . USER_GUEST . ', "Guest", "n/a")), u.Login)',
'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
'CategoryFilename' => TABLE_PREFIX.'Category.NamedParentPath',
@@ -478,8 +478,8 @@
'CachedRating' => Array ('type' => 'string', 'not_null' => 1, 'formatter' => 'kFormatter', 'default' => 0),
'CachedVotesQty' => Array ('type' => 'int', 'formatter' => 'kFormatter', 'not_null' => 1, 'default' => 0),
'CachedReviewsQty' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1),
- 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1),
+ 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => USER_ROOT),
+ 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => USER_ROOT),
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Status' => Array (
'type' => 'int',
Index: in-link/install.php
===================================================================
--- in-link/install.php (revision 13557)
+++ in-link/install.php (working copy)
@@ -34,7 +34,7 @@
$application =& kApplication::Instance();
$application->Init();
- if ($application->RecallVar('user_id') != -1) {
+ if ($application->RecallVar('user_id') != USER_ROOT) {
die('restricted access!');
}
Index: in-commerce/units/products/products_event_handler.php
===================================================================
--- in-commerce/units/products/products_event_handler.php (revision 13557)
+++ in-commerce/units/products/products_event_handler.php (working copy)
@@ -555,7 +555,7 @@
$event->redirect = $this->Application->GetVar('success_template');
$object =& $event->getObject();
- $user_id = ($this->Application->RecallVar('user_id') == 0) ? -2 : $this->Application->RecallVar('user_id');
+ $user_id = $this->Application->RecallVar('user_id');
$sql = ' SELECT * FROM '.TABLE_PREFIX.'SpamControl
WHERE ItemResourceId='.$object->GetDBField('ResourceId').'
Index: in-commerce/units/orders/orders_tag_processor.php
===================================================================
--- in-commerce/units/orders/orders_tag_processor.php (revision 13557)
+++ in-commerce/units/orders/orders_tag_processor.php (working copy)
@@ -841,7 +841,7 @@
function UserFound($params)
{
- $virtual_users = Array(-1,-2, 0);
+ $virtual_users = Array(USER_ROOT, USER_GUEST, 0);
$object =& $this->getObject($params);
return !in_array( $object->GetDBField( $params['user_field'] ) , $virtual_users );
}
Index: in-commerce/units/orders/orders_event_handler.php
===================================================================
--- in-commerce/units/orders/orders_event_handler.php (revision 13558)
+++ in-commerce/units/orders/orders_event_handler.php (working copy)
@@ -1099,7 +1099,7 @@
// get user
$user_id = $this->Application->RecallVar('user_id');
if (!$user_id) {
- $user_id = -2; // Guest
+ $user_id = USER_GUEST;
}
$object->SetDBField('PortalUserId', $user_id);
@@ -1243,7 +1243,10 @@
$ses_user = $this->Application->RecallVar('user_id');
if ($order->GetDBField('PortalUserId') != $ses_user) {
- if ($ses_user == 0) $ses_user = -2; //Guest
+ if ($ses_user == 0) {
+ $ses_user = USER_GUEST;
+ }
+
$order->SetDBField('PortalUserId', $ses_user);
// since CheckUser is called in OnBeforeItemUpdate, we don't need to call udpate here, just set the field
}
Index: in-commerce/units/orders/orders_config.php
===================================================================
--- in-commerce/units/orders/orders_config.php (revision 13557)
+++ in-commerce/units/orders/orders_config.php (working copy)
@@ -246,7 +246,7 @@
'CalculatedFields' => Array (
'' => Array (
- 'CustomerName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = -1, \'root\', IF (%1$s.PortalUserId = -2, \'Guest\', \'n/a\')), CONCAT(u.FirstName,\' \',u.LastName) )',
+ 'CustomerName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = ' . USER_ROOT . ', \'root\', IF (%1$s.PortalUserId = ' . USER_GUEST . ', \'Guest\', \'n/a\')), CONCAT(u.FirstName,\' \',u.LastName) )',
'Username' => 'IF( ISNULL(u.Login),\'root\',u.Login)',
'OrderNumber' => 'CONCAT(LPAD(Number,6,"0"),\'-\',LPAD(SubNumber,3,"0") )',
'SubtotalWithoutDiscount' => '(SubTotal + DiscountTotal)',
@@ -314,7 +314,7 @@
'not_null' => 1, 'default' => 0,
),
'OrderDate' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
- 'PortalUserId' =>Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' =>Array (-1=> 'root',-2=> 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required' =>1, 'not_null' =>1, 'default' =>-1),
+ 'PortalUserId' =>Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' =>Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required' =>1, 'not_null' =>1, 'default' =>-1),
'OrderIP' => Array ('type' => 'string', 'not_null' => 1, 'default' => '', 'filter_type' => 'like'),
'UserComment' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL),
'AdminComment' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL),
@@ -355,14 +355,14 @@
'PaymentType' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
- 'options_sql' => 'SELECT %s
- FROM ' . TABLE_PREFIX . 'PaymentTypes
- WHERE Status = 1
+ 'options_sql' => 'SELECT %s
+ FROM ' . TABLE_PREFIX . 'PaymentTypes
+ WHERE Status = 1
ORDER BY Priority DESC, Name ASC',
'option_key_field' => 'PaymentTypeId', 'option_title_field' => 'Description',
'not_null' => 1, 'default' => 0
),
-
+
'PaymentAccount' => Array ('type' => 'string', 'not_null' => 1, 'cardtype_field' => 'PaymentCardType', 'default' => '', 'filter_type' => 'like'),
'PaymentNameOnCard' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
'PaymentCCExpDate' => Array ('type' => 'string', 'formatter' => 'kCCDateFormatter', 'month_field' => 'PaymentCCExpMonth', 'year_field' => 'PaymentCCExpYear', 'not_null' => 1, 'default' => ''),
@@ -377,7 +377,7 @@
'formatter' => 'kOptionsFormatter',
'options' => Array (),
'option_key_field' => 'DestAbbr',
- 'option_title_field' => 'Translation',
+ 'option_title_field' => 'Translation',
),
'ShippingAddress1' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
'ShippingAddress2' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
@@ -400,8 +400,8 @@
'ShippingType' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
- 'options_sql' => 'SELECT %s
- FROM ' . TABLE_PREFIX . 'ShippingType
+ 'options_sql' => 'SELECT %s
+ FROM ' . TABLE_PREFIX . 'ShippingType
WHERE Status = 1',
'option_key_field' => 'ShippingID',
'option_title_field' => 'Name',
@@ -491,8 +491,8 @@
'LineEndings' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Windows', 2 => 'UNIX'), 'default' => 1),
'LineEndingsInside' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'CRLF', 2 => 'LF'), 'default' => 2),
'IncludeFieldTitles' => Array (
- 'type' => 'int',
- 'formatter' => 'kOptionsFormatter',
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter',
'options' => Array (0 => 'la_No', 1 => 'la_Yes'),
'use_phrases' => 1, 'not_null' => 1, 'default' => 1,
),
@@ -500,8 +500,8 @@
'AvailableColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array ()),
'ExportPresets' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array ()),
'ExportSavePreset' => Array (
- 'type' => 'int',
- 'formatter' => 'kOptionsFormatter',
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter',
'options' => Array (0 => 'la_No', 1 => 'la_Yes'),
'use_phrases' => 1, 'not_null' => 1, 'default' => 0,
),
Index: in-commerce/units/gateways/gw_classes/authorizenet.php
===================================================================
--- in-commerce/units/gateways/gw_classes/authorizenet.php (revision 13557)
+++ in-commerce/units/gateways/gw_classes/authorizenet.php (working copy)
@@ -82,7 +82,7 @@
{
$gw_responce = unserialize( $item_data['GWResult1'] );
- if( ($item_data['PortalUserId'] != $gw_responce['customer_id']) && ($gw_repsponce['customer_id'] != -2 && !$this->Application->isAdmin)) return false;
+ if( ($item_data['PortalUserId'] != $gw_responce['customer_id']) && ($gw_repsponce['customer_id'] != USER_GUEST && !$this->Application->isAdmin)) return false;
if( ( strtolower($gw_responce['transaction_type']) == 'auth_only') )
{
Index: in-commerce/units/coupons/coupons_config.php
===================================================================
--- in-commerce/units/coupons/coupons_config.php (revision 13557)
+++ in-commerce/units/coupons/coupons_config.php (working copy)
@@ -140,7 +140,7 @@
'LastUsedBy' => Array (
'type' => 'int', 'formatter' => 'kLEFTFormatter',
'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'),
- 'options' => Array (-1 => 'root', -2 => 'Guest'),
+ 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'),
'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'PortalUser
WHERE `%s` = \'%s\'','left_key_field'=>'PortalUserId',
'left_title_field' => 'Login', 'required' => 0, 'default' => null,
Index: in-commerce/units/affiliates/affiliates_config.php
===================================================================
--- in-commerce/units/affiliates/affiliates_config.php (revision 13557)
+++ in-commerce/units/affiliates/affiliates_config.php (working copy)
@@ -165,7 +165,7 @@
'Fields' => Array(
'AffiliateId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'PortalUserId' => Array('type' => 'int', 'unique'=>Array('PortalUserId'), 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!', 'unique' => '!la_affiliate_already_exists!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required' => 1, 'not_null' => 1, 'default' => 0, ),
+ 'PortalUserId' => Array('type' => 'int', 'unique'=>Array('PortalUserId'), 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!', 'unique' => '!la_affiliate_already_exists!'), 'options' => Array(USER_ROOT => 'root', USER_GUEST => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required' => 1, 'not_null' => 1, 'default' => 0, ),
'AffiliatePlanId' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options_sql'=>'SELECT Name, AffiliatePlanId FROM '.TABLE_PREFIX.'AffiliatePlans WHERE Enabled = 1 ORDER BY Name', 'option_key_field'=>'AffiliatePlanId', 'option_title_field'=>'Name', 'not_null' => 1, 'default' => 0),
'AccumulatedAmount' => Array('type' => 'double', 'formatter'=>'kFormatter', 'format'=>'%.02f', 'not_null' => '1','default' => '0.00'),
'AmountToPay' => Array('type' => 'double', 'formatter'=>'kFormatter', 'format'=>'%.02f', 'not_null' => '1','default' => '0.00'),
Index: in-commerce/install.php
===================================================================
--- in-commerce/install.php (revision 13557)
+++ in-commerce/install.php (working copy)
@@ -33,7 +33,7 @@
$application =& kApplication::Instance();
$application->Init();
- if ($application->RecallVar('user_id') != -1) {
+ if ($application->RecallVar('user_id') != USER_ROOT) {
die('restricted access!');
}
Index: in-bulletin/units/topics/topics_config.php
===================================================================
--- in-bulletin/units/topics/topics_config.php (revision 13557)
+++ in-bulletin/units/topics/topics_config.php (working copy)
@@ -305,7 +305,7 @@
'CalculatedFields' => Array (
'' => Array (
- 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.OwnerId = -1, "root", IF (%1$s.OwnerId = -2, "Guest", "n/a")), u.Login)',
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.OwnerId = ' . USER_ROOT . ', "root", IF (%1$s.OwnerId = ' . USER_GUEST . ', "Guest", "n/a")), u.Login)',
'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
'PrimaryCat' => TABLE_PREFIX.'%3$sCategoryItems.PrimaryCat',
@@ -399,24 +399,24 @@
'OwnerId' => Array (
'type' => 'int',
'formatter' => 'kLEFTFormatter',
- 'options' => Array (-1 => 'root', -2 => 'Guest'),
+ 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'),
'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'PortalUser
WHERE `%s` = \'%s\' ',
'left_key_field' => 'PortalUserId',
'left_title_field' => 'Login',
'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'),
- 'required' => 1, 'not_null' => 1, 'default' => -1,
+ 'required' => 1, 'not_null' => 1, 'default' => USER_ROOT,
),
'ModifiedById' => Array (
'type' => 'int',
'formatter' => 'kLEFTFormatter',
- 'options' => Array (-1 => 'root', -2 => 'Guest'),
+ 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'),
'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'PortalUser
WHERE `%s` = \'%s\' ',
'left_key_field' => 'PortalUserId',
'left_title_field' => 'Login',
'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'),
- 'required' => 1, 'not_null' => 1, 'default' => -1,
+ 'required' => 1, 'not_null' => 1, 'default' => USER_ROOT,
),
'ResourceId' => Array ('type' => 'int', 'default' => null),
'TopicType' => Array (
@@ -481,7 +481,7 @@
'CachedNavbar' => Array ('type' => 'string', 'default' => ''),
'LastPoster' => Array ('type' => 'string', 'default' => ''),
- 'LastPosterId' => Array ('type' => 'int', 'default' => -2),
+ 'LastPosterId' => Array ('type' => 'int', 'default' => USER_GUEST),
'PostingText' => Array (
'type' => 'string',
'formatter' => 'kFormatter', 'using_fck' => 1,
Index: in-bulletin/units/private_messages/private_messages_config.php
===================================================================
--- in-bulletin/units/private_messages/private_messages_config.php (revision 13557)
+++ in-bulletin/units/private_messages/private_messages_config.php (working copy)
@@ -76,8 +76,8 @@
'Body' => 'pmb.Body',
'Options' => 'pmb.Options',
- 'FromName' => 'IF (ISNULL(from_user.Login), IF (%1$s.FromId = -1, "root", IF (%1$s.FromId = -2, "Guest", "n/a")), from_user.Login)',
- 'ToName' => 'IF (ISNULL(to_user.Login), IF (%1$s.ToId = -1, "root", IF (%1$s.ToId = -2, "Guest", "n/a")), to_user.Login)',
+ 'FromName' => 'IF (ISNULL(from_user.Login), IF (%1$s.FromId = ' . USER_ROOT . ', "root", IF (%1$s.FromId = ' . USER_GUEST . ', "Guest", "n/a")), from_user.Login)',
+ 'ToName' => 'IF (ISNULL(to_user.Login), IF (%1$s.ToId = ' . USER_ROOT . ', "root", IF (%1$s.ToId = ' . USER_GUEST . ', "Guest", "n/a")), to_user.Login)',
'FromFullName' => 'TRIM(CONCAT(from_user.FirstName, " ", from_user.LastName))',
'ToFullName' => 'TRIM(CONCAT(to_user.FirstName, " ", to_user.LastName))',
Index: in-bulletin/units/posts/posts_config.php
===================================================================
--- in-bulletin/units/posts/posts_config.php (revision 13557)
+++ in-bulletin/units/posts/posts_config.php (working copy)
@@ -64,7 +64,7 @@
'CalculatedFields' => Array (
'' => Array (
- 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)',
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = ' . USER_ROOT . ', "root", IF (%1$s.CreatedById = ' . USER_GUEST . ', "Guest", "n/a")), u.Login)',
'AltName' => 'img.AltName',
'SameImages' => 'img.SameImages',
@@ -87,8 +87,8 @@
'GraphicsUrl' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL),
- 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
- 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
+ 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
+ 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
'TopicId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'ResourceId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'ReplyTo' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
Index: in-bulletin/units/polls/polls_config.php
===================================================================
--- in-bulletin/units/polls/polls_config.php (revision 13557)
+++ in-bulletin/units/polls/polls_config.php (working copy)
@@ -131,7 +131,7 @@
'formatter' => 'kOptionsFormatter',
'options' => Array (0 => 'la_No', 1 => 'la_Yes',), 'use_phrases' => 1,
'default' => 1, 'not_null' => 1,
- ),
+ ),
'AllowMultipleVotings' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
@@ -156,7 +156,7 @@
'CalculatedFields' => Array (
'' => Array (
-// 'DaysLeft' => 'IF( ISNULL(%1$s.EndDate), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, %1$s.PosterAlias, \'n/a\')), \'Never\' )',
+// 'DaysLeft' => 'IF( ISNULL(%1$s.EndDate), IF (%1$s.CreatedById = ' . USER_ROOT . ', \'root\', IF (%1$s.CreatedById = ' . USER_GUEST . ', %1$s.PosterAlias, \'n/a\')), \'Never\' )',
),
),
Index: in-bulletin/units/polls/poll_eh.php
===================================================================
--- in-bulletin/units/polls/poll_eh.php (revision 13557)
+++ in-bulletin/units/polls/poll_eh.php (working copy)
@@ -112,7 +112,7 @@
}
if (!$voted) {
- $user_id = $this->Application->LoggedIn()? $this->Application->RecallVar('user_id') : '-2';
+ $user_id = $this->Application->RecallVar('user_id');
$fields_hash = Array (
'PollId' => $object->GetID(),
'AnswerId' => $poll_answer_id,
Index: in-bulletin/units/poll_comments/poll_comments_config.php
===================================================================
--- in-bulletin/units/poll_comments/poll_comments_config.php (revision 13557)
+++ in-bulletin/units/poll_comments/poll_comments_config.php (working copy)
@@ -61,10 +61,10 @@
'AnswerId' => Array ('type' => 'int', 'default' => NULL),
'CreatedById' => Array ('type' => 'int', 'formatter'=>'kLEFTFormatter',
'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'),
- 'options' => Array(-1 => 'root', -2 => 'Guest'),
+ 'options' => Array(USER_ROOT => 'root', USER_GUEST => 'Guest'),
'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'',
'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login',
- 'required' => 1, 'not_null' => 1, 'default' => -2),
+ 'required' => 1, 'not_null' => 1, 'default' => USER_GUEST),
'GuestName' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'GuestEmail' => Array('type' => 'string', 'max_len' => 255, 'formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', 'sample_value' => 'email@domain.com', 'not_null' => '1', 'default' => '', 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!', 'unique'=>'!lu_email_already_exist!'),'required' => 0 ),
'CommentBody' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL, 'required' => 1),
@@ -81,7 +81,7 @@
'CalculatedFields' => Array (
'' => Array (
- 'CommentedByUser' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ 'CommentedByUser' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = ' . USER_ROOT . ', \'root\', IF (%1$s.CreatedById = ' . USER_GUEST . ', \'Guest\', \'n/a\')), pu.Login )',
),
),
Index: in-bulletin/units/poll_comments/poll_comment_eh.php
===================================================================
--- in-bulletin/units/poll_comments/poll_comment_eh.php (revision 13557)
+++ in-bulletin/units/poll_comments/poll_comment_eh.php (working copy)
@@ -32,7 +32,7 @@
function OnAfterConfigRead(&$event)
{
- if ($this->Application->RecallVar('user_id') == '-2') { // Guest
+ if ($this->Application->RecallVar('user_id') == USER_GUEST) {
// make Guest Name and Email required for guests
$fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
$fields['GuestName']['required'] = 1;
Index: in-bulletin/install.php
===================================================================
--- in-bulletin/install.php (revision 13557)
+++ in-bulletin/install.php (working copy)
@@ -34,7 +34,7 @@
$application =& kApplication::Instance();
$application->Init();
- if ($application->RecallVar('user_id') != -1) {
+ if ($application->RecallVar('user_id') != USER_ROOT) {
die('restricted access!');
}
Index: in-auction/notify.php
===================================================================
--- in-auction/notify.php (revision 13557)
+++ in-auction/notify.php (working copy)
@@ -24,7 +24,7 @@
$application =& kApplication::Instance();
$application->Init();
- $application->StoreVar('user_id', -1); // root
+ $application->StoreVar('user_id', USER_ROOT);
$application->HandleEvent($event, 'l-ebay:OnStoreToLog');
Index: in-auction/new_token_reject.php
===================================================================
--- in-auction/new_token_reject.php (revision 13557)
+++ in-auction/new_token_reject.php (working copy)
@@ -23,7 +23,7 @@
$application =& kApplication::Instance();
$application->Init();
- $application->StoreVar('user_id', -1); // root
+ $application->StoreVar('user_id', USER_ROOT);
$application->HandleEvent($event, 'ebay-sections:OnNewTokenReject');
Index: in-auction/new_token_accept.php
===================================================================
--- in-auction/new_token_accept.php (revision 13557)
+++ in-auction/new_token_accept.php (working copy)
@@ -23,7 +23,7 @@
$application =& kApplication::Instance();
$application->Init();
- $application->StoreVar('user_id', -1); // root
+ $application->StoreVar('user_id', USER_ROOT);
if ($application->ConfigValue('eBay_UseFetchToken') == 1)
Index: in-auction/install.php
===================================================================
--- in-auction/install.php (revision 13557)
+++ in-auction/install.php (working copy)
@@ -33,7 +33,7 @@
$application =& kApplication::Instance();
$application->Init();
- if ($application->RecallVar('user_id') != -1) {
+ if ($application->RecallVar('user_id') != USER_ROOT) {
die('restricted access!');
}
Index: in-auction/hitcounter.php
===================================================================
--- in-auction/hitcounter.php (revision 13557)
+++ in-auction/hitcounter.php (working copy)
@@ -23,7 +23,7 @@
$application =& kApplication::Instance();
$application->Init();
- $application->StoreVar('user_id', -1); // root
+ $application->StoreVar('user_id', USER_ROOT);
$application->HandleEvent($event, 'l-ebay:OnHitAuction');
Index: in-auction/cron.php
===================================================================
--- in-auction/cron.php (revision 13557)
+++ in-auction/cron.php (working copy)
@@ -24,7 +24,7 @@
$application =& kApplication::Instance();
$application->Init();
- $application->StoreVar('user_id', -1); // root
+ $application->StoreVar('user_id', USER_ROOT);
$application->HandleEvent($event, 'l-ebay:OnListItems');
Index: custom/install.php
===================================================================
--- custom/install.php (revision 13557)
+++ custom/install.php (working copy)
@@ -22,7 +22,7 @@
$application =& kApplication::Instance();
$application->Init();
- if ($application->RecallVar('user_id') != -1) {
+ if ($application->RecallVar('user_id') != USER_ROOT) {
die('restricted access!');
}
|