Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 6 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
View
5 include/staff/syslogs.inc.php
@@ -45,9 +45,10 @@
$qstr.='&endDate='.urlencode($_REQUEST['endDate']);
}
}
-$sortOptions=array('title'=>'log.title','type'=>'log_type','ip'=>'log.ip_address','date'=>'log.created','created'=>'log.created','updated'=>'log.updated');
+$sortOptions=array('id'=>'log.log_id', 'title'=>'log.title','type'=>'log_type','ip'=>'log.ip_address'
+ ,'date'=>'log.created','created'=>'log.created','updated'=>'log.updated');
$orderWays=array('DESC'=>'DESC','ASC'=>'ASC');
-$sort=($_REQUEST['sort'] && $sortOptions[strtolower($_REQUEST['sort'])])?strtolower($_REQUEST['sort']):'date';
+$sort=($_REQUEST['sort'] && $sortOptions[strtolower($_REQUEST['sort'])])?strtolower($_REQUEST['sort']):'id';
//Sorting options...
if($sort && $sortOptions[$sort]) {
$order_column =$sortOptions[$sort];
View
2 main.inc.php
@@ -55,7 +55,7 @@
#Current version && schema signature (Changes from version to version)
define('THIS_VERSION','1.7-DPR2'); //Shown on admin panel
- define('SCHEMA_SIGNATURE','bbb021fbeb377ca66b6997b77e0167cc'); //MD5 signature of the db schema. (used to trigger upgrades)
+ define('SCHEMA_SIGNATURE','49478749dc680eef08b7954bd568cfd1'); //MD5 signature of the db schema. (used to trigger upgrades)
#load config info
$configfile='';
View
4 setup/inc/class.installer.php
@@ -105,6 +105,8 @@ function install($vars) {
//Last minute checks.
if(!file_exists($schemaFile))
$this->errors['err']='Internal Error - please make sure your download is the latest (#1)';
+ elseif(!($signature=trim(file_get_contents("$schemaFile.md5"))) || strcasecmp($signature, md5_file($schemaFile)))
+ $this->errors['err']='Unknown or invalid schema signature ('.$signature.' .. '.md5_file($schemaFile).')';
elseif(!file_exists($this->getConfigFile()) || !($configFile=file_get_contents($this->getConfigFile())))
$this->errors['err']='Unable to read config file. Permission denied! (#2)';
elseif(!($fp = @fopen($this->getConfigFile(),'r+')))
@@ -132,7 +134,7 @@ function install($vars) {
.', default_email_id=1, alert_email_id=2, default_dept_id=1 '
.', default_sla_id=1, default_timezone_id=8, default_template_id=1 '
.', admin_email='.db_input($vars['admin_email'])
- .', schema_signature='.db_input(md5_file($schemaFile))
+ .', schema_signature='.db_input($signature)
.', helpdesk_url='.db_input(URL)
.', helpdesk_title='.db_input($vars['name']);
if(!mysql_query($sql) || !($cid=mysql_insert_id()))
View
25 setup/inc/class.setup.php
@@ -34,7 +34,7 @@ function SetupWizard(){
function load_sql_file($file, $prefix, $abort=true, $debug=false) {
if(!file_exists($file) || !($schema=file_get_contents($file)))
- return $this->abort('Error accessing SQL file '.basename($file));
+ return $this->abort('Error accessing SQL file '.basename($file), $debug);
return $this->load_sql($schema, $prefix, $abort, $debug);
}
@@ -45,21 +45,20 @@ function load_sql_file($file, $prefix, $abort=true, $debug=false) {
function load_sql($schema, $prefix, $abort=true, $debug=false) {
# Strip comments and remarks
- $schema=preg_replace('%^\s*(#|--).*$%m','',$schema);
+ $schema=preg_replace('%^\s*(#|--).*$%m', '', $schema);
# Replace table prefis
- $schema = str_replace('%TABLE_PREFIX%',$prefix, $schema);
+ $schema = str_replace('%TABLE_PREFIX%', $prefix, $schema);
# Split by semicolons - and cleanup
if(!($statements = array_filter(array_map('trim', @explode(';', $schema)))))
- return $this->abort('Error parsing SQL schema');
+ return $this->abort('Error parsing SQL schema', $debug);
@mysql_query('SET SESSION SQL_MODE =""');
foreach($statements as $k=>$sql) {
- if(!mysql_query($sql)) {
- if($debug) echo "[$sql]=>".mysql_error();
- if($abort)
- return $this->abort("[$sql] - ".mysql_error());
- }
+ if(mysql_query($sql)) continue;
+ $error = "[$sql] ".mysql_error();
+ if($abort)
+ return $this->abort($error, $debug);
}
return true;
@@ -82,7 +81,7 @@ function getMySQLVersion() {
}
function check_php() {
- return (version_compare(PHP_VERSION,$this->getPHPVersion())>=0);
+ return (version_compare(PHP_VERSION, $this->getPHPVersion())>=0);
}
function check_mysql() {
@@ -96,8 +95,9 @@ function check_prereq() {
/*
@error is a mixed var.
*/
- function abort($error) {
+ function abort($error, $debug=false) {
+ if($debug) echo $error;
$this->onError($error);
return false; // Always false... It's an abort.
@@ -106,13 +106,12 @@ function abort($error) {
function setError($error) {
if($error && is_array($error))
- $this->errors = array_merge($this->errors,$error);
+ $this->errors = array_merge($this->errors, $error);
elseif($error)
$this->errors[] = $error;
}
function getErrors(){
-
return $this->errors;
}
View
17 setup/inc/class.upgrader.php
@@ -50,6 +50,8 @@ function getStops() {
}
function onError($error) {
+
+ Sys::log(LOG_ERR, 'Upgrader Error', $error);
$this->setError($error);
$this->setState('aborted');
}
@@ -197,18 +199,23 @@ function upgrade() {
if (!$this->load_sql_file($patch, $this->getTablePrefix()))
return false;
- //TODO: Log the upgrade
-
-
//clear previous patch info -
unset($_SESSION['ost_upgrader'][$this->getShash()]);
- //Load up post-upgrade tasks.... if any.
$phash = substr(basename($patch), 0, 17);
+
+ //Log the patch info
+ $logMsg = "Patch $phash applied ";
+ if(($info = $this->readPatchInfo($patch)) && $info['version'])
+ $logMsg.= ' ('.$info['version'].') ';
+
+ Sys::log(LOG_DEBUG, 'Upgrader - Patch applied', $logMsg);
+
+ //Check if the said patch has scripted tasks
if(!($tasks=$this->getTasksForPatch($phash)))
continue;
- //We have tasks to perform - set the tasks and break.
+ //We have work to do... set the tasks and break.
$shash = substr($phash, 9, 8);
$_SESSION['ost_upgrader'][$shash]['tasks'] = $tasks;
$_SESSION['ost_upgrader'][$shash]['state'] = 'upgrade';
View
9 setup/inc/sql/bbb021fb-49478749.patch.sql
@@ -0,0 +1,9 @@
+/**
+ * Transitional patch - FIX on the INSTALLER schema
+ *
+ * @version 1.7-dpr3 installerfix
+ */
+
+-- Finished with patch
+UPDATE `%TABLE_PREFIX%config`
+ SET `schema_signature`='49478749dc680eef08b7954bd568cfd1';
View
2 setup/inc/sql/osticket-v1.7-mysql.sql
@@ -615,7 +615,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket_event` (
`topic_id` int(11) unsigned NOT NULL,
`state` enum('created','closed','reopened','assigned','transferred','overdue') NOT NULL,
`staff` varchar(255) NOT NULL default 'SYSTEM',
- `annulled` tinyint(1) unsigned NOT NULL defalt '0',
+ `annulled` tinyint(1) unsigned NOT NULL default '0',
`timestamp` datetime NOT NULL,
KEY `ticket_state` (`ticket_id`, `state`, `timestamp`),
KEY `ticket_stats` (`timestamp`, `state`)
View
2 setup/inc/sql/osticket-v1.7-mysql.sql.md5
@@ -1 +1 @@
-bbb021fbeb377ca66b6997b77e0167cc
+49478749dc680eef08b7954bd568cfd1

No commit comments for this range

Something went wrong with that request. Please try again.