install/includes/payload.php
changeset 1175 1e2c9819ede3
parent 1164 1cd9e6df6f27
child 1227 bdac73ed481e
equal deleted inserted replaced
1174:def792dd9b1b 1175:1e2c9819ede3
   425 function stg_init_logs()
   425 function stg_init_logs()
   426 {
   426 {
   427   global $db, $session, $paths, $template, $plugins; // Common objects
   427   global $db, $session, $paths, $template, $plugins; // Common objects
   428   global $installer_version;
   428   global $installer_version;
   429   
   429   
   430   $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(ED_DATE | ED_TIME) . '\', \'' . $db->escape($_POST['username']) . '\', \'' . $db->escape(enano_version()) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');');
   430   $q = $db->sql_query('INSERT INTO ' . table_prefix . 'logs(log_type,action,time_id,date_string,author,author_uid,page_text,edit_summary) VALUES(\'security\', \'install_enano\', ' . time() . ', \'' . enano_date(ED_DATE | ED_TIME) . '\', \'' . $db->escape($_POST['username']) . '\', 2, \'' . $db->escape(enano_version()) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');');
   431   if ( !$q )
   431   if ( !$q )
   432   {
   432   {
   433     echo '<p><tt>MySQL return: ' . $db->sql_error() . '</tt></p>';
   433     echo '<p><tt>MySQL return: ' . $db->sql_error() . '</tt></p>';
   434     return false;
   434     return false;
   435   }
   435   }
   562 
   562 
   563 function stg_set_version()
   563 function stg_set_version()
   564 {
   564 {
   565   global $db, $session, $paths, $template, $plugins; // Common objects
   565   global $db, $session, $paths, $template, $plugins; // Common objects
   566   // log the upgrade
   566   // log the upgrade
   567   $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,page_text,edit_summary) VALUES'
   567   $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,author_uid,page_text,edit_summary) VALUES'
   568          . '(\'security\', \'upgrade_enano\', ' . time() . ', \'[DEPRECATED]\', \'' . $db->escape($session->username) . '\', \'' . $db->escape(installer_enano_version()) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');');
   568          . '(\'security\', \'upgrade_enano\', ' . time() . ', \'[DEPRECATED]\', \'' . $db->escape($session->username) . '\', ' . $session->user_id . ', \'' . $db->escape(installer_enano_version()) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');');
   569   if ( !$q )
   569   if ( !$q )
   570   {
   570   {
   571     $db->_die();
   571     $db->_die();
   572     return false;
   572     return false;
   573   }
   573   }