install/includes/payload.php
changeset 1259 49db7495f6b8
parent 1240 2b6cdff92b09
equal deleted inserted replaced
1258:d972b1276d95 1259:49db7495f6b8
   152 		{
   152 		{
   153 			echo $db->get_error();
   153 			echo $db->get_error();
   154 			return false;
   154 			return false;
   155 		}
   155 		}
   156 	}
   156 	}
       
   157 	
       
   158 	global $db_version;
       
   159 	setConfig('db_version', $db_version);
       
   160 	
   157 	return true;
   161 	return true;
   158 }
   162 }
   159 
   163 
   160 function stg_write_config()
   164 function stg_write_config()
   161 {
   165 {
   567 
   571 
   568 function stg_set_version()
   572 function stg_set_version()
   569 {
   573 {
   570 	global $db, $session, $paths, $template, $plugins; // Common objects
   574 	global $db, $session, $paths, $template, $plugins; // Common objects
   571 	// log the upgrade
   575 	// log the upgrade
       
   576 	global $db_version;
   572 	$q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,author_uid,page_text,edit_summary) VALUES'
   577 	$q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,author_uid,page_text,edit_summary) VALUES'
   573  				. '(\'security\', \'upgrade_enano\', ' . time() . ', \'[DEPRECATED]\', \'' . $db->escape($session->username) . '\', ' . $session->user_id . ', \'' . $db->escape(installer_enano_version()) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');');
   578  				. '(\'security\', \'upgrade_enano\', ' . time() . ', \'[DEPRECATED]\', \'' . $db->escape($session->username) . '\', ' . $session->user_id . ', \'' . $db->escape($db_version) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');');
   574 	if ( !$q )
   579 	if ( !$q )
   575 	{
   580 	{
   576 		$db->_die();
   581 		$db->_die();
   577 		return false;
   582 		return false;
   578 	}
   583 	}
       
   584 	setConfig('db_version', $db_version);
   579 	setConfig('enano_version', installer_enano_version());
   585 	setConfig('enano_version', installer_enano_version());
   580 	return true;
   586 	setConfig('newly_upgraded', 1);
   581 }
   587 	return true;
       
   588 }