install/includes/payload.php
changeset 984 18f5a15b810c
parent 924 142a29b583f9
child 1081 745200a9cc2a
equal deleted inserted replaced
983:36e42d787d1d 984:18f5a15b810c
   423 function stg_init_logs()
   423 function stg_init_logs()
   424 {
   424 {
   425   global $db, $session, $paths, $template, $plugins; // Common objects
   425   global $db, $session, $paths, $template, $plugins; // Common objects
   426   global $installer_version;
   426   global $installer_version;
   427   
   427   
   428   $q = $db->sql_query('INSERT INTO ' . table_prefix . 'logs(log_type,action,time_id,date_string,author,page_text,edit_summary) VALUES(\'security\', \'install_enano\', ' . time() . ', \'' . enano_date('d M Y h:i a') . '\', \'' . $db->escape($_POST['admin_user']) . '\', \'' . $db->escape(enano_version()) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');');
   428   $q = $db->sql_query('INSERT INTO ' . table_prefix . 'logs(log_type,action,time_id,date_string,author,page_text,edit_summary) VALUES(\'security\', \'install_enano\', ' . time() . ', \'' . enano_date('d M Y h:i a') . '\', \'' . $db->escape($_POST['username']) . '\', \'' . $db->escape(enano_version()) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');');
   429   if ( !$q )
   429   if ( !$q )
   430   {
   430   {
   431     echo '<p><tt>MySQL return: ' . $db->sql_error() . '</tt></p>';
   431     echo '<p><tt>MySQL return: ' . $db->sql_error() . '</tt></p>';
   432     return false;
   432     return false;
   433   }
   433   }
   475     echo '<p>Can\'t rename config.php</p>';
   475     echo '<p>Can\'t rename config.php</p>';
   476     _stg_rename_config_revert();
   476     _stg_rename_config_revert();
   477     return false;
   477     return false;
   478   }
   478   }
   479   
   479   
   480   if ( filesize(ENANO_ROOT . '/.htaccess.new') > 1 )
   480   if ( @filesize(ENANO_ROOT . '/.htaccess.new') > 1 )
   481   {
   481   {
   482     // rename/possibly concatenate .htaccess.new
   482     // rename/possibly concatenate .htaccess.new
   483     $htaccess_base = '';
   483     $htaccess_base = '';
   484     if ( file_exists(ENANO_ROOT . '/.htaccess') )
   484     if ( file_exists(ENANO_ROOT . '/.htaccess') )
   485       $htaccess_base .= @file_get_contents(ENANO_ROOT . '/.htaccess');
   485       $htaccess_base .= @file_get_contents(ENANO_ROOT . '/.htaccess');