i18n/src/messenger/webim/operator/features.php

69 lines
1.9 KiB
PHP
Raw Normal View History

<?php
/*
2013-03-07 01:22:53 +04:00
* Copyright 2005-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once('../libs/init.php');
require_once('../libs/operator.php');
require_once('../libs/settings.php');
$operator = check_login();
csrfchecktoken();
$page = array('agentId' => '');
$errors = array();
$options = array(
2012-02-25 23:40:05 +04:00
'enableban', 'usercanchangename',
'enablegroups', 'enablegroupsisolation',
'enablestatistics', 'enabletracking',
2011-02-26 17:06:19 +03:00
'enablessl', 'forcessl',
'enablepresurvey', 'surveyaskmail', 'surveyaskgroup', 'surveyaskmessage',
'enablepopupnotification', 'showonlineoperators',
'enablecaptcha');
if (Settings::get('featuresversion') != $featuresversion) {
Settings::set('featuresversion',$featuresversion);
Settings::update();
2011-02-26 15:15:35 +03:00
}
$params = array();
2011-02-26 17:06:19 +03:00
foreach ($options as $opt) {
$params[$opt] = Settings::get($opt);
}
if (isset($_POST['sent'])) {
2011-02-20 04:44:37 +03:00
if (is_capable($can_administrate, $operator)) {
2011-02-26 17:06:19 +03:00
foreach ($options as $opt) {
Settings::set($opt,(verifyparam($opt, "/^on$/", "") == "on" ? "1" : "0"));
2011-02-20 04:44:37 +03:00
}
Settings::update();
2011-02-26 17:06:19 +03:00
header("Location: $webimroot/operator/features.php?stored");
exit;
2011-02-20 04:44:37 +03:00
} else {
$errors[] = "Not an administrator";
}
}
$page['canmodify'] = is_capable($can_administrate, $operator);
$page['stored'] = isset($_GET['stored']);
2011-02-26 17:06:19 +03:00
foreach ($options as $opt) {
$page["form$opt"] = $params[$opt] == "1";
}
prepare_menu($operator);
setup_settings_tabs(1);
start_html_output();
require('../view/features.php');
2013-03-13 01:03:50 +04:00
?>