Project

General

Profile

« Previous | Next » 

Revision 2109

Added by darkviper almost 10 years ago

  1. admin/settings/ little typofix, save settings now use official method

View differences:

locking.php
26 26

  
27 27
if ($admin->get_user_id() == 1) {
28 28
	$val = (((int)(defined('SYSTEM_LOCKED') ? SYSTEM_LOCKED : 0)) + 1) % 2;
29
	$sql = 'SELECT COUNT(`setting_id`) FROM `'.$oDb->TablePrefix.'settings` '
30
         . 'WHERE `name` = \'system_locked\'';
31
    $bUpdate = (bool)$oDb->getOne($sql);
32
    $sql = $bUpdate ? 'UPDATE ' : 'INSERT ';
33
	$sql .= '`'.$oDb->TablePrefix.'settings` '
34
	      . 'SET `name` = \'system_locked\', '
35
	      .     '`value` = '.$val;
36
    $sql .= $bUpdate ? 'WHERE `name` = \'system_locked\'' : '';
37
	$oDb->doQuery($sql);
29
    db_update_key_value($oDb->TablePrefix.'settings', 'system_locked', $val);
38 30
}
39 31
// redirect to backend
40 32
header('Location: ' . ADMIN_URL . '/index.php');

Also available in: Unified diff