install.php
changeset 229 b2f985e4cef3
parent 227 0f039028f7a5
child 238 f948557af068
equal deleted inserted replaced
228:7846d45bd250 229:b2f985e4cef3
   327 {
   327 {
   328   static $decrypted_pass = false;
   328   static $decrypted_pass = false;
   329   if ( $act_get )
   329   if ( $act_get )
   330     return $decrypted_pass;
   330     return $decrypted_pass;
   331   
   331   
   332   $aes = new AESCrypt(AES_BITS, AES_BLOCKSIZE);
   332   $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
   333   
   333   
   334   if ( !empty($_POST['crypt_data']) )
   334   if ( !empty($_POST['crypt_data']) )
   335   {
   335   {
   336     require('config.new.php');
   336     require('config.new.php');
   337     if ( !isset($cryptkey) )
   337     if ( !isset($cryptkey) )
   357 {
   357 {
   358   static $key = false;
   358   static $key = false;
   359   if ( $act_get )
   359   if ( $act_get )
   360     return $key;
   360     return $key;
   361   
   361   
   362   $aes = new AESCrypt(AES_BITS, AES_BLOCKSIZE);
   362   $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
   363   $key = $aes->gen_readymade_key();
   363   $key = $aes->gen_readymade_key();
   364   return true;
   364   return true;
   365 }
   365 }
   366 
   366 
   367 function stg_parse_schema($act_get = false)
   367 function stg_parse_schema($act_get = false)
   370   if ( $act_get )
   370   if ( $act_get )
   371     return $schema;
   371     return $schema;
   372   
   372   
   373   $admin_pass = stg_decrypt_admin_pass(true);
   373   $admin_pass = stg_decrypt_admin_pass(true);
   374   $key = stg_generate_aes_key(true);
   374   $key = stg_generate_aes_key(true);
   375   $aes = new AESCrypt(AES_BITS, AES_BLOCKSIZE);
   375   $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
   376   $key = $aes->hextostring($key);
   376   $key = $aes->hextostring($key);
   377   $admin_pass = $aes->encrypt($admin_pass, $key, ENC_HEX);
   377   $admin_pass = $aes->encrypt($admin_pass, $key, ENC_HEX);
   378   
   378   
   379   $cacheonoff = is_writable(ENANO_ROOT.'/cache/') ? '1' : '0';
   379   $cacheonoff = is_writable(ENANO_ROOT.'/cache/') ? '1' : '0';
   380   
   380   
   450   // This means we'll have to update the encrypted password in the database.
   450   // This means we'll have to update the encrypted password in the database.
   451   if ( $already_run )
   451   if ( $already_run )
   452   {
   452   {
   453     $admin_pass = stg_decrypt_admin_pass(true);
   453     $admin_pass = stg_decrypt_admin_pass(true);
   454     $key = stg_generate_aes_key(true);
   454     $key = stg_generate_aes_key(true);
   455     $aes = new AESCrypt(AES_BITS, AES_BLOCKSIZE);
   455     $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
   456     $key = $aes->hextostring($key);
   456     $key = $aes->hextostring($key);
   457     $admin_pass = $aes->encrypt($admin_pass, $key, ENC_HEX);
   457     $admin_pass = $aes->encrypt($admin_pass, $key, ENC_HEX);
   458     $admin_user = mysql_real_escape_string($_POST['admin_user']);
   458     $admin_user = mysql_real_escape_string($_POST['admin_user']);
   459     $admin_user = str_replace('_', ' ', $admin_user);
   459     $admin_user = str_replace('_', ' ', $admin_user);
   460     
   460     
  1332       $template->footer();
  1332       $template->footer();
  1333       exit;
  1333       exit;
  1334     }
  1334     }
  1335     unset($_POST['_cont']);
  1335     unset($_POST['_cont']);
  1336     require('config.new.php');
  1336     require('config.new.php');
  1337     $aes = new AESCrypt(AES_BITS, AES_BLOCKSIZE);
  1337     $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
  1338     if ( isset($crypto_key) )
  1338     if ( isset($crypto_key) )
  1339     {
  1339     {
  1340       $cryptkey = $crypto_key;
  1340       $cryptkey = $crypto_key;
  1341     }
  1341     }
  1342     if(!isset($cryptkey) || ( isset($cryptkey) && strlen($cryptkey) != AES_BITS / 4) )
  1342     if(!isset($cryptkey) || ( isset($cryptkey) && strlen($cryptkey) != AES_BITS / 4) )