Index: core/install/upgrades.sql
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/install/upgrades.sql	(revision 15640)
+++ core/install/upgrades.sql	(revision )
@@ -2883,3 +2883,5 @@
 UPDATE SystemSettings
 SET DisplayOrder = ROUND(DisplayOrder - 0.01, 2)
 WHERE (DisplayOrder BETWEEN 60.04 AND 60.10) AND (ModuleOwner = 'In-Portal') AND (Section = 'in-portal:configure_advanced');
+
+INSERT INTO SystemSettings VALUES(DEFAULT, 'RandomString', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_RandomString', 'text', '', '', 60.09, 0, 1, NULL);
Index: core/install.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/install.php	(revision 15601)
+++ core/install.php	(revision )
@@ -1052,6 +1052,17 @@
 						);
 						$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'SystemSettings');
 					}
+
+					$random_string = $this->Application->ConfigValue('RandomString');
+
+					if ( !$random_string ) {
+						$user_helper = $this->Application->recallObject('UserHelper');
+						/* @var $user_helper UserHelper */
+
+						$random_string = $user_helper->generateRandomString(64, true, true);
+						$this->Application->SetConfigValue('RandomString', $random_string);
+					}
+
 					break;
 			}
 
Index: core/install/install_data.sql
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/install/install_data.sql	(revision 15640)
+++ core/install/install_data.sql	(revision )
@@ -97,6 +97,7 @@
 INSERT INTO SystemSettings VALUES(DEFAULT, 'Backup_Path', '/home/alex/web/in-portal.rc/system/backupdata', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_backup_path', 'text', '', '', 60.06, 0, 1, NULL);
 INSERT INTO SystemSettings VALUES(DEFAULT, 'SystemTagCache', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_prompt_syscache_enable', 'checkbox', NULL, NULL, 60.07, 0, 0, NULL);
 INSERT INTO SystemSettings VALUES(DEFAULT, 'SocketBlockingMode', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_prompt_socket_blocking_mode', 'checkbox', NULL, NULL, 60.08, 0, 0, NULL);
+INSERT INTO SystemSettings VALUES(DEFAULT, 'RandomString', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_RandomString', 'text', '', '', 60.09, 0, 1, NULL);
 INSERT INTO SystemSettings VALUES(DEFAULT, 'EnableEmailLog', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsLogs', 'la_config_EnableEmailLog', 'radio', NULL, '1=la_Yes||0=la_No', 65.01, 0, 1, 'hint:la_config_EnableEmailLog');
 INSERT INTO SystemSettings VALUES(DEFAULT, 'EmailLogRotationInterval', '2419200', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsLogs', 'la_config_EmailLogRotationInterval', 'select', NULL, '86400=la_opt_OneDay||604800=la_opt_OneWeek||1209600=la_opt_TwoWeeks||2419200=la_opt_OneMonth||7257600=la_opt_ThreeMonths||29030400=la_opt_OneYear||-1=la_opt_EmailLogKeepForever', 65.02, 0, 0, 'hint:la_config_EmailLogRotationInterval');
 INSERT INTO SystemSettings VALUES(DEFAULT, 'SystemLogRotationInterval', '2419200', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsLogs', 'la_config_SystemLogRotationInterval', 'select', NULL, '86400=la_opt_OneDay||604800=la_opt_OneWeek||1209600=la_opt_TwoWeeks||2419200=la_opt_OneMonth||7257600=la_opt_ThreeMonths||29030400=la_opt_OneYear||-1=la_opt_SystemLogKeepForever', 65.03, 0, 1, 'hint:la_config_SystemLogRotationInterval');
@@ -1028,4 +1029,4 @@
 INSERT INTO PromoBlockGroups VALUES (DEFAULT, 'Default Group', UNIX_TIMESTAMP(), '1', '7.00', '0.60', '1', 'fade', '');
 
 INSERT INTO Modules VALUES ('Core', 'core/', 'adm', DEFAULT, 1, 1, '', 0, NULL, NULL);
-INSERT INTO Modules VALUES ('In-Portal', 'core/', 'm', DEFAULT, 1, 0, '', 0, NULL, NULL);
\ No newline at end of file
+INSERT INTO Modules VALUES ('In-Portal', 'core/', 'm', DEFAULT, 1, 0, '', 0, NULL, NULL);
Index: core/install/english.lang
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/install/english.lang	(revision 15640)
+++ core/install/english.lang	(revision )
@@ -193,6 +193,7 @@
 			<PHRASE Label="la_config_PathToWebsite" Module="Core" Type="1">UGF0aCB0byBXZWJzaXRl</PHRASE>
 			<PHRASE Label="la_config_PerformExactSearch" Module="Core" Type="1" Hint="U2VhcmNoIGZvciBhbGwgZW50ZXJlZCBrZXl3b3JkcywgaW5zdGVhZCBvZiBhbnkgb25lIG9mIHRoZW0=">UGVyZm9ybSBFeGFjdCBTZWFyY2g=</PHRASE>
 			<PHRASE Label="la_config_PerpageReviews" Module="Core" Type="1">Q29tbWVudHMgcGVyIHBhZ2U=</PHRASE>
+			<PHRASE Label="la_config_RandomString" Module="Core" Type="1">UmFuZG9tIFN0cmluZw==</PHRASE>
 			<PHRASE Label="la_config_RecycleBinFolder" Module="Core" Type="1">IlJlY3ljbGUgQmluIiBTZWN0aW9uSWQ=</PHRASE>
 			<PHRASE Label="la_config_RegistrationUsernameRequired" Module="Core" Type="1">VXNlcm5hbWUgUmVxdWlyZWQgRHVyaW5nIFJlZ2lzdHJhdGlvbg==</PHRASE>
 			<PHRASE Label="la_config_RememberLastAdminTemplate" Module="Core" Type="1">UmVzdG9yZSBsYXN0IHZpc2l0ZWQgQWRtaW4gU2VjdGlvbiBhZnRlciBMb2dpbg==</PHRASE>
@@ -2210,4 +2211,4 @@
 			<COUNTRY Iso="ZWE" Translation="WmltYmFid2U="/>
 		</COUNTRIES>
 	</LANGUAGE>
-</LANGUAGES>
\ No newline at end of file
+</LANGUAGES>
Index: core/units/helpers/user_helper.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/units/helpers/user_helper.php	(revision 15601)
+++ core/units/helpers/user_helper.php	(revision )
@@ -631,4 +631,74 @@
 
 			return $object->Update() ? '' : 'restore_impossible';
 		}
+
+		/**
+		 * Generates random string
+		 *
+		 * @param int $length
+		 * @param bool $special_chars
+		 * @param bool $extra_special_chars
+		 * @return string
+		 * @access public
+		 */
+		public function generateRandomString($length = 12, $special_chars = true, $extra_special_chars = false)
+		{
+			$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
+
+			if ( $special_chars ) {
+				$chars .= '!@#$%^&*()';
+			}
+
+			if ( $extra_special_chars ) {
+				$chars .= '-_ []{}<>~`+=,.;:/?|';
+			}
+
+			$password = '';
+
+			for ($i = 0; $i < $length; $i++) {
+				$password .= substr($chars, $this->_generateRandomNumber(0, strlen($chars) - 1), 1);
+			}
+
+			return $password;
+		}
+
+		/**
+		 * Generates a random number
+		 *
+		 * @param int $min Lower limit for the generated number (optional, default is 0)
+		 * @param int $max Upper limit for the generated number (optional, default is 4294967295)
+		 * @return int A random number between min and max
+		 * @access protected
+		 */
+		protected function _generateRandomNumber($min = 0, $max = 0)
+		{
+			static $rnd_value = '';
+
+			// Reset $rnd_value after 14 uses
+			// 32(md5) + 40(sha1) + 40(sha1) / 8 = 14 random numbers from $rnd_value
+			if ( strlen($rnd_value) < 8 ) {
+				$random_seed = $this->Application->getDBCache('random_seed');
+				$rnd_value = md5(uniqid(microtime() . mt_rand(), true) . $random_seed);
+				$rnd_value .= sha1($rnd_value);
+				$rnd_value .= sha1($rnd_value . $random_seed);
+				$random_seed = md5($random_seed . $rnd_value);
+				$this->Application->setDBCache('random_seed', $random_seed);
+			}
+
+			// Take the first 8 digits for our value
+			$value = substr($rnd_value, 0, 8);
+
+			// Strip the first eight, leaving the remainder for the next call to wp_rand().
+			$rnd_value = substr($rnd_value, 8);
+
+			$value = abs(hexdec($value));
+
+			// Reduce the value to be within the min - max range
+			// 4294967295 = 0xffffffff = max random number
+			if ( $max != 0 ) {
+				$value = $min + (($max - $min + 1) * ($value / (4294967295 + 1)));
+			}
+
+			return abs(intval($value));
+		}
-	}
+	}
\ No newline at end of file
