1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category admin
|
5
|
* @package login
|
6
|
* @author Ryan Djurovich, WebsiteBaker Project
|
7
|
* @copyright WebsiteBaker Org. e.V.
|
8
|
* @link http://websitebaker.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.8.4
|
11
|
* @requirements PHP 5.4 and higher
|
12
|
* @version $Id: locking.php 2 2017-07-02 15:14:29Z Manuela $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb/2.10.x/branches/main/admin/settings/locking.php $
|
14
|
* @lastmodified $Date: 2017-07-02 17:14:29 +0200 (Sun, 02 Jul 2017) $
|
15
|
*
|
16
|
*/
|
17
|
if (!defined('WB_PATH')) {
|
18
|
$sStartupFile = dirname(dirname(__DIR__)).'/config.php';
|
19
|
if (is_readable($sStartupFile)) {
|
20
|
require($sStartupFile);
|
21
|
} else {
|
22
|
throw new Exception(
|
23
|
'tried to read a nonexisting or not readable startup file ['
|
24
|
. basename(dirname($sStartupFile)).'/'.basename($sStartupFile).']!!'
|
25
|
);
|
26
|
}
|
27
|
}
|
28
|
$oDb = $GLOBALS['database'];
|
29
|
$oTrans = Translate::getInstance();
|
30
|
$oTrans->enableAddon(ADMIN_DIRECTORY.'\\settings');
|
31
|
|
32
|
if (!class_exists('admin', false)) {require (WB_PATH.'/framework/class.admin.php');}
|
33
|
$admin = new admin('Start', 'settings', false, false);
|
34
|
|
35
|
if ($admin->get_user_id() == 1) {
|
36
|
$val = (((int)(defined('SYSTEM_LOCKED') ? SYSTEM_LOCKED : 0)) + 1) % 2;
|
37
|
db_update_key_value('settings', 'system_locked', $val);
|
38
|
}
|
39
|
// redirect to backend
|
40
|
header('Location: ' . ADMIN_URL . '/index.php');
|
41
|
exit();
|