diff --git a/daemon/lmsd.c b/daemon/lmsd.c index 88af78d5d2..28cd8e1988 100644 --- a/daemon/lmsd.c +++ b/daemon/lmsd.c @@ -113,8 +113,8 @@ int main(int argc, char *argv[], char **envp) str_replace(&driver, "postgres", "pgsql"); // postgres in ini file is pgsql str_replace(&driver, "mysqli", "mysql"); // mysqli in ini file is mysql - char dbdrv_path[strlen(LMS_LIB_DIR) + strlen(driver) + 4]; - sprintf(dbdrv_path, LMS_LIB_DIR "/%s.so", driver); + char dbdrv_path[strlen(LMS_LIB_DIR) + strlen(driver) + 5]; + snprintf(dbdrv_path, sizeof(dbdrv_path), "%s/%s.so", LMS_LIB_DIR, driver); if( !file_exists(dbdrv_path)) { diff --git a/lib/upgradedb/mysql.2022092200.php b/lib/upgradedb/mysql.2022092200.php index 1de5ad8d80..375dbde721 100644 --- a/lib/upgradedb/mysql.2022092200.php +++ b/lib/upgradedb/mysql.2022092200.php @@ -21,19 +21,10 @@ * */ -define('CONTACT_NOTIFICATIONS_2022092201', 32); -define('CONTACT_HELPDESK_NOTIFICATIONS_2022092201', 131072); - $this->BeginTrans(); -$this->Execute( - "UPDATE customercontacts SET type = type | ? WHERE (type & ?) > 0", - array( - CONTACT_HELPDESK_NOTIFICATIONS_2022092201, - CONTACT_NOTIFICATIONS_2022092201, - ) -); +$this->Execute("ALTER TABLE assignments ADD COLUMN paytime smallint DEFAULT NULL"); -$this->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2022092201', 'dbversion')); +$this->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2022092200', 'dbversion')); $this->CommitTrans(); diff --git a/modules/dbrecover.php b/modules/dbrecover.php index 2f68dc67f0..c6f24814be 100644 --- a/modules/dbrecover.php +++ b/modules/dbrecover.php @@ -121,7 +121,8 @@ function DBLoad($filename = null) $layout['pagetitle'] = trans('Database Backup Recovery'); $SMARTY->display('header.html'); echo '

'.trans('Database Backup Recovery').'

'; - echo '

'.trans('Are you sure, you want to recover database created at $a?', date('Y/m/d H:i.s', $_GET['db'])).'

'; + $timestamp = explode('-', $_GET['db'])[0]; + echo '

'.trans('Are you sure, you want to recover database created at $a?', date('Y/m/d H:i.s', $timestamp)).'

'; echo ''.trans('Yes, I am sure.').''; $SMARTY->display('footer.html'); } diff --git a/templates/default/dblist.html b/templates/default/dblist.html index 52ae9eb8c3..5c0930ec2a 100644 --- a/templates/default/dblist.html +++ b/templates/default/dblist.html @@ -92,7 +92,7 @@

{$layout.pagetitle}

}); $('.recover-backup').click(function() { confirmDialog($t("Are you sure, you want to restore this database backup?\n\nWARNING!\n\nIt will backup current database content automatically"), this).done(function() { - location.href = $(this).attr('href'); + location.href = $(this).attr('href') + '&is_sure=1'; }); return false; });