fix editing api-keys as customer
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
This commit is contained in:
@@ -23,10 +23,7 @@ if (! defined('_CRON_UPDATE')) {
|
||||
|
||||
if (isFroxlorVersion('0.9.39.5')) {
|
||||
showUpdateStep("Updating from 0.9.39.5 to 0.10.0", false);
|
||||
updateToVersion('0.10.0');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.10.0')) {
|
||||
|
||||
showUpdateStep("Adding new api keys table");
|
||||
Database::query("DROP TABLE IF EXISTS `api_keys`;");
|
||||
$sql = "CREATE TABLE `api_keys` (
|
||||
@@ -43,15 +40,15 @@ if (isFroxlorVersion('0.10.0')) {
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;";
|
||||
Database::query($sql);
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
showUpdateStep("Adding new api settings");
|
||||
Settings::AddNew('api.enabled', 0);
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
showUpdateStep("Adding new default-ssl-ip setting");
|
||||
Settings::AddNew('system.defaultsslip', '');
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
showUpdateStep("Altering admin ip's field to allow multiple ip addresses");
|
||||
// get all admins for updating the new field
|
||||
$sel_stmt = Database::prepare("SELECT adminid, ip FROM `panel_admins`");
|
||||
@@ -60,9 +57,14 @@ if (isFroxlorVersion('0.10.0')) {
|
||||
Database::query("ALTER TABLE `panel_admins` MODIFY `ip` varchar(500) NOT NULL default '-1';");
|
||||
$upd_stmt = Database::prepare("UPDATE `panel_admins` SET `ip` = :ip WHERE `adminid` = :adminid");
|
||||
foreach ($all_admins as $adm) {
|
||||
if ($admin['ip'] != '-1') {
|
||||
Database::pexecute($upd_stmt, array('ip' => json_encode($adm['ip']), 'adminid' => $adm['adminid']));
|
||||
if ($adm['ip'] != '-1') {
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'ip' => json_encode($adm['ip']),
|
||||
'adminid' => $adm['adminid']
|
||||
));
|
||||
}
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.10.0');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user