matheuslmb

Untitled

Jul 16th, 2017
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.07 KB | None | 0 0
  1. <?PHP
  2. // comment to show E_NOTICE [undefinied variable etc.], comment if you want make script and see all errors
  3. error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
  4. define('INITIALIZED', true);
  5. define('ONLY_PAGE', false);
  6. if(!file_exists('install.txt'))
  7. {
  8. echo('AAC installation is disabled. To enable it make file <b>install.php</b> in main AAC directory and put there your IP.');
  9. exit;
  10.  
  11. $time_start = microtime(true);
  12. session_start();
  13.  
  14. function autoLoadClass($className)
  15. {
  16. if(!class_exists($className))
  17. if(file_exists('./classes/' . strtolower($className) . '.php'))
  18. include_once('./classes/' . strtolower($className) . '.php');
  19. else
  20. new Error_Critic('#E-7', 'Cannot load class <b>' . $className . '</b>, file <b>./classes/class.' . strtolower($className) . '.php</b> doesn\'t exist');
  21. }
  22. spl_autoload_register('autoLoadClass');
  23.  
  24. //load acc. maker config to $config['site']
  25. $config = array();
  26. include('./config/config.php');
  27. if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc())
  28. {
  29. $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
  30. while(list($key, $val) = each($process))
  31. {
  32. foreach ($val as $k => $v)
  33. {
  34. unset($process[$key][$k]);
  35. if(is_array($v))
  36. {
  37. $process[$key][stripslashes($k)] = $v;
  38. $process[] = &$process[$key][stripslashes($k)];
  39. }
  40. else
  41. $process[$key][stripslashes($k)] = stripslashes($v);
  42. }
  43. }
  44. unset($process);
  45. }
  46.  
  47.  
  48.  
  49. $page = '';
  50. if(isset($_REQUEST['page']))
  51. $page = $_REQUEST['page'];
  52. $step = 'start';
  53. if(isset($_REQUEST['step']))
  54. $step = $_REQUEST['step'];
  55. // load server path
  56. function getServerPath()
  57. {
  58. $config = array();
  59. include('./config/config.php');
  60. return $config['site']['serverPath'];
  61. }
  62. // save server path
  63. function setServerPath($newPath)
  64. {
  65. $file = fopen("./config/config.php", "r");
  66. $lines = array();
  67. while (!feof($file)) {
  68. $lines[] = fgets($file);
  69. }
  70. fclose($file);
  71.  
  72. $newConfig = array();
  73. foreach ($lines as $i => $line)
  74. {
  75. if(substr($line, 0, strlen('$config[\'site\'][\'serverPath\']')) == '$config[\'site\'][\'serverPath\']')
  76. $newConfig[] = '$config[\'site\'][\'serverPath\'] = "' . str_replace('"', '\"' , $newPath) . '";' . PHP_EOL; // do something with each line from text file here
  77. else
  78. $newConfig[] = $line;
  79. }
  80. Website::putFileContents("./config/config.php", implode('', $newConfig));
  81. }
  82. if($page == '')
  83. {
  84. echo '<html>
  85. <head>
  86. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
  87. <title>Installation of account maker</title>
  88. </head>
  89. <frameset cols="230,*">
  90. <frame name="menu" src="install.php?page=menu" />
  91. <frame name="step" src="install.php?page=step&step=start" />
  92. <noframes><body>Frames don\'t work. Install Firefox :P</body></noframes>
  93. </frameset>
  94. </html>';
  95. }
  96. elseif($page == 'menu')
  97. {
  98. echo '<h2>MENU</h2><br>
  99. <b>IF NOT INSTALLED:</b><br>
  100. <a href="install.php?page=step&step=start" target="step">0. Informations</a><br>
  101. <a href="install.php?page=step&step=1" target="step">1. Set server path</a><br>
  102. <a href="install.php?page=step&step=2" target="step">2. Check DataBase connection</a><br>
  103. <a href="install.php?page=step&step=3" target="step">3. Add tables and columns to DB</a><br>
  104. <a href="install.php?page=step&step=4" target="step">4. Add samples to DB</a><br>
  105. <a href="install.php?page=step&step=5" target="step">5. Set Admin Account</a><br>
  106. <b>Author:</b><br>
  107. Gesior<br>
  108. Compatible with TFS 0.3.6 and TFS 0.4 up to revision 3702</a>';
  109. }
  110. elseif($page == 'step')
  111. {
  112. if($step >= 2 && $step <= 5)
  113. {
  114. //load server config $config['server']
  115. if(Website::getWebsiteConfig()->getValue('useServerConfigCache'))
  116. {
  117. // use cache to make website load faster
  118. if(Website::fileExists('./config/server.config.php'))
  119. {
  120. $tmp_php_config = new ConfigPHP('./config/server.config.php');
  121. $config['server'] = $tmp_php_config->getConfig();
  122. }
  123. else
  124. {
  125. // if file isn't cache we should load .lua file and make .php cache
  126. $tmp_lua_config = new ConfigLUA(Website::getWebsiteConfig()->getValue('serverPath') . 'config.lua');
  127. $config['server'] = $tmp_lua_config->getConfig();
  128. $tmp_php_config = new ConfigPHP();
  129. $tmp_php_config->setConfig($tmp_lua_config->getConfig());
  130. $tmp_php_config->saveToFile('./config/server.config.php');
  131. }
  132. }
  133. else
  134. {
  135. $tmp_lua_config = new ConfigLUA(Website::getWebsiteConfig()->getValue('serverPath') . 'config.lua');
  136. $config['server'] = $tmp_lua_config->getConfig();
  137. }
  138. if(Website::getServerConfig()->isSetKey('mysqlHost'))
  139. {
  140. define('SERVERCONFIG_SQL_HOST', 'mysqlHost');
  141. define('SERVERCONFIG_SQL_PORT', 'mysqlPort');
  142. define('SERVERCONFIG_SQL_USER', 'mysqlUser');
  143. define('SERVERCONFIG_SQL_PASS', 'mysqlPass');
  144. define('SERVERCONFIG_SQL_DATABASE', 'mysqlDatabase');
  145. define('SERVERCONFIG_SQLITE_FILE', 'sqlFile');
  146. }
  147. else
  148. new Error_Critic('#E-3', 'There is no key <b>mysqlHost</b> in server config', array(new Error('INFO', 'use server config cache: <b>' . (Website::getWebsiteConfig()->getValue('useServerConfigCache') ? 'true' : 'false') . '</b>')));
  149.  
  150. Website::setDatabaseDriver(Database::DB_MYSQL);
  151. if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_HOST))
  152. Website::getDBHandle()->setDatabaseHost(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_HOST));
  153. else
  154. new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_HOST . '</b> in server config file.');
  155. if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PORT))
  156. Website::getDBHandle()->setDatabasePort(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PORT));
  157. else
  158. new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PORT . '</b> in server config file.');
  159. if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_DATABASE))
  160. Website::getDBHandle()->setDatabaseName(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_DATABASE));
  161. else
  162. new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_DATABASE . '</b> in server config file.');
  163. if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_USER))
  164. Website::getDBHandle()->setDatabaseUsername(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_USER));
  165. else
  166. new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_USER . '</b> in server config file.');
  167. if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PASS))
  168. Website::getDBHandle()->setDatabasePassword(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PASS));
  169. else
  170. new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PASS . '</b> in server config file.');
  171. Website::updatePasswordEncryption();
  172. $SQL = Website::getDBHandle();
  173. }
  174.  
  175. if($step == 'start')
  176. {
  177. echo '<h1>STEP '.$step.'</h1>Informations<br>';
  178. echo 'Welcome to Gesior Account Maker installer. <b>After 5 simple steps account maker will be ready to use!</b><br />';
  179. // check access to write files
  180. $writeable = array('config/config.php', 'cache', 'cache/flags', 'cache/DONT_EDIT_usercounter.txt', 'cache/DONT_EDIT_serverstatus.txt', 'custom_scripts', 'install.txt');
  181. foreach($writeable as $fileToWrite)
  182. {
  183. if(is_writable($fileToWrite))
  184. echo '<span style="color:green">CAN WRITE TO FILE: <b>' . $fileToWrite . '</b></span><br />';
  185. else
  186. echo '<span style="color:red">CANNOT WRITE TO FILE: <b>' . $fileToWrite . '</b> - edit file access for PHP [on linux: chmod]</span><br />';
  187. }
  188. }
  189. elseif($step == 1)
  190. {
  191. if(isset($_REQUEST['server_path']))
  192. {
  193. echo '<h1>STEP '.$step.'</h1>Check server configuration<br>';
  194. $path = $_REQUEST['server_path'];
  195. $path = trim($path)."\\";
  196. $path = str_replace("\\\\", "/", $path);
  197. $path = str_replace("\\", "/", $path);
  198. $path = str_replace("//", "/", $path);
  199. setServerPath($path);
  200. $tmp_lua_config = new ConfigLUA($path . 'config.lua');
  201. $config['server'] = $tmp_lua_config->getConfig();
  202. if(isset($config['server']['mysqlHost']))
  203. {
  204. echo 'File <b>config.lua</b> loaded from <font color="red"><i>'.$path.'config.lua</i></font>. It looks like fine server config file. Now you can check database connection: <a href="install.php?page=step&step=2">STEP 2 - check database connection</a>';
  205. }
  206. else
  207. {
  208. echo 'File <b>config.lua</b> loaded from <font color="red"><i>'.$path.'config.lua</i></font> and it\'s not valid TFS config.lua file. <a href="install.php?page=step&step=1">Go to STEP 1 - select other directory.</a> If it\'s your config.lua file from TFS contact with acc. maker author.';
  209. }
  210. }
  211. else
  212. {
  213. echo 'Please write you TFS directory below. Like: <i>C:\Documents and Settings\Gesior\Desktop\TFS 0.2.9\</i><form action="install.php">
  214. <input type="text" name="server_path" size="90" value="'.htmlspecialchars(getServerPath()).'" /><input type="hidden" name="page" value="step" /><input type="hidden" name="step" value="1" /><input type="submit" value="Set server path" />
  215. </form>';
  216. }
  217. }
  218. elseif($step == 2)
  219. {
  220. echo '<h1>STEP '.$step.'</h1>Check database connection<br>';
  221. echo 'If you don\'t see any errors press <a href="install.php?page=step&step=3">link to STEP 3 - Add tables and columns to DB</a>. If you see some errors it mean server has wrong configuration. Check FAQ or ask author of acc. maker.<br />';
  222. $SQL->connect(); // show errors if can't connect
  223. }
  224. elseif($step == 3)
  225. {
  226. echo '<h1>STEP '.$step.'</h1>Add tables and columns to DB<br>';
  227. echo 'Installer try to add new tables and columns to database.<br>';
  228. $columns = array();
  229. //$columns[] = array('table', 'name_of_column', 'type', 'length', 'default');
  230. $columns[] = array('accounts', 'key', 'VARCHAR', '20', '0');
  231. $columns[] = array('accounts', 'email_new', 'VARCHAR', '255', '');
  232. $columns[] = array('accounts', 'email_new_time', 'INT', '11', '0');
  233. $columns[] = array('accounts', 'rlname', 'VARCHAR', '255', '');
  234. $columns[] = array('accounts', 'location', 'VARCHAR', '255', '');
  235. $columns[] = array('accounts', 'page_access', 'INT', '11', '0');
  236. $columns[] = array('accounts', 'email_code', 'VARCHAR', '255', '');
  237. $columns[] = array('accounts', 'next_email', 'INT', '11', '0');
  238. $columns[] = array('accounts', 'premium_points', 'INT', '11', '0');
  239. $columns[] = array('accounts', 'create_date', 'INT', '11', '0');
  240. $columns[] = array('accounts', 'create_ip', 'INT', '11', '0');
  241. $columns[] = array('accounts', 'last_post', 'INT', '11', '0');
  242. $columns[] = array('accounts', 'flag', 'VARCHAR', '80', '');
  243.  
  244. $columns[] = array('guilds', 'description', 'TEXT', '', '');
  245. $columns[] = array('guilds', 'guild_logo', 'MEDIUMBLOB', '', NULL);
  246. $columns[] = array('guilds', 'create_ip', 'INT', '11', '0');
  247. $columns[] = array('guilds', 'balance', 'BIGINT UNSIGNED', '', '0');
  248.  
  249. $columns[] = array('players', 'deleted', 'TINYINT', '1', '0');
  250. $columns[] = array('players', 'description', 'VARCHAR', '255', '');
  251. $columns[] = array('players', 'comment', 'TEXT', '', '');
  252. $columns[] = array('players', 'create_ip', 'INT', '11', '0');
  253. $columns[] = array('players', 'create_date', 'INT', '11', '0');
  254. $columns[] = array('players', 'hide_char', 'INT', '11', '0');
  255.  
  256. $tables = array();
  257. // mysql tables
  258. $tables[Database::DB_MYSQL]['z_ots_comunication'] = "CREATE TABLE `z_ots_comunication` (
  259. `id` int(11) NOT NULL auto_increment,
  260. `name` varchar(255) NOT NULL,
  261. `type` varchar(255) NOT NULL,
  262. `action` varchar(255) NOT NULL,
  263. `param1` varchar(255) NOT NULL,
  264. `param2` varchar(255) NOT NULL,
  265. `param3` varchar(255) NOT NULL,
  266. `param4` varchar(255) NOT NULL,
  267. `param5` varchar(255) NOT NULL,
  268. `param6` varchar(255) NOT NULL,
  269. `param7` varchar(255) NOT NULL,
  270. `delete_it` int(2) NOT NULL default '1',
  271. PRIMARY KEY (`id`)
  272. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
  273. $tables[Database::DB_MYSQL]['z_shop_offer'] = "CREATE TABLE `z_shop_offer` (
  274. `id` int(11) NOT NULL auto_increment,
  275. `points` int(11) NOT NULL default '0',
  276. `itemid1` int(11) NOT NULL default '0',
  277. `count1` int(11) NOT NULL default '0',
  278. `itemid2` int(11) NOT NULL default '0',
  279. `count2` int(11) NOT NULL default '0',
  280. `offer_type` varchar(255) default NULL,
  281. `offer_description` text NOT NULL,
  282. `offer_name` varchar(255) NOT NULL,
  283. PRIMARY KEY (`id`)
  284. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
  285. $tables[Database::DB_MYSQL]['z_shop_history_item'] = "CREATE TABLE `z_shop_history_item` (
  286. `id` int(11) NOT NULL auto_increment,
  287. `to_name` varchar(255) NOT NULL default '0',
  288. `to_account` int(11) NOT NULL default '0',
  289. `from_nick` varchar(255) NOT NULL,
  290. `from_account` int(11) NOT NULL default '0',
  291. `price` int(11) NOT NULL default '0',
  292. `offer_id` varchar(255) NOT NULL default '',
  293. `trans_state` varchar(255) NOT NULL,
  294. `trans_start` int(11) NOT NULL default '0',
  295. `trans_real` int(11) NOT NULL default '0',
  296. PRIMARY KEY (`id`)
  297. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
  298. $tables[Database::DB_MYSQL]['z_forum'] = "CREATE TABLE `z_forum` (
  299. `id` int(11) NOT NULL auto_increment,
  300. `first_post` int(11) NOT NULL default '0',
  301. `last_post` int(11) NOT NULL default '0',
  302. `section` int(3) NOT NULL default '0',
  303. `replies` int(20) NOT NULL default '0',
  304. `views` int(20) NOT NULL default '0',
  305. `author_aid` int(20) NOT NULL default '0',
  306. `author_guid` int(20) NOT NULL default '0',
  307. `post_text` text NOT NULL,
  308. `post_topic` varchar(255) NOT NULL,
  309. `post_smile` tinyint(1) NOT NULL default '0',
  310. `post_date` int(20) NOT NULL default '0',
  311. `last_edit_aid` int(20) NOT NULL default '0',
  312. `edit_date` int(20) NOT NULL default '0',
  313. `post_ip` varchar(15) NOT NULL default '0.0.0.0',
  314. PRIMARY KEY (`id`),
  315. KEY `section` (`section`)
  316. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
  317.  
  318. foreach($columns as $column)
  319. {
  320. if($column[4] === NULL && $SQL->query('ALTER TABLE ' . $SQL->tableName($column[0]) . ' ADD ' . $SQL->fieldName($column[1]) . ' ' . $column[2] . ' NULL DEFAULT NULL') !== false)
  321. echo "<span style=\"color:green\">Column <b>" . $column[1] . "</b> added to table <b>" . $column[0] . "</b>.</span><br />";
  322. elseif($SQL->query('ALTER TABLE ' . $SQL->tableName($column[0]) . ' ADD ' . $SQL->fieldName($column[1]) . ' ' . $column[2] . '' . (($column[3] == '') ? '' : '(' . $column[3] . ')') . ' NOT NULL DEFAULT \'' . $column[4] . '\'') !== false)
  323. echo "<span style=\"color:green\">Column <b>" . $column[1] . "</b> added to table <b>" . $column[0] . "</b>.</span><br />";
  324. else
  325. echo "Could not add column <b>" . $column[1] . "</b> to table <b>" . $column[0] . "</b>. Already exist?<br />";
  326. }
  327. foreach($tables[$SQL->getDatabaseDriver()] as $tableName => $tableQuery)
  328. {
  329. if($SQL->query($tableQuery) !== false)
  330. echo "<span style=\"color:green\">Table <b>" . $tableName . "</b> created.</span><br />";
  331. else
  332. echo "Could not create table <b>" . $tableName . "</b>. Already exist?<br />";
  333. }
  334. echo 'Tables and columns added to database.<br>Go to <a href="install.php?page=step&step=4">STEP 4 - Add samples</a>';
  335. }
  336. elseif($step == 4)
  337. {
  338. echo '<h1>STEP '.$step.'</h1>Add samples to DB:<br>';
  339. $samplePlayers = array();
  340. $samplePlayers[0] = 'Rook Sample';
  341. $samplePlayers[1] = 'Sorcerer Sample';
  342. $samplePlayers[2] = 'Druid Sample';
  343. $samplePlayers[3] = 'Paladin Sample';
  344. $samplePlayers[4] = 'Knight Sample';
  345.  
  346. $account = new Account(1, Account::LOADTYPE_NAME);
  347. if(!$account->isLoaded())
  348. {
  349. $account->setName(1);
  350. $account->setPassword(1);
  351. $account->setMail(rand(0,999999) . '@gmail.com');
  352. $account->setPageAccess(3);
  353. $account->setFlag('unknown');
  354. $account->setCreateIP(Visitor::getIP());
  355. $account->setCreateDate(time());
  356. $account->save();
  357. }
  358. $newPlayer = new Player('Account Manager', Player::LOADTYPE_NAME);
  359. if(!$newPlayer->isLoaded())
  360. {
  361. $newPlayer->setComment('');
  362. $newPlayer->setName('Account Manager');
  363. $newPlayer->setAccountID($account->getID());
  364. $newPlayer->setLevel(8);
  365. $newPlayer->setExperience(4200);
  366. $newPlayer->setGroupID(1);
  367. $newPlayer->setVocation(0);
  368. $newPlayer->setHealth(185);
  369. $newPlayer->setHealthMax(185);
  370. $newPlayer->setMana(35);
  371. $newPlayer->setManaMax(35);
  372. $newPlayer->setTown(1);
  373. $newPlayer->setSoul(100);
  374. $newPlayer->setCapacity(420);
  375. $newPlayer->setSave(1);
  376. $newPlayer->setStamina(2520);
  377. $newPlayer->setLookType(128);
  378. $newPlayer->setLookBody(44);
  379. $newPlayer->setLookFeet(98);
  380. $newPlayer->setLookHead(15);
  381. $newPlayer->setLookLegs(76);
  382.  
  383. $newPlayer->setSkill(0, 10);
  384. $newPlayer->setSkill(1, 10);
  385. $newPlayer->setSkill(2, 10);
  386. $newPlayer->setSkill(3, 10);
  387. $newPlayer->setSkill(4, 10);
  388. $newPlayer->setSkill(5, 10);
  389. $newPlayer->setSkill(6, 10);
  390.  
  391. $newPlayer->setSkillCount(0, 0);
  392. $newPlayer->setSkillCount(1, 0);
  393. $newPlayer->setSkillCount(2, 0);
  394. $newPlayer->setSkillCount(3, 0);
  395. $newPlayer->setSkillCount(4, 0);
  396. $newPlayer->setSkillCount(5, 0);
  397. $newPlayer->setSkillCount(6, 0);
  398.  
  399. $newPlayer->save();
  400. }
  401.  
  402. if ($newPlayer->isLoaded()) {
  403. foreach ($samplePlayers as $vocationID => $name) {
  404. $samplePlayer = new Player($name, Player::LOADTYPE_NAME);
  405. if (!$samplePlayer->isLoaded()) {
  406. $samplePlayer = new Player('Account Manager', Player::LOADTYPE_NAME);
  407. $samplePlayer->setID(null); // save as new player, not edited
  408. $samplePlayer->setName($name);
  409. $samplePlayer->setVocation($vocationID);
  410. $samplePlayer->setGroupID(1);
  411. $samplePlayer->setLookType(128);
  412. $samplePlayer->save();
  413. echo '<span style="color:green">Added sample character: </span><span style="color:green;font-weight:bold">' . $name . '</span><br/>';
  414. } else {
  415. echo 'Sample character: <span style="font-weight:bold">' . $name . '</span> already exist in database<br/>';
  416. }
  417. }
  418. } else {
  419. new Error_Critic('', 'Character <i>Account Manager</i> does not exist. Cannot install sample characters!');
  420. }
  421. }
  422. elseif($step == 5)
  423. {
  424. echo '<h1>STEP '.$step.'</h1>Set Admin Account<br>';
  425. if(empty($_REQUEST['saveaccpassword']))
  426. {
  427. echo 'Admin account login is: <b>1</b><br/>Set new password to this account.<br>';
  428. echo 'New password: <form action="install.php" method=POST><input type="text" name="newpass" size="35">(Don\'t give it password to anyone!)';
  429. echo '<input type="hidden" name="saveaccpassword" value="yes"><input type="hidden" name="page" value="step"><input type="hidden" name="step" value="5"><input type="submit" value="SET"></form><br>If account with login 1 doesn\'t exist installator will create it and set your password.';
  430. }
  431. else
  432. {
  433. include_once('./system/load.compat.php');
  434. $newpass = trim($_POST['newpass']);
  435. if (!check_password($newpass)) {
  436. echo 'Password contains illegal characters. Please use only a-Z and 0-9. <a href="install.php?page=step&step=5">GO BACK</a> and write other password.';
  437. } else {
  438. //create / set pass to admin account
  439. $account = new Account(1, Account::LOADTYPE_NAME);
  440. if ($account->isLoaded()) {
  441. $account->setPassword($newpass); // setPassword encrypt it to ots encryption
  442. $account->setPageAccess(3);
  443. $account->setFlag('unknown');
  444. $account->save();
  445. } else {
  446. $newAccount = new Account();
  447. $newAccount->setName(1);
  448. $newAccount->setPassword($newpass); // setPassword encrypt it to ots encryption
  449. $newAccount->setMail(rand(0, 999999) . '@gmail.com');
  450. $newAccount->setPageAccess(3);
  451. $newAccount->setGroupID(1);
  452. $newAccount->setFlag('unknown');
  453. $newAccount->setCreateIP(Visitor::getIP());
  454. $newAccount->setCreateDate(time());
  455. }
  456. $_SESSION['account'] = 1;
  457. $_SESSION['password'] = $newpass;
  458. $logged = TRUE;
  459. echo '<h1>Admin account login: 1<br>Admin account password: ' . $newpass . '</h1><br/><h3>It\'s end of installation. Installation is blocked!</h3>';
  460. if (!unlink('install.txt')) {
  461. new Error_Critic('', 'Cannot remove file <i>install.txt</i>. You must remove it to disable installer. I recommend you to go to step <i>0</i> and check if any other file got problems with WRITE permission.');
  462. }
  463. }
Advertisement
Add Comment
Please, Sign In to add comment