Index: branches/5.1.x/install.php =================================================================== diff -u -N -r13197 -r13580 --- branches/5.1.x/install.php (.../install.php) (revision 13197) +++ branches/5.1.x/install.php (.../install.php) (revision 13580) @@ -1,6 +1,6 @@ Init(); - if ($application->RecallVar('user_id') != -1) { + if ($application->RecallVar('user_id') != USER_ROOT) { die('restricted access!'); } Index: branches/5.1.x/units/articles/articles_config.php =================================================================== diff -u -N -r13568 -r13580 --- branches/5.1.x/units/articles/articles_config.php (.../articles_config.php) (revision 13568) +++ branches/5.1.x/units/articles/articles_config.php (.../articles_config.php) (revision 13580) @@ -1,6 +1,6 @@ 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: branches/5.1.x/units/articles/articles_event_handler.php =================================================================== diff -u -N -r13551 -r13580 --- branches/5.1.x/units/articles/articles_event_handler.php (.../articles_event_handler.php) (revision 13551) +++ branches/5.1.x/units/articles/articles_event_handler.php (.../articles_event_handler.php) (revision 13580) @@ -1,6 +1,6 @@ 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()));