install/includes/payload.php
changeset 616 e311f5e6f904
parent 536 218a627eb53e
child 626 be0e904eec17
equal deleted inserted replaced
615:8eed90734867 616:e311f5e6f904
    46   if ( !$q )
    46   if ( !$q )
    47     $db->_die();
    47     $db->_die();
    48   if ( $db->numrows() < 1 )
    48   if ( $db->numrows() < 1 )
    49     return false;
    49     return false;
    50   list($aes_key) = $db->fetchrow_num();
    50   list($aes_key) = $db->fetchrow_num();
    51   $aes_key = $aes->hextostring($aes_key);
    51   $aes_key = hexdecode($aes_key);
    52   
    52   
    53   $pass = $aes->decrypt($_POST['crypt_data'], $aes_key, ENC_HEX);
    53   $pass = $aes->decrypt($_POST['crypt_data'], $aes_key, ENC_HEX);
    54   if ( !$pass )
    54   if ( !$pass )
    55     return false;
    55     return false;
    56   
    56   
    96     return $sql_parser->parse();
    96     return $sql_parser->parse();
    97   
    97   
    98   $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
    98   $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE);
    99   
    99   
   100   $site_key = stg_make_private_key();
   100   $site_key = stg_make_private_key();
   101   $site_key = $aes->hextostring($site_key);
   101   $site_key = hexdecode($site_key);
   102   $admin_pass_clean = stg_password_decode();
   102   $admin_pass_clean = stg_password_decode();
   103   $admin_pass = $aes->encrypt($admin_pass_clean, $site_key, ENC_HEX);
   103   $admin_pass = $aes->encrypt($admin_pass_clean, $site_key, ENC_HEX);
   104   
   104   
   105   unset($admin_pass_clean); // Security
   105   unset($admin_pass_clean); // Security
   106   
   106   
   316   $result = install_language($lang_id, $lang_info['name_eng'], $lang_info['name'], ENANO_ROOT . "/language/{$lang_info['dir']}/core.json");
   316   $result = install_language($lang_id, $lang_info['name_eng'], $lang_info['name'], ENANO_ROOT . "/language/{$lang_info['dir']}/core.json");
   317   if ( !$result )
   317   if ( !$result )
   318     return false;
   318     return false;
   319   
   319   
   320   $lang_local = new Language($lang_id);
   320   $lang_local = new Language($lang_id);
       
   321   
   321   $lang_local->import( ENANO_ROOT . "/language/{$lang_info['dir']}/user.json" );
   322   $lang_local->import( ENANO_ROOT . "/language/{$lang_info['dir']}/user.json" );
   322   $lang_local->import( ENANO_ROOT . "/language/{$lang_info['dir']}/tools.json" );
   323   $lang_local->import( ENANO_ROOT . "/language/{$lang_info['dir']}/tools.json" );
   323   $lang_local->import( ENANO_ROOT . "/language/{$lang_info['dir']}/admin.json" );
   324   $lang_local->import( ENANO_ROOT . "/language/{$lang_info['dir']}/admin.json" );
   324   
   325   
   325   $q = $db->sql_query('SELECT lang_id FROM ' . table_prefix . 'language ORDER BY lang_id DESC LIMIT 1;');
   326   $q = $db->sql_query('SELECT lang_id FROM ' . table_prefix . 'language ORDER BY lang_id DESC LIMIT 1;');