Файл: modules/acp/index.php
Строк: 190
<?php
if (!access('acp'))
{
redirect(HTTPHOME);
}
$config['categsnamelen'] = 50;
switch ($act) {
case 'index':
$config['newtitle'] = $lang['Admin_Control_Panel'];
$tpl['file'] = 'acp';
require_once 'core/header.php';
break;
case 'sitehelp':
$english = isset($_POST['english']) ? check($_POST['english']) : FALSE;
$russian = isset($_POST['russian']) ? check($_POST['russian']) : FALSE;
$ukrainian = isset($_POST['ukrainian']) ? check($_POST['ukrainian']) : FALSE;
$uzbek = isset($_POST['uzbek']) ? check($_POST['uzbek']) : FALSE;
if ($$config['language'])
{
DB::run()->query("update `sitehelp` set `value` = ? where `language` = ?;", array($english, 'english'));
DB::run()->query("update `sitehelp` set `value` = ? where `language` = ?;", array($russian, 'russian'));
DB::run()->query("update `sitehelp` set `value` = ? where `language` = ?;", array($ukrainian, 'ukrainian'));
DB::run()->query("update `sitehelp` set `value` = ? where `language` = ?;", array($uzbek, 'uzbek'));
unlink('cache/sitehelp.tmp');
$_SESSION['note'] = $lang['All_Changes_Saved'];
redirect('/acp/sitehelp');
}
$config['newtitle'] = $lang['Site_Help'];
$tpl['title'] = '<a href="/acp">'.$lang['ACP'].'</a> » '.$lang['Site_Help'];
$tpl['file'] = 'acp_sitehelp';
require_once 'core/header.php';
break;
case 'terms':
$english = isset($_POST['english']) ? check($_POST['english']) : FALSE;
$russian = isset($_POST['russian']) ? check($_POST['russian']) : FALSE;
$ukrainian = isset($_POST['ukrainian']) ? check($_POST['ukrainian']) : FALSE;
$uzbek = isset($_POST['uzbek']) ? check($_POST['uzbek']) : FALSE;
if ($$config['language'])
{
DB::run()->query("update `terms` set `value` = ? where `language` = ?;", array($english, 'english'));
DB::run()->query("update `terms` set `value` = ? where `language` = ?;", array($russian, 'russian'));
DB::run()->query("update `terms` set `value` = ? where `language` = ?;", array($ukrainian, 'ukrainian'));
DB::run()->query("update `terms` set `value` = ? where `language` = ?;", array($uzbek, 'uzbek'));
unlink('cache/terms.tmp');
$_SESSION['note'] = $lang['All_Changes_Saved'];
redirect('/acp/terms');
}
$config['newtitle'] = $lang['Terms_of_Use'];
$tpl['title'] = '<a href="/acp">'.$lang['ACP'].'</a> » '.$lang['Terms_of_Use'];
$tpl['file'] = 'acp_terms';
require_once 'core/header.php';
break;
case 'settings':
$query = DB::run()->query("SELECT `name`, `value` FROM `configuration`;");
$setting = $query->fetchAssoc();
if (isset($_POST))
{
$title = isset($_POST['title']) ? check($_POST['title']) : $setting['title'];
$description = isset($_POST['description']) ? check($_POST['description']) : $setting['description'];
$keywords = isset($_POST['keywords']) ? check($_POST['keywords']) : $setting['keywords'];
$timeshift = isset($_POST['timeshift']) ? check($_POST['timeshift']) : $setting['timeshift'];
$webtheme = isset($_POST['webtheme']) ? check($_POST['webtheme']) : $setting['webtheme'];
$mobtheme = isset($_POST['mobtheme']) ? check($_POST['mobtheme']) : $setting['mobtheme'];
$language = isset($_POST['language']) ? check($_POST['language']) : $setting['language'];
$ipp = isset($_POST['ipp']) ? check($_POST['ipp']) : $setting['ipp'];
$keypass = isset($_POST['keypass']) ? check($_POST['keypass']) : $setting['keypass'];
$allowed_ext = isset($_POST['allowed_ext']) ? check($_POST['allowed_ext']) : $setting['allowed_ext'];
$max_filesize = isset($_POST['max_filesize']) ? check($_POST['max_filesize']) : $setting['max_filesize'];
$editmin = isset($_POST['editmin']) ? check($_POST['editmin']) : $setting['editmin'];
$wait_time = isset($_POST['wait_time']) ? check($_POST['wait_time']) : $setting['wait_time'];
$online_updmin = isset($_POST['online_updmin']) ? check($_POST['online_updmin']) : $setting['online_updmin'];
$msglength = isset($_POST['editmin']) ? check($_POST['msglength']) : $setting['msglength'];
$bbpanel = isset($_POST['editmin']) ? check($_POST['bbpanel']) : $setting['bbpanel'];
$updSettings = array(
'title' => $title,
'description' => $keywords,
'keywords' => $keywords,
'timeshift' => $timeshift,
'webtheme' => $webtheme,
'mobtheme' => $mobtheme,
'language' => $language,
'ipp' => $ipp,
'keypass' => $keypass,
'allowed_ext' => $allowed_ext,
'max_filesize' => $max_filesize,
'editmin' => $editmin,
'wait_time' => $wait_time,
'online_updmin' => $online_updmin,
'msglength' => $msglength,
'bbpanel' => $bbpanel
);
foreach ($updSettings as $key => $value)
{
DB::run()->query("update `configuration` set `value` = ? where `name` = ?;", array($value, $key));
}
if (file_exists('cache/config.tmp')) unlink('cache/config.tmp');
$_SESSION['note'] = $lang['All_Changes_Saved'];
}
$config['newtitle'] = $lang['Site_Settings'];
$tpl['title'] = '<a href="/acp">'.$lang['ACP'].'</a> » '.$lang['Site_Settings'];
$tpl['file'] = 'acp_settings';
require_once 'core/header.php';
break;
}
require_once 'blogs.php';
require_once 'forum.php';
require_once 'downloads.php';
require_once 'users.php';