function items() { //ini_set('html_errors',0);ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string','');ini_set('error_append_string',''); $tpl = new templates(); $MyPage = CurrentPageName(); $sock = new sockets(); $tSource = $_GET["t"]; $privilege = true; if (GetRights_aliases() == 0) { $privilege = false; } $search = ''; if (isset($_POST["sortname"])) { if ($_POST["sortname"] != null) { $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}"; } } if (isset($_POST['page'])) { $page = $_POST['page']; } if ($_POST["query"] != null) { $_POST["query"] = string_to_regex($_POST["query"]); } if (isset($_POST['rp'])) { $rp = $_POST['rp']; } $pageStart = ($page - 1) * $rp; $limitSql = "LIMIT {$pageStart}, {$rp}"; $data = array(); $data['page'] = $page; $data['total'] = 0; $data['rows'] = array(); $user = new user($_GET["userid"]); $aliases = $user->aliases; $c = 0; while (list($num, $ligne) = each($aliases)) { if ($_POST["query"] != null) { if (!preg_match("#{$_POST["query"]}#i", $ligne)) { continue; } } $c++; $logs = null; $id = md5($ligne); //Loadjs('$page?delete-aliases=yes&mail=$ligne&uid=$userid') $delete = imgsimple('delete-32.png', '{delete aliase}', "ItemDelete{$tSource}('{$ligne}','{$id}')"); $test = imgsimple('test-message-32.png', null, "Loadjs('postfix.sendtest.mail.php?rcpt={$ligne}')"); if (!$privilege) { $delete = null; } $data['rows'][] = array('id' => "{$id}", 'cell' => array("<code style='font-size:22px;font-weight:bold'>{$ligne}</code>", $test, $delete)); $data['total'] = $c; } if ($c == 0) { json_error_show("no alias"); } echo json_encode($data); }
<?php include_once 'ressources/class.templates.inc'; include_once 'ressources/class.ldap.inc'; include_once 'ressources/class.users.menus.inc'; include_once 'ressources/class.user.inc'; include_once 'ressources/class.cyrus.inc'; if (isset($_GET["uid"]) && !isset($_GET["userid"])) { $_GET["userid"] = $_GET["uid"]; } if (!GetRights_aliases()) { $tpl = new templates(); echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . "');"; die; exit; } if (isset($_GET["popup"])) { popup(); exit; } if (isset($_GET["size_of_message"])) { EMPTY_MBX(); exit; } js(); function js() { $page = CurrentPageName(); $tpl = new templates(); $title = $tpl->_ENGINE_parse_body("{empty_this_mailbox}"); $confirm_mailbox_deletetion = $tpl->javascript_parse_text("{confirm_mailbox_deletetion}");
function USER_ALIASES($userid) { if ($userid == null) { $userid = $_GET["userid"]; } if ($_GET["aliases-section"] == 'mailing_list') { return USER_ALIASES_MAILING_LIST($userid); } $user = new user($userid); if ($user->DoesNotExists) { return USER_NOTEXISTS($userid); } $tpl = new templates(); $t = time(); $html = "\n\t<div id='{$t}'></div>\n\t<script>\n\t\tLoadAjax('{$t}','domains.edit.user.aliases.php?userid={$userid}');\n\t</script>\n\t\n\t"; echo $tpl->_ENGINE_parse_body($html); return; $ldap = new clladp(); $user = new user($userid); $tpl = new templates(); $page = CurrentPageName(); $aliases = $user->aliases; $boutton = button("{add_new_alias}", "Loadjs('{$page}?USER_ALIASES_FORM_ADD_JS={$userid}');"); $no_priv = $tpl->javascript_parse_text("{ERROR_NO_PRIVS}"); $boutton_off = button("{add_new_alias}", "alert('{$no_priv}');"); $privilege = true; if (GetRights_aliases() == 0) { $privilege = false; } if (!$privilege) { $boutton = $boutton_off; } if (is_array($aliases)) { while (list($num, $ligne) = each($aliases)) { $delete = imgtootltip('x.gif', '{delete aliase}', "Loadjs('{$page}?delete-aliases=yes&mail={$ligne}&uid={$userid}')"); if (!$privilege) { $delete = null; } $ali = $ali . "<tr " . CellRollOver() . ">\n \t\t<td width=1%><img src='img/mailbox.png'></td>\n \t\t<td style='padding:3px;font-size:14px;font-weight:bolder;color:#005447' width=91% nowrap align='left'>{$ligne}</td>\n \t\t<td style='padding:3px;' width=1%>" . imgtootltip('test-mail-22.png', '{send_a_test_mail_text}', "Loadjs('postfix.sendtest.mail.php?rcpt={$ligne}')") . "</td>\n \t\t\n \t\t<td style='padding:3px;' width=1%>{$delete}</td>\n \t\t</tr>\n \t\t"; } $ali = $ali . "<tr><td colspan=3><hr></td></tr>"; } $title = "\n \t<table style='width:100%'>\n \t\t<tr>\n \t\t<td valign='top' style='vertical-align:top' style='vertical-align:top' width=80%>\n \t\t\t<h1>{aliases}: «{$user->uid}»</h1>\n \t\t</td>\n \t\t\t<td valign='top' style='vertical-align:top' style='vertical-align:top'>{$boutton}</td>\n \t\t</tr>\n \t</table>"; $aliases_list = "\n \t<div style='width:99%;height:250px;overflow:auto' id='ali'>\n\t\t\t<table style='width:100%'>\n\t\t \t</tr>\n\t\t\t\t\t{$ali}\n\t\t\t\t<tr>\n\t \t</table>\n \t</div>"; if (isset($_GET["aliases-users-list"])) { echo $tpl->_ENGINE_parse_body($aliases_list); exit; } $html = "\n \t\n \t{$title}\n \t<div class=text-info>{aliases_text}: «<b>{$user->mail}»</b></div>\n \t<table style='width:100%'>\n \t<tr>\n \t\t<td valign='top' style='vertical-align:top' style='vertical-align:top' width=1%><br><img src='img/96-bg_addresses.png' style='margin-right:30px'></td>\n \t\t<td valign='top' style='vertical-align:top' style='vertical-align:top' width=98%><div id='aliases_list'>{$aliases_list}</div></td>\n \t\t\n \t</tr>\n \t</table>"; return $tpl->_ENGINE_parse_body($html); }
include_once 'ressources/class.pure-ftpd.inc'; include_once 'ressources/class.user.inc'; include_once 'ressources/charts.php'; include_once 'ressources/class.mimedefang.inc'; include_once 'ressources/class.computers.inc'; include_once 'ressources/class.ini.inc'; include_once 'ressources/class.ocs.inc'; include_once dirname(__FILE__) . "/ressources/class.cyrus.inc"; if (!isset($_GET["uid"]) && isset($_POST["uid"])) { $_GET["uid"] = $_POST["uid"]; } if (isset($_GET["uid"]) && !isset($_GET["userid"])) { $_GET["userid"] = $_GET["uid"]; } $usersprivs = new usersMenus(); $change_aliases = GetRights_aliases(); $modify_user = 1; if ($_SESSION["uid"] != $_GET["userid"]) { $modify_user = 0; } if (isset($_GET["js"])) { js(); exit; } if (isset($_GET["apply-js"])) { apply_js(); exit; } if (isset($_POST["MailBoxMaxSize"])) { Save(); exit;
include_once 'ressources/class.templates.inc'; include_once 'ressources/class.ldap.inc'; include_once 'ressources/class.users.menus.inc'; include_once 'ressources/class.user.inc'; include_once 'ressources/class.ini.inc'; include_once 'ressources/class.computers.inc'; if (isset($_REQUEST["uid"])) { $_GET["uid"] = $_REQUEST["uid"]; $_GET["userid"] = $_REQUEST["uid"]; } if (isset($_REQUEST["userid"])) { $_GET["uid"] = $_REQUEST["userid"]; $_GET["userid"] = $_REQUEST["userid"]; } //permissions $GetRights_aliases = GetRights_aliases(); if ($GetRights_aliases == 0) { $tpl = new templates(); $error = "{ERROR_NO_PRIVS}<br>GetRights_aliases={$GetRights_aliases}<br>" . @implode("<br>", $GLOBALS["ERRORS_PRIVS"]); echo $tpl->_ENGINE_parse_body("{$error}"); die; } $modify_user = 1; if (isset($_GET["group-list"])) { groups_list(); exit; } if (isset($_POST["DeleteUserGroup"])) { DeleteUserFromGroup(); exit; }