removed ticketsystem; lots of work on cron stuff

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-19 13:09:14 +01:00
parent 903b775f79
commit 3ff20e327f
86 changed files with 3823 additions and 7421 deletions

View File

@@ -1,6 +1,8 @@
<?php
namespace Froxlor;
use Froxlor\Database\Database;
final class Froxlor
{
@@ -8,7 +10,7 @@ final class Froxlor
const VERSION = '0.10.0';
// Database version (YYYYMMDDC where C is a daily counter)
const DBVERSION = '201812170';
const DBVERSION = '201812190';
// Distribution branding-tag (used for Debian etc.)
const BRANDING = '';
@@ -95,4 +97,108 @@ final class Froxlor
}
return false;
}
/**
* Function isDatabaseVersion
*
* checks if a given database-version is the current one
*
* @param int $to_check
* version to check
*
* @return bool true if version to check matches, else false
*/
public static function isDatabaseVersion($to_check = null)
{
if (Settings::Get('panel.frontend') == 'froxlor' && Settings::Get('panel.db_version') == $to_check) {
return true;
}
return false;
}
/**
* Function updateToDbVersion
*
* updates the panel.version field
* to the given value (no checks here!)
*
* @param string $new_version
* new-version
*
* @return bool true on success, else false
*/
public static function updateToDbVersion($new_version = null)
{
if ($new_version !== null && $new_version != '') {
$upd_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = :newversion
WHERE `settinggroup` = 'panel' AND `varname` = 'db_version'");
Database::pexecute($upd_stmt, array(
'newversion' => $new_version
));
Settings::Set('panel.db_version', $new_version);
return true;
}
return false;
}
/**
* Function updateToVersion
*
* updates the panel.version field
* to the given value (no checks here!)
*
* @param string $new_version
* new-version
*
* @return bool true on success, else false
*/
public static function updateToVersion($new_version = null)
{
if ($new_version !== null && $new_version != '') {
$upd_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = :newversion
WHERE `settinggroup` = 'panel' AND `varname` = 'version'");
Database::pexecute($upd_stmt, array(
'newversion' => $new_version
));
Settings::Set('panel.version', $new_version);
return true;
}
return false;
}
/**
* Function isFroxlor
*
* checks if the panel is froxlor
*
* @return bool true if panel is froxlor, else false
*/
public static function isFroxlor()
{
if (Settings::Get('panel.frontend') !== null && Settings::Get('panel.frontend') == 'froxlor') {
return true;
}
return false;
}
/**
* Function isFroxlorVersion
*
* checks if a given version is the
* current one (and panel is froxlor)
*
* @param string $to_check
* version to check
*
* @return bool true if version to check matches, else false
*/
public static function isFroxlorVersion($to_check = null)
{
if (Settings::Get('panel.frontend') == 'froxlor' && Settings::Get('panel.version') == $to_check) {
return true;
}
return false;
}
}