1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category admin
|
5
|
* @package login
|
6
|
* @author Ryan Djurovich (2004-2009)), WebsiteBaker Project
|
7
|
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
8
|
* @link http://www.websitebaker2.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.9
|
11
|
* @requirements PHP 5.2.2 and higher
|
12
|
* @version $Id: locking.php 2098 2014-02-11 01:37:03Z darkviper $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/settings/locking.php $
|
14
|
* @lastmodified $Date: 2014-02-11 02:37:03 +0100 (Tue, 11 Feb 2014) $
|
15
|
*
|
16
|
*/
|
17
|
if(!defined('WB_PATH'))
|
18
|
{
|
19
|
require('../../config.php');
|
20
|
}
|
21
|
$oDb = WbDatabase::getInstance();
|
22
|
$oTrans = Translate::getInstance();
|
23
|
$oTrans->enableAddon('admin\\settings');
|
24
|
|
25
|
$admin = new admin('Start', 'settings', false, false);
|
26
|
|
27
|
if ($admin->get_user_id() == 1) {
|
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);
|
38
|
}
|
39
|
// redirect to backend
|
40
|
header('Location: ' . ADMIN_URL . '/index.php');
|
41
|
exit();
|