Exemplo n.º 1
0
         } else {
             $newpass = $_POST['newpass'];
             if (!check_password($newpass)) {
                 echo 'Password contains illegal characters. Please use only a-Z and 0-9. <a href="install.php?page=step&step=5&server_conf=yes">GO BACK</a> and write other password.';
             } else {
                 $newpass_to_db = password_ency($newpass);
                 $account = new OTS_Account();
                 $account->load(1);
                 if ($account->isLoaded()) {
                     $account->setPassword($newpass_to_db);
                     $account->save();
                     $account->setCustomField("page_access", 6);
                 } else {
                     $number = $account->create(1, 1, 1);
                     $account->setPassword($newpass_to_db);
                     $account->unblock();
                     $account->save();
                     $account->setCustomField("page_access", 6);
                 }
                 $_SESSION['account'] = 1;
                 $_SESSION['password'] = $newpass;
                 $logged = TRUE;
                 $account->setCustomField("page_lastday", time());
                 echo '<h1>Admin account number: 1<br>Admin account password: '******'newpass'] . '</h1><br/><h3>It\'s end of first part of installation. Installation is blocked. From now don\'t modify file config.ini!<br>Press links to STEPs 6 and 7 in menu.</h3>';
                 $config['site']['install'] = 'no';
                 saveconfig_ini($config['site']);
             }
         }
     }
 } else {
     echo "Account maker is already installed! To reinstall open file 'config.ini' in directory 'config' and change:<br/><b>install = \"no\"</b><br/>to:</br><b>install = \"start\"</b><br/>and enter this site again.";