Index: branches/5.1.x/units/links/links_config.php
===================================================================
diff -u -r13567 -r13579
--- branches/5.1.x/units/links/links_config.php	(.../links_config.php)	(revision 13567)
+++ branches/5.1.x/units/links/links_config.php	(.../links_config.php)	(revision 13579)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version	$Id: links_config.php 13567 2010-05-18 15:17:25Z alex $
+* @version	$Id: links_config.php 13579 2010-05-19 07:26:53Z alex $
 * @package	In-Link
 * @copyright	Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
 * @license      GNU/GPL
@@ -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: branches/5.1.x/units/listings/listings_config.php
===================================================================
diff -u -r13550 -r13579
--- branches/5.1.x/units/listings/listings_config.php	(.../listings_config.php)	(revision 13550)
+++ branches/5.1.x/units/listings/listings_config.php	(.../listings_config.php)	(revision 13579)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version	$Id: listings_config.php 13550 2010-05-11 21:16:03Z alex $
+* @version	$Id: listings_config.php 13579 2010-05-19 07:26:53Z alex $
 * @package	In-Link
 * @copyright	Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
 * @license      GNU/GPL
@@ -106,29 +106,29 @@
 					'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 (
 						'ListingId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,),
 						'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: branches/5.1.x/install.php
===================================================================
diff -u -r13196 -r13579
--- branches/5.1.x/install.php	(.../install.php)	(revision 13196)
+++ branches/5.1.x/install.php	(.../install.php)	(revision 13579)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version	$Id: install.php 13196 2010-03-10 10:44:07Z alex $
+* @version	$Id: install.php 13579 2010-05-19 07:26:53Z alex $
 * @package	In-Link
 * @copyright	Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
 * @license      GNU/GPL
@@ -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!');
 	}