mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-01 05:44:41 +03:00
Include $errors global variable into $page
This commit is contained in:
parent
6da2a33ce3
commit
7b83f8ca6f
@ -288,15 +288,15 @@ $dbtables_can_update = array(
|
|||||||
|
|
||||||
function show_install_err($text)
|
function show_install_err($text)
|
||||||
{
|
{
|
||||||
global $page, $errors;
|
global $page;
|
||||||
$page = array(
|
$page = array(
|
||||||
'version' => MIBEW_VERSION,
|
'version' => MIBEW_VERSION,
|
||||||
'localeLinks' => get_locale_links(MIBEW_WEB_ROOT . "/install/index.php"),
|
'localeLinks' => get_locale_links(MIBEW_WEB_ROOT . "/install/index.php"),
|
||||||
'title' => getlocal("install.err.title"),
|
'title' => getlocal("install.err.title"),
|
||||||
'no_right_menu' => true,
|
'no_right_menu' => true,
|
||||||
'fixedwrap' => true,
|
'fixedwrap' => true,
|
||||||
|
'errors' => array($text),
|
||||||
);
|
);
|
||||||
$errors = array($text);
|
|
||||||
$page_style = new \Mibew\Style\PageStyle('default');
|
$page_style = new \Mibew\Style\PageStyle('default');
|
||||||
$page_style->render('install_err');
|
$page_style->render('install_err');
|
||||||
exit;
|
exit;
|
||||||
|
@ -388,6 +388,7 @@ check_status();
|
|||||||
|
|
||||||
$page['title'] = getlocal("install.title");
|
$page['title'] = getlocal("install.title");
|
||||||
$page['fixedwrap'] = true;
|
$page['fixedwrap'] = true;
|
||||||
|
$page['errors'] = $errors;
|
||||||
|
|
||||||
$page_style = new \Mibew\Style\PageStyle('default');
|
$page_style = new \Mibew\Style\PageStyle('default');
|
||||||
$page_style->render('install_index');
|
$page_style->render('install_index');
|
||||||
|
@ -45,7 +45,7 @@ class PageStyle extends Style implements StyleInterface {
|
|||||||
public function render($template_name, $data = array()) {
|
public function render($template_name, $data = array()) {
|
||||||
// We need to import some variables to make them visible to required
|
// We need to import some variables to make them visible to required
|
||||||
// view.
|
// view.
|
||||||
global $page, $errors;
|
global $page;
|
||||||
|
|
||||||
// Add template root value to page variables
|
// Add template root value to page variables
|
||||||
$page['stylepath'] = MIBEW_WEB_ROOT . '/' . $this->filesPath();
|
$page['stylepath'] = MIBEW_WEB_ROOT . '/' . $this->filesPath();
|
||||||
|
@ -26,8 +26,9 @@ require_once(MIBEW_FS_ROOT.'/libs/chat.php');
|
|||||||
require_once(MIBEW_FS_ROOT.'/libs/groups.php');
|
require_once(MIBEW_FS_ROOT.'/libs/groups.php');
|
||||||
require_once(MIBEW_FS_ROOT.'/libs/notify.php');
|
require_once(MIBEW_FS_ROOT.'/libs/notify.php');
|
||||||
|
|
||||||
$errors = array();
|
$page = array(
|
||||||
$page = array();
|
'errors' =>array()
|
||||||
|
);
|
||||||
|
|
||||||
$token = verifyparam( "token", "/^\d{1,8}$/");
|
$token = verifyparam( "token", "/^\d{1,8}$/");
|
||||||
$threadid = verifyparam( "thread", "/^\d{1,8}$/");
|
$threadid = verifyparam( "thread", "/^\d{1,8}$/");
|
||||||
@ -44,12 +45,12 @@ $email = getparam('email');
|
|||||||
$page['email'] = $email;
|
$page['email'] = $email;
|
||||||
$group = is_null($thread->groupId)?NULL:group_by_id($thread->groupId);
|
$group = is_null($thread->groupId)?NULL:group_by_id($thread->groupId);
|
||||||
if( !$email ) {
|
if( !$email ) {
|
||||||
$errors[] = no_field("form.field.email");
|
$page['errors'][] = no_field("form.field.email");
|
||||||
} else if( !is_valid_email($email)) {
|
} else if( !is_valid_email($email)) {
|
||||||
$errors[] = wrong_field("form.field.email");
|
$page['errors'][] = wrong_field("form.field.email");
|
||||||
}
|
}
|
||||||
|
|
||||||
if( count($errors) > 0 ) {
|
if( count($page['errors']) > 0 ) {
|
||||||
$page['formemail'] = $email;
|
$page['formemail'] = $email;
|
||||||
$page['chat.thread.id'] = $thread->id;
|
$page['chat.thread.id'] = $thread->id;
|
||||||
$page['chat.thread.token'] = $thread->lastToken;
|
$page['chat.thread.token'] = $thread->lastToken;
|
||||||
@ -58,7 +59,6 @@ if( count($errors) > 0 ) {
|
|||||||
$page,
|
$page,
|
||||||
setup_logo($group)
|
setup_logo($group)
|
||||||
);
|
);
|
||||||
$page['errors'] = $errors;
|
|
||||||
$chat_style->render('mail', $page);
|
$chat_style->render('mail', $page);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ $page = array_merge_recursive(
|
|||||||
$page,
|
$page,
|
||||||
setup_logo($group)
|
setup_logo($group)
|
||||||
);
|
);
|
||||||
$page['errors'] = $errors;
|
|
||||||
$chat_style->render('mailsent', $page);
|
$chat_style->render('mailsent', $page);
|
||||||
exit;
|
exit;
|
||||||
?>
|
?>
|
@ -44,7 +44,9 @@ if (Settings::get('enablessl') == "1" && Settings::get('forcessl') == "1") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$threadid = verifyparam("thread", "/^\d{1,8}$/");
|
$threadid = verifyparam("thread", "/^\d{1,8}$/");
|
||||||
$page = array();
|
$page = array(
|
||||||
|
'errors' => array()
|
||||||
|
);
|
||||||
|
|
||||||
// Initialize chat style which is currently used in system
|
// Initialize chat style which is currently used in system
|
||||||
$chat_style = new ChatStyle(ChatStyle::currentStyle());
|
$chat_style = new ChatStyle(ChatStyle::currentStyle());
|
||||||
@ -55,16 +57,14 @@ if (!isset($_GET['token'])) {
|
|||||||
|
|
||||||
$remote_level = get_remote_level($_SERVER['HTTP_USER_AGENT']);
|
$remote_level = get_remote_level($_SERVER['HTTP_USER_AGENT']);
|
||||||
if ($remote_level != "ajaxed") {
|
if ($remote_level != "ajaxed") {
|
||||||
$errors = array(getlocal("thread.error.old_browser"));
|
$page['errors'][] = getlocal("thread.error.old_browser");
|
||||||
$page['errors'] = $errors;
|
|
||||||
$chat_style->render('error', $page);
|
$chat_style->render('error', $page);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$thread = Thread::load($threadid);
|
$thread = Thread::load($threadid);
|
||||||
if (!$thread || !isset($thread->lastToken)) {
|
if (!$thread || !isset($thread->lastToken)) {
|
||||||
$errors = array(getlocal("thread.error.wrong_thread"));
|
$page['errors'][] = getlocal("thread.error.wrong_thread");
|
||||||
$page['errors'] = $errors;
|
|
||||||
$chat_style->render('error', $page);
|
$chat_style->render('error', $page);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -75,8 +75,7 @@ if (!isset($_GET['token'])) {
|
|||||||
if (!$viewonly && $thread->state == Thread::STATE_CHATTING && $operator['operatorid'] != $thread->agentId) {
|
if (!$viewonly && $thread->state == Thread::STATE_CHATTING && $operator['operatorid'] != $thread->agentId) {
|
||||||
|
|
||||||
if (!is_capable(CAN_TAKEOVER, $operator)) {
|
if (!is_capable(CAN_TAKEOVER, $operator)) {
|
||||||
$errors = array(getlocal("thread.error.cannot_take_over"));
|
$page['errors'][] = getlocal("thread.error.cannot_take_over");
|
||||||
$page['errors'] = $errors;
|
|
||||||
$chat_style->render('error', $page);
|
$chat_style->render('error', $page);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -95,14 +94,12 @@ if (!isset($_GET['token'])) {
|
|||||||
|
|
||||||
if (!$viewonly) {
|
if (!$viewonly) {
|
||||||
if(! $thread->take($operator)){
|
if(! $thread->take($operator)){
|
||||||
$errors = array(getlocal("thread.error.cannot_take"));
|
$page['errors'][] = getlocal("thread.error.cannot_take");
|
||||||
$page['errors'] = $errors;
|
|
||||||
$chat_style->render('error', $page);
|
$chat_style->render('error', $page);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} else if (!is_capable(CAN_VIEWTHREADS, $operator)) {
|
} else if (!is_capable(CAN_VIEWTHREADS, $operator)) {
|
||||||
$errors = array(getlocal("thread.error.cannot_view"));
|
$page['errors'][] = getlocal("thread.error.cannot_view");
|
||||||
$page['errors'] = $errors;
|
|
||||||
$chat_style->render('error', $page);
|
$chat_style->render('error', $page);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -120,8 +117,7 @@ if (!$thread) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($thread->agentId != $operator['operatorid'] && !is_capable(CAN_VIEWTHREADS, $operator)) {
|
if ($thread->agentId != $operator['operatorid'] && !is_capable(CAN_VIEWTHREADS, $operator)) {
|
||||||
$errors = array("Cannot view threads");
|
$page['errors'][] = "Cannot view threads";
|
||||||
$page['errors'] = $errors;
|
|
||||||
$chat_style->render('error', $page);
|
$chat_style->render('error', $page);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,11 @@ $operator = check_login();
|
|||||||
csrfchecktoken();
|
csrfchecktoken();
|
||||||
|
|
||||||
$opId = verifyparam("op", "/^\d{1,9}$/");
|
$opId = verifyparam("op", "/^\d{1,9}$/");
|
||||||
$page = array('opid' => $opId, 'avatar' => '');
|
$page = array(
|
||||||
$errors = array();
|
'opid' => $opId,
|
||||||
|
'avatar' => '',
|
||||||
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
$canmodify = ($opId == $operator['operatorid'] && is_capable(CAN_MODIFYPROFILE, $operator))
|
$canmodify = ($opId == $operator['operatorid'] && is_capable(CAN_MODIFYPROFILE, $operator))
|
||||||
|| is_capable(CAN_ADMINISTRATE, $operator);
|
|| is_capable(CAN_ADMINISTRATE, $operator);
|
||||||
@ -37,13 +40,13 @@ $canmodify = ($opId == $operator['operatorid'] && is_capable(CAN_MODIFYPROFILE,
|
|||||||
$op = operator_by_id($opId);
|
$op = operator_by_id($opId);
|
||||||
|
|
||||||
if (!$op) {
|
if (!$op) {
|
||||||
$errors[] = getlocal("no_such_operator");
|
$page['errors'][] = getlocal("no_such_operator");
|
||||||
|
|
||||||
} else if (isset($_POST['op'])) {
|
} else if (isset($_POST['op'])) {
|
||||||
$avatar = $op['vcavatar'];
|
$avatar = $op['vcavatar'];
|
||||||
|
|
||||||
if (!$canmodify) {
|
if (!$canmodify) {
|
||||||
$errors[] = getlocal('page_agent.cannot_modify');
|
$page['errors'][] = getlocal('page_agent.cannot_modify');
|
||||||
|
|
||||||
} else if (isset($_FILES['avatarFile']) && $_FILES['avatarFile']['name']) {
|
} else if (isset($_FILES['avatarFile']) && $_FILES['avatarFile']['name']) {
|
||||||
$valid_types = array("gif", "jpg", "png", "tif", "jpeg");
|
$valid_types = array("gif", "jpg", "png", "tif", "jpeg");
|
||||||
@ -56,9 +59,9 @@ if (!$op) {
|
|||||||
|
|
||||||
$file_size = $_FILES['avatarFile']['size'];
|
$file_size = $_FILES['avatarFile']['size'];
|
||||||
if ($file_size == 0 || $file_size > Settings::get('max_uploaded_file_size')) {
|
if ($file_size == 0 || $file_size > Settings::get('max_uploaded_file_size')) {
|
||||||
$errors[] = failed_uploading_file($orig_filename, "errors.file.size.exceeded");
|
$page['errors'][] = failed_uploading_file($orig_filename, "errors.file.size.exceeded");
|
||||||
} elseif (!in_array($ext, $valid_types)) {
|
} elseif (!in_array($ext, $valid_types)) {
|
||||||
$errors[] = failed_uploading_file($orig_filename, "errors.invalid.file.type");
|
$page['errors'][] = failed_uploading_file($orig_filename, "errors.invalid.file.type");
|
||||||
} else {
|
} else {
|
||||||
$avatar_local_dir = MIBEW_FS_ROOT.'/files/avatar/';
|
$avatar_local_dir = MIBEW_FS_ROOT.'/files/avatar/';
|
||||||
$full_file_path = $avatar_local_dir . $new_file_name;
|
$full_file_path = $avatar_local_dir . $new_file_name;
|
||||||
@ -66,16 +69,16 @@ if (!$op) {
|
|||||||
unlink($full_file_path);
|
unlink($full_file_path);
|
||||||
}
|
}
|
||||||
if (!@move_uploaded_file($_FILES['avatarFile']['tmp_name'], $full_file_path)) {
|
if (!@move_uploaded_file($_FILES['avatarFile']['tmp_name'], $full_file_path)) {
|
||||||
$errors[] = failed_uploading_file($orig_filename, "errors.file.move.error");
|
$page['errors'][] = failed_uploading_file($orig_filename, "errors.file.move.error");
|
||||||
} else {
|
} else {
|
||||||
$avatar = MIBEW_WEB_ROOT . "/files/avatar/$new_file_name";
|
$avatar = MIBEW_WEB_ROOT . "/files/avatar/$new_file_name";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$errors[] = "No file selected";
|
$page['errors'][] = "No file selected";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
update_operator_avatar($op['operatorid'], $avatar);
|
update_operator_avatar($op['operatorid'], $avatar);
|
||||||
|
|
||||||
if ($opId && $avatar && $_SESSION[SESSION_PREFIX."operator"] && $operator['operatorid'] == $opId) {
|
if ($opId && $avatar && $_SESSION[SESSION_PREFIX."operator"] && $operator['operatorid'] == $opId) {
|
||||||
|
@ -32,7 +32,7 @@ $page = array('banId' => '');
|
|||||||
$page['saved'] = false;
|
$page['saved'] = false;
|
||||||
$page['thread'] = '';
|
$page['thread'] = '';
|
||||||
$page['threadid'] = '';
|
$page['threadid'] = '';
|
||||||
$errors = array();
|
$page['errors'] = array();
|
||||||
|
|
||||||
if (isset($_POST['address'])) {
|
if (isset($_POST['address'])) {
|
||||||
$banId = verifyparam("banId", "/^(\d{1,9})?$/", "");
|
$banId = verifyparam("banId", "/^(\d{1,9})?$/", "");
|
||||||
@ -42,25 +42,25 @@ if (isset($_POST['address'])) {
|
|||||||
$threadid = isset($_POST['threadid']) ? getparam('threadid') : "";
|
$threadid = isset($_POST['threadid']) ? getparam('threadid') : "";
|
||||||
|
|
||||||
if (!$address) {
|
if (!$address) {
|
||||||
$errors[] = no_field("form.field.address");
|
$page['errors'][] = no_field("form.field.address");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match("/^\d+$/", $days)) {
|
if (!preg_match("/^\d+$/", $days)) {
|
||||||
$errors[] = wrong_field("form.field.ban_days");
|
$page['errors'][] = wrong_field("form.field.ban_days");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$comment) {
|
if (!$comment) {
|
||||||
$errors[] = no_field("form.field.ban_comment");
|
$page['errors'][] = no_field("form.field.ban_comment");
|
||||||
}
|
}
|
||||||
|
|
||||||
$existing_ban = ban_for_addr($address);
|
$existing_ban = ban_for_addr($address);
|
||||||
|
|
||||||
if ((!$banId && $existing_ban) ||
|
if ((!$banId && $existing_ban) ||
|
||||||
($banId && $existing_ban && $banId != $existing_ban['banid'])) {
|
($banId && $existing_ban && $banId != $existing_ban['banid'])) {
|
||||||
$errors[] = getlocal2("ban.error.duplicate", array($address, $existing_ban['banid']));
|
$page['errors'][] = getlocal2("ban.error.duplicate", array($address, $existing_ban['banid']));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
$db = Database::getInstance();
|
$db = Database::getInstance();
|
||||||
$now = time();
|
$now = time();
|
||||||
$till_time = $now + $days * 24 * 60 * 60;
|
$till_time = $now + $days * 24 * 60 * 60;
|
||||||
@ -117,7 +117,7 @@ if (isset($_POST['address'])) {
|
|||||||
$page['formdays'] = topage(round($ban['days'] / 86400));
|
$page['formdays'] = topage(round($ban['days'] / 86400));
|
||||||
$page['formcomment'] = topage($ban['comment']);
|
$page['formcomment'] = topage($ban['comment']);
|
||||||
} else {
|
} else {
|
||||||
$errors[] = "Wrong id";
|
$page['errors'][] = "Wrong id";
|
||||||
}
|
}
|
||||||
} else if (isset($_GET['thread'])) {
|
} else if (isset($_GET['thread'])) {
|
||||||
$threadid = verifyparam('thread', "/^\d{1,9}$/");
|
$threadid = verifyparam('thread', "/^\d{1,9}$/");
|
||||||
|
@ -28,8 +28,9 @@ require_once(MIBEW_FS_ROOT.'/libs/pagination.php');
|
|||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
csrfchecktoken();
|
csrfchecktoken();
|
||||||
|
|
||||||
$page = array();
|
$page = array(
|
||||||
$errors = array();
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
setlocale(LC_TIME, getstring("time.locale"));
|
setlocale(LC_TIME, getstring("time.locale"));
|
||||||
|
|
||||||
@ -39,10 +40,10 @@ if (isset($_GET['act']) && $_GET['act'] == 'del') {
|
|||||||
$banId = isset($_GET['id']) ? $_GET['id'] : "";
|
$banId = isset($_GET['id']) ? $_GET['id'] : "";
|
||||||
|
|
||||||
if (!preg_match("/^\d+$/", $banId)) {
|
if (!preg_match("/^\d+$/", $banId)) {
|
||||||
$errors[] = "Cannot delete: wrong argument";
|
$page['errors'][] = "Cannot delete: wrong argument";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
$db->query("delete from {chatban} where banid = ?", array($banId));
|
$db->query("delete from {chatban} where banid = ?", array($banId));
|
||||||
header("Location: " . MIBEW_WEB_ROOT . "/operator/blocked.php");
|
header("Location: " . MIBEW_WEB_ROOT . "/operator/blocked.php");
|
||||||
exit;
|
exit;
|
||||||
|
@ -31,8 +31,9 @@ $operator = check_login();
|
|||||||
force_password($operator);
|
force_password($operator);
|
||||||
csrfchecktoken();
|
csrfchecktoken();
|
||||||
|
|
||||||
$errors = array();
|
$page = array(
|
||||||
$page = array();
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
# locales
|
# locales
|
||||||
|
|
||||||
@ -55,7 +56,7 @@ $groupid = verifyparam("group", "/^\d{0,8}$/", "");
|
|||||||
if ($groupid) {
|
if ($groupid) {
|
||||||
$group = group_by_id($groupid);
|
$group = group_by_id($groupid);
|
||||||
if (!$group) {
|
if (!$group) {
|
||||||
$errors[] = getlocal("page.group.no_such");
|
$page['errors'][] = getlocal("page.group.no_such");
|
||||||
$groupid = "";
|
$groupid = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -77,10 +78,10 @@ if (isset($_GET['act']) && $_GET['act'] == 'delete') {
|
|||||||
$key = isset($_GET['key']) ? $_GET['key'] : "";
|
$key = isset($_GET['key']) ? $_GET['key'] : "";
|
||||||
|
|
||||||
if (!preg_match("/^\d+$/", $key)) {
|
if (!preg_match("/^\d+$/", $key)) {
|
||||||
$errors[] = "Wrong key";
|
$page['errors'][] = "Wrong key";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
$db = Database::getInstance();
|
$db = Database::getInstance();
|
||||||
$db->query("delete from {chatresponses} where id = ?", array($key));
|
$db->query("delete from {chatresponses} where id = ?", array($key));
|
||||||
header("Location: " . MIBEW_WEB_ROOT . "/operator/canned.php?lang=" . urlencode($lang) . "&group=" . intval($groupid));
|
header("Location: " . MIBEW_WEB_ROOT . "/operator/canned.php?lang=" . urlencode($lang) . "&group=" . intval($groupid));
|
||||||
|
@ -29,15 +29,16 @@ csrfchecktoken();
|
|||||||
|
|
||||||
$stringid = verifyparam("key", "/^\d{0,9}$/", "");
|
$stringid = verifyparam("key", "/^\d{0,9}$/", "");
|
||||||
|
|
||||||
$errors = array();
|
$page = array(
|
||||||
$page = array();
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
$page_style = new PageStyle(PageStyle::currentStyle());
|
$page_style = new PageStyle(PageStyle::currentStyle());
|
||||||
|
|
||||||
if ($stringid) {
|
if ($stringid) {
|
||||||
$canned_message = load_canned_message($stringid);
|
$canned_message = load_canned_message($stringid);
|
||||||
if (!$canned_message) {
|
if (!$canned_message) {
|
||||||
$errors[] = getlocal("cannededit.no_such");
|
$page['errors'][] = getlocal("cannededit.no_such");
|
||||||
$stringid = "";
|
$stringid = "";
|
||||||
}else{
|
}else{
|
||||||
$title = $canned_message['vctitle'];
|
$title = $canned_message['vctitle'];
|
||||||
@ -54,15 +55,15 @@ if ($stringid) {
|
|||||||
if (isset($_POST['message']) && isset($_POST['title'])) {
|
if (isset($_POST['message']) && isset($_POST['title'])) {
|
||||||
$title = getparam('title');
|
$title = getparam('title');
|
||||||
if (!$title) {
|
if (!$title) {
|
||||||
$errors[] = no_field("form.field.title");
|
$page['errors'][] = no_field("form.field.title");
|
||||||
}
|
}
|
||||||
|
|
||||||
$message = getparam('message');
|
$message = getparam('message');
|
||||||
if (!$message) {
|
if (!$message) {
|
||||||
$errors[] = no_field("form.field.message");
|
$page['errors'][] = no_field("form.field.message");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
if ($stringid) {
|
if ($stringid) {
|
||||||
save_canned_message($stringid, $title, $message);
|
save_canned_message($stringid, $title, $message);
|
||||||
} else {
|
} else {
|
||||||
|
@ -27,8 +27,10 @@ require_once(MIBEW_FS_ROOT.'/libs/settings.php');
|
|||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
csrfchecktoken();
|
csrfchecktoken();
|
||||||
|
|
||||||
$page = array('agentId' => '');
|
$page = array(
|
||||||
$errors = array();
|
'agentId' => '',
|
||||||
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
'enableban', 'usercanchangename',
|
'enableban', 'usercanchangename',
|
||||||
@ -57,7 +59,7 @@ if (isset($_POST['sent'])) {
|
|||||||
header("Location: " . MIBEW_WEB_ROOT . "/operator/features.php?stored");
|
header("Location: " . MIBEW_WEB_ROOT . "/operator/features.php?stored");
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$errors[] = "Not an administrator";
|
$page['errors'][] = "Not an administrator";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,12 +30,14 @@ require_once(MIBEW_FS_ROOT.'/libs/getcode.php');
|
|||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
force_password($operator);
|
force_password($operator);
|
||||||
|
|
||||||
$errors = array();
|
$page = array(
|
||||||
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
$imageLocales = get_image_locales_map(MIBEW_FS_ROOT.'/locales');
|
$imageLocales = get_image_locales_map(MIBEW_FS_ROOT.'/locales');
|
||||||
$image = verifyparam(isset($_GET['image']) ? "image" : "i", "/^\w+$/", "mibew");
|
$image = verifyparam(isset($_GET['image']) ? "image" : "i", "/^\w+$/", "mibew");
|
||||||
if (!isset($imageLocales[$image])) {
|
if (!isset($imageLocales[$image])) {
|
||||||
$errors[] = "Unknown image: $image";
|
$page['errors'][] = "Unknown image: $image";
|
||||||
$avail = array_keys($imageLocales);
|
$avail = array_keys($imageLocales);
|
||||||
$image = $avail[0];
|
$image = $avail[0];
|
||||||
}
|
}
|
||||||
@ -55,7 +57,7 @@ if ($invitationstyle && !in_array($invitationstyle, $invitationstylelist)) {
|
|||||||
$invitationstyle = "";
|
$invitationstyle = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$groupid = verifyparam_groupid("group", $errors);
|
$groupid = verifyparam_groupid("group", $page['errors']);
|
||||||
$showhost = verifyparam("hostname", "/^on$/", "") == "on";
|
$showhost = verifyparam("hostname", "/^on$/", "") == "on";
|
||||||
$forcesecure = verifyparam("secure", "/^on$/", "") == "on";
|
$forcesecure = verifyparam("secure", "/^on$/", "") == "on";
|
||||||
$modsecurity = verifyparam("modsecurity", "/^on$/", "") == "on";
|
$modsecurity = verifyparam("modsecurity", "/^on$/", "") == "on";
|
||||||
@ -76,7 +78,6 @@ if ($groupid) {
|
|||||||
}
|
}
|
||||||
$message = get_image($imagehref, $size[0], $size[1]);
|
$message = get_image($imagehref, $size[0], $size[1]);
|
||||||
|
|
||||||
$page = array();
|
|
||||||
$page['buttonCode'] = generate_button("", $lang, $style, $invitationstyle, $groupid, $message, $showhost, $forcesecure, $modsecurity, $operator_code);
|
$page['buttonCode'] = generate_button("", $lang, $style, $invitationstyle, $groupid, $message, $showhost, $forcesecure, $modsecurity, $operator_code);
|
||||||
$page['availableImages'] = array_keys($imageLocales);
|
$page['availableImages'] = array_keys($imageLocales);
|
||||||
$page['availableLocales'] = $image_locales;
|
$page['availableLocales'] = $image_locales;
|
||||||
|
@ -27,8 +27,11 @@ require_once(MIBEW_FS_ROOT.'/libs/groups.php');
|
|||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
csrfchecktoken();
|
csrfchecktoken();
|
||||||
|
|
||||||
$page = array('grid' => '');
|
$page = array(
|
||||||
$errors = array();
|
'grid' => '',
|
||||||
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
$groupid = '';
|
$groupid = '';
|
||||||
|
|
||||||
function group_by_name($name)
|
function group_by_name($name)
|
||||||
@ -157,13 +160,13 @@ if (isset($_POST['name'])) {
|
|||||||
$logo = getparam('logo');
|
$logo = getparam('logo');
|
||||||
|
|
||||||
if (!$name)
|
if (!$name)
|
||||||
$errors[] = no_field("form.field.groupname");
|
$page['errors'][] = no_field("form.field.groupname");
|
||||||
|
|
||||||
if ($email != '' && !is_valid_email($email))
|
if ($email != '' && !is_valid_email($email))
|
||||||
$errors[] = wrong_field("form.field.mail");
|
$page['errors'][] = wrong_field("form.field.mail");
|
||||||
|
|
||||||
if (! preg_match("/^(\d{1,9})?$/", $weight))
|
if (! preg_match("/^(\d{1,9})?$/", $weight))
|
||||||
$errors[] = wrong_field("form.field.groupweight");
|
$page['errors'][] = wrong_field("form.field.groupweight");
|
||||||
|
|
||||||
if ($weight == '')
|
if ($weight == '')
|
||||||
$weight = 0;
|
$weight = 0;
|
||||||
@ -174,9 +177,9 @@ if (isset($_POST['name'])) {
|
|||||||
$existing_group = group_by_name($name);
|
$existing_group = group_by_name($name);
|
||||||
if ((!$groupid && $existing_group) ||
|
if ((!$groupid && $existing_group) ||
|
||||||
($groupid && $existing_group && $groupid != $existing_group['groupid']))
|
($groupid && $existing_group && $groupid != $existing_group['groupid']))
|
||||||
$errors[] = getlocal("page.group.duplicate_name");
|
$page['errors'][] = getlocal("page.group.duplicate_name");
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
if (!$groupid) {
|
if (!$groupid) {
|
||||||
$newdep = create_group(array(
|
$newdep = create_group(array(
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
@ -229,7 +232,7 @@ if (isset($_POST['name'])) {
|
|||||||
$group = group_by_id($groupid);
|
$group = group_by_id($groupid);
|
||||||
|
|
||||||
if (!$group) {
|
if (!$group) {
|
||||||
$errors[] = getlocal("page.group.no_such");
|
$page['errors'][] = getlocal("page.group.no_such");
|
||||||
$page['grid'] = topage($groupid);
|
$page['grid'] = topage($groupid);
|
||||||
} else {
|
} else {
|
||||||
$page['formname'] = topage($group['vclocalname']);
|
$page['formname'] = topage($group['vclocalname']);
|
||||||
|
@ -63,12 +63,12 @@ function get_operators()
|
|||||||
$groupid = verifyparam("gid", "/^\d{1,9}$/");
|
$groupid = verifyparam("gid", "/^\d{1,9}$/");
|
||||||
$page = array('groupid' => $groupid);
|
$page = array('groupid' => $groupid);
|
||||||
$page['operators'] = get_operators();
|
$page['operators'] = get_operators();
|
||||||
$errors = array();
|
$page['errors'] = array();
|
||||||
|
|
||||||
$group = group_by_id($groupid);
|
$group = group_by_id($groupid);
|
||||||
|
|
||||||
if (!$group) {
|
if (!$group) {
|
||||||
$errors[] = getlocal("page.group.no_such");
|
$page['errors'][] = getlocal("page.group.no_such");
|
||||||
|
|
||||||
} else if (isset($_POST['gid'])) {
|
} else if (isset($_POST['gid'])) {
|
||||||
|
|
||||||
|
@ -32,14 +32,14 @@ if (isset($_GET['act']) && $_GET['act'] == 'del') {
|
|||||||
$groupid = isset($_GET['gid']) ? $_GET['gid'] : "";
|
$groupid = isset($_GET['gid']) ? $_GET['gid'] : "";
|
||||||
|
|
||||||
if (!preg_match("/^\d+$/", $groupid)) {
|
if (!preg_match("/^\d+$/", $groupid)) {
|
||||||
$errors[] = getlocal("page.groups.error.cannot_delete");
|
$page['errors'][] = getlocal("page.groups.error.cannot_delete");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_capable(CAN_ADMINISTRATE, $operator)) {
|
if (!is_capable(CAN_ADMINISTRATE, $operator)) {
|
||||||
$errors[] = getlocal("page.groups.error.forbidden_remove");
|
$page['errors'][] = getlocal("page.groups.error.forbidden_remove");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
$db = Database::getInstance();
|
$db = Database::getInstance();
|
||||||
$db->query("delete from {chatgroup} where groupid = ?", array($groupid));
|
$db->query("delete from {chatgroup} where groupid = ?", array($groupid));
|
||||||
$db->query("delete from {chatgroupoperator} where groupid = ?", array($groupid));
|
$db->query("delete from {chatgroupoperator} where groupid = ?", array($groupid));
|
||||||
|
@ -22,8 +22,11 @@ use Mibew\Style\PageStyle;
|
|||||||
require_once(dirname(dirname(__FILE__)).'/libs/init.php');
|
require_once(dirname(dirname(__FILE__)).'/libs/init.php');
|
||||||
require_once(MIBEW_FS_ROOT.'/libs/operator.php');
|
require_once(MIBEW_FS_ROOT.'/libs/operator.php');
|
||||||
|
|
||||||
$errors = array();
|
$page = array(
|
||||||
$page = array('formisRemember' => true, 'version' => MIBEW_VERSION);
|
'formisRemember' => true,
|
||||||
|
'version' => MIBEW_VERSION,
|
||||||
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
if (isset($_POST['login']) && isset($_POST['password'])) {
|
if (isset($_POST['login']) && isset($_POST['password'])) {
|
||||||
$login = getparam('login');
|
$login = getparam('login');
|
||||||
@ -44,9 +47,9 @@ if (isset($_POST['login']) && isset($_POST['password'])) {
|
|||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
if (operator_is_disabled($operator)) {
|
if (operator_is_disabled($operator)) {
|
||||||
$errors[] = getlocal('page_login.operator.disabled');
|
$page['errors'][] = getlocal('page_login.operator.disabled');
|
||||||
} else {
|
} else {
|
||||||
$errors[] = getlocal("page_login.error");
|
$page['errors'][] = getlocal("page_login.error");
|
||||||
}
|
}
|
||||||
$page['formlogin'] = $login;
|
$page['formlogin'] = $login;
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,11 @@ require_once(MIBEW_FS_ROOT.'/libs/operator_settings.php');
|
|||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
csrfchecktoken();
|
csrfchecktoken();
|
||||||
|
|
||||||
$page = array('opid' => '');
|
$page = array(
|
||||||
$errors = array();
|
'opid' => '',
|
||||||
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
$opId = '';
|
$opId = '';
|
||||||
|
|
||||||
if ((isset($_POST['login']) || !is_capable(CAN_ADMINISTRATE, $operator)) && isset($_POST['password'])) {
|
if ((isset($_POST['login']) || !is_capable(CAN_ADMINISTRATE, $operator)) && isset($_POST['password'])) {
|
||||||
@ -45,35 +48,35 @@ if ((isset($_POST['login']) || !is_capable(CAN_ADMINISTRATE, $operator)) && isse
|
|||||||
$code = getparam('code');
|
$code = getparam('code');
|
||||||
|
|
||||||
if (!$localname)
|
if (!$localname)
|
||||||
$errors[] = no_field("form.field.agent_name");
|
$page['errors'][] = no_field("form.field.agent_name");
|
||||||
|
|
||||||
if (!$commonname)
|
if (!$commonname)
|
||||||
$errors[] = no_field("form.field.agent_commonname");
|
$page['errors'][] = no_field("form.field.agent_commonname");
|
||||||
|
|
||||||
if (!$login) {
|
if (!$login) {
|
||||||
$errors[] = no_field("form.field.login");
|
$page['errors'][] = no_field("form.field.login");
|
||||||
} else if (!preg_match("/^[\w_\.]+$/", $login)) {
|
} else if (!preg_match("/^[\w_\.]+$/", $login)) {
|
||||||
$errors[] = getlocal("page_agent.error.wrong_login");
|
$page['errors'][] = getlocal("page_agent.error.wrong_login");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($email == '' || !is_valid_email($email)) {
|
if ($email == '' || !is_valid_email($email)) {
|
||||||
$errors[] = wrong_field("form.field.mail");
|
$page['errors'][] = wrong_field("form.field.mail");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($code != '' && (! preg_match("/^[A-z0-9_]+$/", $code))) {
|
if ($code != '' && (! preg_match("/^[A-z0-9_]+$/", $code))) {
|
||||||
$errors[] = getlocal("page_agent.error.wrong_agent_code");
|
$page['errors'][] = getlocal("page_agent.error.wrong_agent_code");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$opId && !$password)
|
if (!$opId && !$password)
|
||||||
$errors[] = no_field("form.field.password");
|
$page['errors'][] = no_field("form.field.password");
|
||||||
|
|
||||||
if ($password != $passwordConfirm)
|
if ($password != $passwordConfirm)
|
||||||
$errors[] = getlocal("my_settings.error.password_match");
|
$page['errors'][] = getlocal("my_settings.error.password_match");
|
||||||
|
|
||||||
$existing_operator = operator_by_login($login);
|
$existing_operator = operator_by_login($login);
|
||||||
if ((!$opId && $existing_operator) ||
|
if ((!$opId && $existing_operator) ||
|
||||||
($opId && $existing_operator && $opId != $existing_operator['operatorid']))
|
($opId && $existing_operator && $opId != $existing_operator['operatorid']))
|
||||||
$errors[] = getlocal("page_agent.error.duplicate_login");
|
$page['errors'][] = getlocal("page_agent.error.duplicate_login");
|
||||||
|
|
||||||
// Check if operator with specified email already exists in the database
|
// Check if operator with specified email already exists in the database
|
||||||
$existing_operator = operator_by_email($email);
|
$existing_operator = operator_by_email($email);
|
||||||
@ -83,16 +86,16 @@ if ((isset($_POST['login']) || !is_capable(CAN_ADMINISTRATE, $operator)) && isse
|
|||||||
// Update operator email to existing one
|
// Update operator email to existing one
|
||||||
($opId && $existing_operator && $opId != $existing_operator['operatorid'])
|
($opId && $existing_operator && $opId != $existing_operator['operatorid'])
|
||||||
) {
|
) {
|
||||||
$errors[] = getlocal("page_agent.error.duplicate_email");
|
$page['errors'][] = getlocal("page_agent.error.duplicate_email");
|
||||||
}
|
}
|
||||||
|
|
||||||
$canmodify = ($opId == $operator['operatorid'] && is_capable(CAN_MODIFYPROFILE, $operator))
|
$canmodify = ($opId == $operator['operatorid'] && is_capable(CAN_MODIFYPROFILE, $operator))
|
||||||
|| is_capable(CAN_ADMINISTRATE, $operator);
|
|| is_capable(CAN_ADMINISTRATE, $operator);
|
||||||
if (!$canmodify) {
|
if (!$canmodify) {
|
||||||
$errors[] = getlocal('page_agent.cannot_modify');
|
$page['errors'][] = getlocal('page_agent.cannot_modify');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
if (!$opId) {
|
if (!$opId) {
|
||||||
$newop = create_operator($login, $email, $password, $localname, $commonname, "", $code);
|
$newop = create_operator($login, $email, $password, $localname, $commonname, "", $code);
|
||||||
header("Location: " . MIBEW_WEB_ROOT . "/operator/avatar.php?op=" . intval($newop['operatorid']));
|
header("Location: " . MIBEW_WEB_ROOT . "/operator/avatar.php?op=" . intval($newop['operatorid']));
|
||||||
@ -125,13 +128,13 @@ if ((isset($_POST['login']) || !is_capable(CAN_ADMINISTRATE, $operator)) && isse
|
|||||||
$op = operator_by_id($opId);
|
$op = operator_by_id($opId);
|
||||||
|
|
||||||
if (!$op) {
|
if (!$op) {
|
||||||
$errors[] = getlocal("no_such_operator");
|
$page['errors'][] = getlocal("no_such_operator");
|
||||||
$page['opid'] = topage($opId);
|
$page['opid'] = topage($opId);
|
||||||
} else {
|
} else {
|
||||||
//show an error if the admin password hasn't been set yet.
|
//show an error if the admin password hasn't been set yet.
|
||||||
if (check_password_hash($operator['vclogin'], '', $operator['vcpassword']) && !isset($_GET['stored']))
|
if (check_password_hash($operator['vclogin'], '', $operator['vcpassword']) && !isset($_GET['stored']))
|
||||||
{
|
{
|
||||||
$errors[] = getlocal("my_settings.error.no_password");
|
$page['errors'][] = getlocal("my_settings.error.no_password");
|
||||||
}
|
}
|
||||||
|
|
||||||
$page['formlogin'] = topage($op['vclogin']);
|
$page['formlogin'] = topage($op['vclogin']);
|
||||||
@ -144,7 +147,7 @@ if ((isset($_POST['login']) || !is_capable(CAN_ADMINISTRATE, $operator)) && isse
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$opId && !is_capable(CAN_ADMINISTRATE, $operator)) {
|
if (!$opId && !is_capable(CAN_ADMINISTRATE, $operator)) {
|
||||||
$errors[] = getlocal("page_agent.error.forbidden_create");
|
$page['errors'][] = getlocal("page_agent.error.forbidden_create");
|
||||||
}
|
}
|
||||||
|
|
||||||
$canmodify = ($opId == $operator['operatorid'] && is_capable(CAN_MODIFYPROFILE, $operator))
|
$canmodify = ($opId == $operator['operatorid'] && is_capable(CAN_MODIFYPROFILE, $operator))
|
||||||
|
@ -27,33 +27,36 @@ $operator = check_login();
|
|||||||
force_password($operator);
|
force_password($operator);
|
||||||
csrfchecktoken();
|
csrfchecktoken();
|
||||||
|
|
||||||
|
$page = array(
|
||||||
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
if (isset($_GET['act'])) {
|
if (isset($_GET['act'])) {
|
||||||
|
|
||||||
$errors = array();
|
|
||||||
$operatorid = isset($_GET['id']) ? $_GET['id'] : "";
|
$operatorid = isset($_GET['id']) ? $_GET['id'] : "";
|
||||||
if (!preg_match("/^\d+$/", $operatorid)) {
|
if (!preg_match("/^\d+$/", $operatorid)) {
|
||||||
$errors[] = getlocal("no_such_operator");
|
$page['errors'][] = getlocal("no_such_operator");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET['act'] == 'del') {
|
if ($_GET['act'] == 'del') {
|
||||||
if (!is_capable(CAN_ADMINISTRATE, $operator)) {
|
if (!is_capable(CAN_ADMINISTRATE, $operator)) {
|
||||||
$errors[] = getlocal("page_agents.error.forbidden_remove");
|
$page['errors'][] = getlocal("page_agents.error.forbidden_remove");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($operatorid == $operator['operatorid']) {
|
if ($operatorid == $operator['operatorid']) {
|
||||||
$errors[] = getlocal("page_agents.error.cannot_remove_self");
|
$page['errors'][] = getlocal("page_agents.error.cannot_remove_self");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
$op = operator_by_id($operatorid);
|
$op = operator_by_id($operatorid);
|
||||||
if (!$op) {
|
if (!$op) {
|
||||||
$errors[] = getlocal("no_such_operator");
|
$page['errors'][] = getlocal("no_such_operator");
|
||||||
} else if ($op['vclogin'] == 'admin') {
|
} else if ($op['vclogin'] == 'admin') {
|
||||||
$errors[] = getlocal("page_agents.error.cannot_remove_admin");
|
$page['errors'][] = getlocal("page_agents.error.cannot_remove_admin");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
delete_operator($operatorid);
|
delete_operator($operatorid);
|
||||||
header("Location: " . MIBEW_WEB_ROOT . "/operator/operators.php");
|
header("Location: " . MIBEW_WEB_ROOT . "/operator/operators.php");
|
||||||
exit;
|
exit;
|
||||||
@ -62,23 +65,23 @@ if (isset($_GET['act'])) {
|
|||||||
if ($_GET['act'] == 'disable' || $_GET['act'] == 'enable') {
|
if ($_GET['act'] == 'disable' || $_GET['act'] == 'enable') {
|
||||||
$act_disable = ($_GET['act'] == 'disable');
|
$act_disable = ($_GET['act'] == 'disable');
|
||||||
if (!is_capable(CAN_ADMINISTRATE, $operator)) {
|
if (!is_capable(CAN_ADMINISTRATE, $operator)) {
|
||||||
$errors[] = $act_disable?getlocal('page_agents.disable.not.allowed'):getlocal('page_agents.enable.not.allowed');
|
$page['errors'][] = $act_disable?getlocal('page_agents.disable.not.allowed'):getlocal('page_agents.enable.not.allowed');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($operatorid == $operator['operatorid'] && $act_disable) {
|
if ($operatorid == $operator['operatorid'] && $act_disable) {
|
||||||
$errors[] = getlocal('page_agents.cannot.disable.self');
|
$page['errors'][] = getlocal('page_agents.cannot.disable.self');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
$op = operator_by_id($operatorid);
|
$op = operator_by_id($operatorid);
|
||||||
if (!$op) {
|
if (!$op) {
|
||||||
$errors[] = getlocal("no_such_operator");
|
$page['errors'][] = getlocal("no_such_operator");
|
||||||
} else if ($op['vclogin'] == 'admin' && $act_disable) {
|
} else if ($op['vclogin'] == 'admin' && $act_disable) {
|
||||||
$errors[] = getlocal('page_agents.cannot.disable.admin');
|
$page['errors'][] = getlocal('page_agents.cannot.disable.admin');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
$db = Database::getInstance();
|
$db = Database::getInstance();
|
||||||
$db->query(
|
$db->query(
|
||||||
"update {chatoperator} set idisabled = ? where operatorid = ?",
|
"update {chatoperator} set idisabled = ? where operatorid = ?",
|
||||||
@ -91,7 +94,6 @@ if (isset($_GET['act'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$page = array();
|
|
||||||
$sort['by'] = verifyparam("sortby", "/^(login|commonname|localename|lastseen)$/", "login");
|
$sort['by'] = verifyparam("sortby", "/^(login|commonname|localename|lastseen)$/", "login");
|
||||||
$sort['desc'] = (verifyparam("sortdirection", "/^(desc|asc)$/", "desc") == "desc");
|
$sort['desc'] = (verifyparam("sortdirection", "/^(desc|asc)$/", "desc") == "desc");
|
||||||
$page['formsortby'] = $sort['by'];
|
$page['formsortby'] = $sort['by'];
|
||||||
|
@ -48,22 +48,22 @@ $operator_in_isolation = in_isolation($operator);
|
|||||||
$opId = verifyparam("op", "/^\d{1,9}$/");
|
$opId = verifyparam("op", "/^\d{1,9}$/");
|
||||||
$page = array('opid' => $opId);
|
$page = array('opid' => $opId);
|
||||||
$page['groups'] = $operator_in_isolation?get_all_groups_for_operator($operator):get_all_groups();
|
$page['groups'] = $operator_in_isolation?get_all_groups_for_operator($operator):get_all_groups();
|
||||||
$errors = array();
|
$page['errors'] = array();
|
||||||
|
|
||||||
$canmodify = is_capable(CAN_ADMINISTRATE, $operator);
|
$canmodify = is_capable(CAN_ADMINISTRATE, $operator);
|
||||||
|
|
||||||
$op = operator_by_id($opId);
|
$op = operator_by_id($opId);
|
||||||
|
|
||||||
if (!$op) {
|
if (!$op) {
|
||||||
$errors[] = getlocal("no_such_operator");
|
$page['errors'][] = getlocal("no_such_operator");
|
||||||
|
|
||||||
} else if (isset($_POST['op'])) {
|
} else if (isset($_POST['op'])) {
|
||||||
|
|
||||||
if (!$canmodify) {
|
if (!$canmodify) {
|
||||||
$errors[] = getlocal('page_agent.cannot_modify');
|
$page['errors'][] = getlocal('page_agent.cannot_modify');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
$new_groups = array();
|
$new_groups = array();
|
||||||
foreach ($page['groups'] as $group) {
|
foreach ($page['groups'] as $group) {
|
||||||
if (verifyparam("group" . $group['groupid'], "/^on$/", "") == "on") {
|
if (verifyparam("group" . $group['groupid'], "/^on$/", "") == "on") {
|
||||||
|
@ -27,8 +27,10 @@ require_once(MIBEW_FS_ROOT.'/libs/settings.php');
|
|||||||
$operator = check_login();
|
$operator = check_login();
|
||||||
csrfchecktoken();
|
csrfchecktoken();
|
||||||
|
|
||||||
$page = array('agentId' => '');
|
$page = array(
|
||||||
$errors = array();
|
'agentId' => '',
|
||||||
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
'online_timeout', 'updatefrequency_operator', 'updatefrequency_chat',
|
'online_timeout', 'updatefrequency_operator', 'updatefrequency_chat',
|
||||||
@ -44,59 +46,59 @@ foreach ($options as $opt) {
|
|||||||
if (isset($_POST['onlinetimeout'])) {
|
if (isset($_POST['onlinetimeout'])) {
|
||||||
$params['online_timeout'] = getparam('onlinetimeout');
|
$params['online_timeout'] = getparam('onlinetimeout');
|
||||||
if (!is_numeric($params['online_timeout'])) {
|
if (!is_numeric($params['online_timeout'])) {
|
||||||
$errors[] = wrong_field("settings.onlinetimeout");
|
$page['errors'][] = wrong_field("settings.onlinetimeout");
|
||||||
}
|
}
|
||||||
|
|
||||||
$params['updatefrequency_operator'] = getparam('frequencyoperator');
|
$params['updatefrequency_operator'] = getparam('frequencyoperator');
|
||||||
if (!is_numeric($params['updatefrequency_operator'])) {
|
if (!is_numeric($params['updatefrequency_operator'])) {
|
||||||
$errors[] = wrong_field("settings.frequencyoperator");
|
$page['errors'][] = wrong_field("settings.frequencyoperator");
|
||||||
}
|
}
|
||||||
|
|
||||||
$params['updatefrequency_chat'] = getparam('frequencychat');
|
$params['updatefrequency_chat'] = getparam('frequencychat');
|
||||||
if (!is_numeric($params['updatefrequency_chat'])) {
|
if (!is_numeric($params['updatefrequency_chat'])) {
|
||||||
$errors[] = wrong_field("settings.frequencychat");
|
$page['errors'][] = wrong_field("settings.frequencychat");
|
||||||
}
|
}
|
||||||
|
|
||||||
$params['max_connections_from_one_host'] = getparam('onehostconnections');
|
$params['max_connections_from_one_host'] = getparam('onehostconnections');
|
||||||
if (!is_numeric($params['max_connections_from_one_host'])) {
|
if (!is_numeric($params['max_connections_from_one_host'])) {
|
||||||
$errors[] = getlocal("settings.wrong.onehostconnections");
|
$page['errors'][] = getlocal("settings.wrong.onehostconnections");
|
||||||
}
|
}
|
||||||
|
|
||||||
$params['thread_lifetime'] = getparam('threadlifetime');
|
$params['thread_lifetime'] = getparam('threadlifetime');
|
||||||
if (!is_numeric($params['thread_lifetime'])) {
|
if (!is_numeric($params['thread_lifetime'])) {
|
||||||
$errors[] = getlocal("settings.wrong.threadlifetime");
|
$page['errors'][] = getlocal("settings.wrong.threadlifetime");
|
||||||
}
|
}
|
||||||
|
|
||||||
$params['statistics_aggregation_interval'] = getparam('statistics_aggregation_interval');
|
$params['statistics_aggregation_interval'] = getparam('statistics_aggregation_interval');
|
||||||
if (!is_numeric($params['statistics_aggregation_interval'])) {
|
if (!is_numeric($params['statistics_aggregation_interval'])) {
|
||||||
$errors[] = wrong_field("settings.statistics_aggregation_interval");
|
$page['errors'][] = wrong_field("settings.statistics_aggregation_interval");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings::get('enabletracking')) {
|
if (Settings::get('enabletracking')) {
|
||||||
|
|
||||||
$params['updatefrequency_tracking'] = getparam('frequencytracking');
|
$params['updatefrequency_tracking'] = getparam('frequencytracking');
|
||||||
if (!is_numeric($params['updatefrequency_tracking'])) {
|
if (!is_numeric($params['updatefrequency_tracking'])) {
|
||||||
$errors[] = wrong_field("settings.frequencytracking");
|
$page['errors'][] = wrong_field("settings.frequencytracking");
|
||||||
}
|
}
|
||||||
|
|
||||||
$params['visitors_limit'] = getparam('visitorslimit');
|
$params['visitors_limit'] = getparam('visitorslimit');
|
||||||
if (!is_numeric($params['visitors_limit'])) {
|
if (!is_numeric($params['visitors_limit'])) {
|
||||||
$errors[] = wrong_field("settings.visitorslimit");
|
$page['errors'][] = wrong_field("settings.visitorslimit");
|
||||||
}
|
}
|
||||||
|
|
||||||
$params['invitation_lifetime'] = getparam('invitationlifetime');
|
$params['invitation_lifetime'] = getparam('invitationlifetime');
|
||||||
if (!is_numeric($params['invitation_lifetime'])) {
|
if (!is_numeric($params['invitation_lifetime'])) {
|
||||||
$errors[] = wrong_field("settings.invitationlifetime");
|
$page['errors'][] = wrong_field("settings.invitationlifetime");
|
||||||
}
|
}
|
||||||
|
|
||||||
$params['tracking_lifetime'] = getparam('trackinglifetime');
|
$params['tracking_lifetime'] = getparam('trackinglifetime');
|
||||||
if (!is_numeric($params['tracking_lifetime'])) {
|
if (!is_numeric($params['tracking_lifetime'])) {
|
||||||
$errors[] = wrong_field("settings.trackinglifetime");
|
$page['errors'][] = wrong_field("settings.trackinglifetime");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
foreach ($options as $opt) {
|
foreach ($options as $opt) {
|
||||||
Settings::set($opt,$params[$opt]);
|
Settings::set($opt,$params[$opt]);
|
||||||
}
|
}
|
||||||
|
@ -27,18 +27,21 @@ $operator = check_login();
|
|||||||
csrfchecktoken();
|
csrfchecktoken();
|
||||||
|
|
||||||
$opId = verifyparam("op", "/^\d{1,9}$/");
|
$opId = verifyparam("op", "/^\d{1,9}$/");
|
||||||
$page = array('opid' => $opId, 'canmodify' => is_capable(CAN_ADMINISTRATE, $operator) ? "1" : "");
|
$page = array(
|
||||||
$errors = array();
|
'opid' => $opId,
|
||||||
|
'canmodify' => is_capable(CAN_ADMINISTRATE, $operator) ? "1" : "",
|
||||||
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
$op = operator_by_id($opId);
|
$op = operator_by_id($opId);
|
||||||
|
|
||||||
if (!$op) {
|
if (!$op) {
|
||||||
$errors[] = getlocal("no_such_operator");
|
$page['errors'][] = getlocal("no_such_operator");
|
||||||
|
|
||||||
} else if (isset($_POST['op'])) {
|
} else if (isset($_POST['op'])) {
|
||||||
|
|
||||||
if (!is_capable(CAN_ADMINISTRATE, $operator)) {
|
if (!is_capable(CAN_ADMINISTRATE, $operator)) {
|
||||||
$errors[] = getlocal('page_agent.cannot_modify');
|
$page['errors'][] = getlocal('page_agent.cannot_modify');
|
||||||
}
|
}
|
||||||
|
|
||||||
$new_permissions = isset($op['iperm']) ? $op['iperm'] : 0;
|
$new_permissions = isset($op['iperm']) ? $op['iperm'] : 0;
|
||||||
@ -51,7 +54,7 @@ if (!$op) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
update_operator_permissions($op['operatorid'], $new_permissions);
|
update_operator_permissions($op['operatorid'], $new_permissions);
|
||||||
|
|
||||||
if ($opId && $_SESSION[SESSION_PREFIX."operator"] && $operator['operatorid'] == $opId) {
|
if ($opId && $_SESSION[SESSION_PREFIX."operator"] && $operator['operatorid'] == $opId) {
|
||||||
|
@ -36,8 +36,9 @@ if (! $thread) {
|
|||||||
die("wrong thread");
|
die("wrong thread");
|
||||||
}
|
}
|
||||||
|
|
||||||
$page = array();
|
$page = array(
|
||||||
$errors = array();
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
// Initialize chat style which is currently used in system
|
// Initialize chat style which is currently used in system
|
||||||
$chat_style = new ChatStyle(ChatStyle::currentStyle());
|
$chat_style = new ChatStyle(ChatStyle::currentStyle());
|
||||||
@ -65,10 +66,10 @@ if (isset($_GET['nextGroup'])) {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$errors[] = getlocal("chat.redirect.cannot");
|
$page['errors'][] = getlocal("chat.redirect.cannot");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$errors[] = "Unknown group";
|
$page['errors'][] = "Unknown group";
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -106,10 +107,10 @@ if (isset($_GET['nextGroup'])) {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$errors[] = getlocal("chat.redirect.cannot");
|
$page['errors'][] = getlocal("chat.redirect.cannot");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$errors[] = "Unknown operator";
|
$page['errors'][] = "Unknown operator";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,10 +118,8 @@ $page = array_merge_recursive(
|
|||||||
$page,
|
$page,
|
||||||
setup_logo()
|
setup_logo()
|
||||||
);
|
);
|
||||||
$page['errors'] = $errors;
|
|
||||||
|
|
||||||
|
if (count($page['errors']) > 0) {
|
||||||
if (count($errors) > 0) {
|
|
||||||
$chat_style->render('error', $page);
|
$chat_style->render('error', $page);
|
||||||
} else {
|
} else {
|
||||||
$chat_style->render('redirected', $page);
|
$chat_style->render('redirected', $page);
|
||||||
|
@ -24,7 +24,6 @@ require_once(dirname(dirname(__FILE__)).'/libs/init.php');
|
|||||||
require_once(MIBEW_FS_ROOT.'/libs/operator.php');
|
require_once(MIBEW_FS_ROOT.'/libs/operator.php');
|
||||||
require_once(MIBEW_FS_ROOT.'/libs/settings.php');
|
require_once(MIBEW_FS_ROOT.'/libs/settings.php');
|
||||||
|
|
||||||
$errors = array();
|
|
||||||
$page = array(
|
$page = array(
|
||||||
'version' => MIBEW_VERSION,
|
'version' => MIBEW_VERSION,
|
||||||
'showform' => true,
|
'showform' => true,
|
||||||
@ -32,6 +31,7 @@ $page = array(
|
|||||||
'headertitle' => getlocal("app.title"),
|
'headertitle' => getlocal("app.title"),
|
||||||
'show_small_login' => true,
|
'show_small_login' => true,
|
||||||
'fixedwrap' => true,
|
'fixedwrap' => true,
|
||||||
|
'errors' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
$page_style = new PageStyle(PageStyle::currentStyle());
|
$page_style = new PageStyle(PageStyle::currentStyle());
|
||||||
@ -42,24 +42,24 @@ $token = verifyparam("token", "/^[\dabcdef]+$/");
|
|||||||
$operator = operator_by_id($opId);
|
$operator = operator_by_id($opId);
|
||||||
|
|
||||||
if (!$operator) {
|
if (!$operator) {
|
||||||
$errors[] = "No such operator";
|
$page['errors'][] = "No such operator";
|
||||||
$page['showform'] = false;
|
$page['showform'] = false;
|
||||||
} else if ($token != $operator['vcrestoretoken']) {
|
} else if ($token != $operator['vcrestoretoken']) {
|
||||||
$errors[] = "Wrong token";
|
$page['errors'][] = "Wrong token";
|
||||||
$page['showform'] = false;
|
$page['showform'] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0 && isset($_POST['password'])) {
|
if (count($page['errors']) == 0 && isset($_POST['password'])) {
|
||||||
$password = getparam('password');
|
$password = getparam('password');
|
||||||
$passwordConfirm = getparam('passwordConfirm');
|
$passwordConfirm = getparam('passwordConfirm');
|
||||||
|
|
||||||
if (!$password)
|
if (!$password)
|
||||||
$errors[] = no_field("form.field.password");
|
$page['errors'][] = no_field("form.field.password");
|
||||||
|
|
||||||
if ($password != $passwordConfirm)
|
if ($password != $passwordConfirm)
|
||||||
$errors[] = getlocal("my_settings.error.password_match");
|
$page['errors'][] = getlocal("my_settings.error.password_match");
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
$page['isdone'] = true;
|
$page['isdone'] = true;
|
||||||
|
|
||||||
$db = Database::getInstance();
|
$db = Database::getInstance();
|
||||||
|
@ -25,13 +25,13 @@ require_once(MIBEW_FS_ROOT.'/libs/operator.php');
|
|||||||
require_once(MIBEW_FS_ROOT.'/libs/settings.php');
|
require_once(MIBEW_FS_ROOT.'/libs/settings.php');
|
||||||
require_once(MIBEW_FS_ROOT.'/libs/notify.php');
|
require_once(MIBEW_FS_ROOT.'/libs/notify.php');
|
||||||
|
|
||||||
$errors = array();
|
|
||||||
$page = array(
|
$page = array(
|
||||||
'version' => MIBEW_VERSION,
|
'version' => MIBEW_VERSION,
|
||||||
'title' => getlocal("restore.title"),
|
'title' => getlocal("restore.title"),
|
||||||
'headertitle' => getlocal("app.title"),
|
'headertitle' => getlocal("app.title"),
|
||||||
'show_small_login' => true,
|
'show_small_login' => true,
|
||||||
'fixedwrap' => true,
|
'fixedwrap' => true,
|
||||||
|
'errors' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
$loginoremail = "";
|
$loginoremail = "";
|
||||||
@ -43,15 +43,15 @@ if (isset($_POST['loginoremail'])) {
|
|||||||
|
|
||||||
$torestore = is_valid_email($loginoremail) ? operator_by_email($loginoremail) : operator_by_login($loginoremail);
|
$torestore = is_valid_email($loginoremail) ? operator_by_email($loginoremail) : operator_by_login($loginoremail);
|
||||||
if (!$torestore) {
|
if (!$torestore) {
|
||||||
$errors[] = getlocal("no_such_operator");
|
$page['errors'][] = getlocal("no_such_operator");
|
||||||
}
|
}
|
||||||
|
|
||||||
$email = $torestore['vcemail'];
|
$email = $torestore['vcemail'];
|
||||||
if (count($errors) == 0 && !is_valid_email($email)) {
|
if (count($page['errors']) == 0 && !is_valid_email($email)) {
|
||||||
$errors[] = "Operator hasn't set his e-mail";
|
$page['errors'][] = "Operator hasn't set his e-mail";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
$token = sha1($torestore['vclogin'] . (function_exists('openssl_random_pseudo_bytes') ? openssl_random_pseudo_bytes(32) : (time() + microtime()) . mt_rand(0, 99999999)));
|
$token = sha1($torestore['vclogin'] . (function_exists('openssl_random_pseudo_bytes') ? openssl_random_pseudo_bytes(32) : (time() + microtime()) . mt_rand(0, 99999999)));
|
||||||
|
|
||||||
$db = Database::getInstance();
|
$db = Database::getInstance();
|
||||||
|
@ -31,8 +31,10 @@ $operator = check_login();
|
|||||||
force_password($operator);
|
force_password($operator);
|
||||||
csrfchecktoken();
|
csrfchecktoken();
|
||||||
|
|
||||||
$page = array('agentId' => '');
|
$page = array(
|
||||||
$errors = array();
|
'agentId' => '',
|
||||||
|
'errors' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
// Load system configs
|
// Load system configs
|
||||||
$options = array(
|
$options = array(
|
||||||
@ -97,22 +99,22 @@ if (isset($_POST['email']) && isset($_POST['title']) && isset($_POST['logo'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($params['email'] && !is_valid_email($params['email'])) {
|
if ($params['email'] && !is_valid_email($params['email'])) {
|
||||||
$errors[] = getlocal("settings.wrong.email");
|
$page['errors'][] = getlocal("settings.wrong.email");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($params['geolinkparams']) {
|
if ($params['geolinkparams']) {
|
||||||
foreach (preg_split("/,/", $params['geolinkparams']) as $oneparam) {
|
foreach (preg_split("/,/", $params['geolinkparams']) as $oneparam) {
|
||||||
if (!preg_match("/^\s*(toolbar|scrollbars|location|status|menubar|width|height|resizable)=\d{1,4}$/", $oneparam)) {
|
if (!preg_match("/^\s*(toolbar|scrollbars|location|status|menubar|width|height|resizable)=\d{1,4}$/", $oneparam)) {
|
||||||
$errors[] = "Wrong link parameter: \"$oneparam\", should be one of 'toolbar, scrollbars, location, status, menubar, width, height or resizable'";
|
$page['errors'][] = "Wrong link parameter: \"$oneparam\", should be one of 'toolbar, scrollbars, location, status, menubar, width, height or resizable'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match("/^[0-9A-z]*$/", $params['cron_key']) == 0) {
|
if (preg_match("/^[0-9A-z]*$/", $params['cron_key']) == 0) {
|
||||||
$errors[] = getlocal("settings.wrong.cronkey");
|
$page['errors'][] = getlocal("settings.wrong.cronkey");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
// Update system settings
|
// Update system settings
|
||||||
foreach ($options as $opt) {
|
foreach ($options as $opt) {
|
||||||
Settings::set($opt,$params[$opt]);
|
Settings::set($opt,$params[$opt]);
|
||||||
|
@ -48,7 +48,7 @@ $page['last_cron_run'] = Settings::get('_last_cron_run');
|
|||||||
|
|
||||||
$page['show_invitations_info'] = (bool)Settings::get('enabletracking');
|
$page['show_invitations_info'] = (bool)Settings::get('enabletracking');
|
||||||
|
|
||||||
$errors = array();
|
$page['errors'] = array();
|
||||||
|
|
||||||
if (isset($_GET['startday'])) {
|
if (isset($_GET['startday'])) {
|
||||||
$startday = verifyparam("startday", "/^\d+$/");
|
$startday = verifyparam("startday", "/^\d+$/");
|
||||||
@ -83,7 +83,7 @@ $page = array_merge(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ($start > $end) {
|
if ($start > $end) {
|
||||||
$errors[] = getlocal("statistics.wrong.dates");
|
$page['errors'][] = getlocal("statistics.wrong.dates");
|
||||||
}
|
}
|
||||||
|
|
||||||
$activetab = 0;
|
$activetab = 0;
|
||||||
@ -178,7 +178,7 @@ if ($statisticstype == 'bydate') {
|
|||||||
);
|
);
|
||||||
$activetab = 2;
|
$activetab = 2;
|
||||||
}
|
}
|
||||||
$page['showresults'] = count($errors) == 0;
|
$page['showresults'] = count($page['errors']) == 0;
|
||||||
|
|
||||||
$page['title'] = getlocal("statistics.title");
|
$page['title'] = getlocal("statistics.title");
|
||||||
$page['menuid'] = "statistics";
|
$page['menuid'] = "statistics";
|
||||||
|
@ -137,12 +137,12 @@ if (!isset($messages[$target])) {
|
|||||||
}
|
}
|
||||||
$lang2 = $messages[$target];
|
$lang2 = $messages[$target];
|
||||||
|
|
||||||
$errors = array();
|
|
||||||
$page = array(
|
$page = array(
|
||||||
'lang1' => $source,
|
'lang1' => $source,
|
||||||
'lang2' => $target,
|
'lang2' => $target,
|
||||||
'title1' => isset($lang1["localeid"]) ? $lang1["localeid"] : $source,
|
'title1' => isset($lang1["localeid"]) ? $lang1["localeid"] : $source,
|
||||||
'title2' => isset($lang2["localeid"]) ? $lang2["localeid"] : $target
|
'title2' => isset($lang2["localeid"]) ? $lang2["localeid"] : $target,
|
||||||
|
'errors' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
$page_style = new PageStyle(PageStyle::currentStyle());
|
$page_style = new PageStyle(PageStyle::currentStyle());
|
||||||
@ -153,10 +153,10 @@ if ($stringid) {
|
|||||||
|
|
||||||
$translation = getparam('translation');
|
$translation = getparam('translation');
|
||||||
if (!$translation) {
|
if (!$translation) {
|
||||||
$errors[] = no_field("form.field.translation");
|
$page['errors'][] = no_field("form.field.translation");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($page['errors']) == 0) {
|
||||||
save_message($target, $stringid, $translation);
|
save_message($target, $stringid, $translation);
|
||||||
|
|
||||||
$page['saved'] = true;
|
$page['saved'] = true;
|
||||||
|
@ -28,13 +28,13 @@ force_password($operator);
|
|||||||
|
|
||||||
$default_extensions = array('mysql', 'gd', 'iconv');
|
$default_extensions = array('mysql', 'gd', 'iconv');
|
||||||
|
|
||||||
$errors = array();
|
|
||||||
$page = array(
|
$page = array(
|
||||||
'localizations' => get_available_locales(),
|
'localizations' => get_available_locales(),
|
||||||
'phpVersion' => phpversion(),
|
'phpVersion' => phpversion(),
|
||||||
'version' => MIBEW_VERSION,
|
'version' => MIBEW_VERSION,
|
||||||
'title' => getlocal("updates.title"),
|
'title' => getlocal("updates.title"),
|
||||||
'menuid' => "updates",
|
'menuid' => "updates",
|
||||||
|
'errors' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($default_extensions as $ext) {
|
foreach ($default_extensions as $ext) {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
require_once(dirname(__FILE__).'/inc_menu.php');
|
require_once(dirname(__FILE__).'/inc_menu.php');
|
||||||
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if( $page['opid'] ) { ?>
|
<?php if( $page['opid'] ) { ?>
|
||||||
|
@ -23,7 +23,7 @@ function tpl_header() { global $page;
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("page_agents.intro") ?>
|
<?php echo getlocal("page_agents.intro") ?>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
require_once(dirname(__FILE__).'/inc_menu.php');
|
require_once(dirname(__FILE__).'/inc_menu.php');
|
||||||
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("page_avatar.intro") ?>
|
<?php echo getlocal("page_avatar.intro") ?>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if( $page['saved'] ) { ?>
|
<?php if( $page['saved'] ) { ?>
|
||||||
|
@ -23,7 +23,7 @@ function tpl_header() { global $page;
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("page_ban.intro") ?>
|
<?php echo getlocal("page_ban.intro") ?>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
require_once(dirname(__FILE__).'/inc_menu.php');
|
require_once(dirname(__FILE__).'/inc_menu.php');
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("canned.descr") ?>
|
<?php echo getlocal("canned.descr") ?>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if( $page['saved'] ) { ?>
|
<?php if( $page['saved'] ) { ?>
|
||||||
|
@ -25,7 +25,7 @@ function tpl_header() { global $page;
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("page_settings.intro") ?>
|
<?php echo getlocal("page_settings.intro") ?>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
require_once(dirname(__FILE__).'/inc_menu.php');
|
require_once(dirname(__FILE__).'/inc_menu.php');
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("page.gen_button.intro") ?>
|
<?php echo getlocal("page.gen_button.intro") ?>
|
||||||
|
@ -25,7 +25,7 @@ function tpl_header() { global $page;
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if( $page['grid'] ) { ?>
|
<?php if( $page['grid'] ) { ?>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
require_once(dirname(__FILE__).'/inc_menu.php');
|
require_once(dirname(__FILE__).'/inc_menu.php');
|
||||||
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("page.groupmembers.intro") ?>
|
<?php echo getlocal("page.groupmembers.intro") ?>
|
||||||
|
@ -23,7 +23,7 @@ function tpl_header() { global $page;
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("page.groups.intro") ?>
|
<?php echo getlocal("page.groups.intro") ?>
|
||||||
|
@ -15,12 +15,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if( isset($errors) && count($errors) > 0 ) { ?>
|
if( isset($page['errors']) && count($page['errors']) > 0 ) { ?>
|
||||||
<div class="errinfo">
|
<div class="errinfo">
|
||||||
<img src='<?php echo MIBEW_WEB_ROOT ?>/styles/pages/default/images/icon_err.gif' width="40" height="40" border="0" alt="" class="left"/>
|
<img src='<?php echo MIBEW_WEB_ROOT ?>/styles/pages/default/images/icon_err.gif' width="40" height="40" border="0" alt="" class="left"/>
|
||||||
<?php
|
<?php
|
||||||
print getlocal("errors.header");
|
print getlocal("errors.header");
|
||||||
foreach( $errors as $e ) {
|
foreach( $page['errors'] as $e ) {
|
||||||
print getlocal("errors.prefix");
|
print getlocal("errors.prefix");
|
||||||
print $e;
|
print $e;
|
||||||
print getlocal("errors.suffix");
|
print getlocal("errors.suffix");
|
||||||
|
@ -22,7 +22,7 @@ function menuloc($id) {
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
function tpl_menu() { global $page, $errors, $current_locale;
|
function tpl_menu() { global $page, $current_locale;
|
||||||
?>
|
?>
|
||||||
<li>
|
<li>
|
||||||
<h2><b><?php echo getlocal("lang.choose") ?></b></h2>
|
<h2><b><?php echo getlocal("lang.choose") ?></b></h2>
|
||||||
|
@ -23,7 +23,7 @@ function menuli($name) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function tpl_menu() { global $page, $errors;
|
function tpl_menu() { global $page;
|
||||||
if(isset($page['isOnline']) && !$page['isOnline']) { ?>
|
if(isset($page['isOnline']) && !$page['isOnline']) { ?>
|
||||||
<li id="offwarn">
|
<li id="offwarn">
|
||||||
<img src="<?php echo MIBEW_WEB_ROOT ?>/styles/pages/default/images/dash/warn.gif" alt="" width="24" height="24"/>
|
<img src="<?php echo MIBEW_WEB_ROOT ?>/styles/pages/default/images/dash/warn.gif" alt="" width="24" height="24"/>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
@ -40,7 +40,7 @@ function tpl_header() { global $page;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
<?php echo getlocal("install.message") ?>
|
<?php echo getlocal("install.message") ?>
|
||||||
<br/>
|
<br/>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p>Copyright 2005-2013 the original author or authors.</p>
|
<p>Copyright 2005-2013 the original author or authors.</p>
|
||||||
|
@ -19,7 +19,7 @@ if(isset($page) && isset($page['localeLinks'])) {
|
|||||||
require_once(dirname(__FILE__).'/inc_locales.php');
|
require_once(dirname(__FILE__).'/inc_locales.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="loginintro">
|
<div id="loginintro">
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
require_once(dirname(__FILE__).'/inc_menu.php');
|
require_once(dirname(__FILE__).'/inc_menu.php');
|
||||||
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("operator.groups.intro") ?>
|
<?php echo getlocal("operator.groups.intro") ?>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
require_once(dirname(__FILE__).'/inc_menu.php');
|
require_once(dirname(__FILE__).'/inc_menu.php');
|
||||||
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("page_settings.intro") ?>
|
<?php echo getlocal("page_settings.intro") ?>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
require_once(dirname(__FILE__).'/inc_menu.php');
|
require_once(dirname(__FILE__).'/inc_menu.php');
|
||||||
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("permissions.intro") ?>
|
<?php echo getlocal("permissions.intro") ?>
|
||||||
|
@ -20,7 +20,7 @@ if(isset($page) && isset($page['localeLinks'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function tpl_content() {
|
function tpl_content() {
|
||||||
global $page, $errors;
|
global $page;
|
||||||
|
|
||||||
if($page['isdone']) {
|
if($page['isdone']) {
|
||||||
?>
|
?>
|
||||||
|
@ -20,7 +20,7 @@ if(isset($page) && isset($page['localeLinks'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function tpl_content() {
|
function tpl_content() {
|
||||||
global $page, $errors;
|
global $page;
|
||||||
|
|
||||||
if($page['isdone']) {
|
if($page['isdone']) {
|
||||||
?>
|
?>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
require_once(dirname(__FILE__).'/inc_menu.php');
|
require_once(dirname(__FILE__).'/inc_menu.php');
|
||||||
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal("page_settings.intro") ?>
|
<?php echo getlocal("page_settings.intro") ?>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
require_once(dirname(__FILE__).'/inc_tabbar.php');
|
||||||
require_once(dirname(__FILE__).'/inc_menu.php');
|
require_once(dirname(__FILE__).'/inc_menu.php');
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo getlocal2("statistics.description.full", array(date_to_text($page['last_cron_run']), $page['cron_path'])) ?>
|
<?php echo getlocal2("statistics.description.full", array(date_to_text($page['last_cron_run']), $page['cron_path'])) ?>
|
||||||
|
@ -40,7 +40,7 @@ function tpl_header() { global $page; ?>
|
|||||||
//--></script>
|
//--></script>
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
$chatthreadinfo = $page['thread_info'];
|
$chatthreadinfo = $page['thread_info'];
|
||||||
$chatthread = $page['thread_info']['thread'];
|
$chatthread = $page['thread_info']['thread'];
|
||||||
?>
|
?>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function tpl_content() { global $page, $errors;
|
function tpl_content() { global $page;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if( $page['saved'] ) { ?>
|
<?php if( $page['saved'] ) { ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user