function popup() { $page = CurrentPageName(); $tpl = new templates(); $userid = $_GET["uid"]; $mapi = new mapizarafa(); $mapi->Connect($userid, $user->password); $hash = $mapi->stores_size(); $total = $hash["Total"]; unset($hash["Total"]); $html[] = "<table style='width:99%' class=form>"; while (list($storename, $sizeMB) = each($hash)) { $html[] = "<tr>\n\t\t\t\t<td class=legend style='font-size:16px'>{$storename}</td>\n\t\t\t\t<td><strong style='font-size:16px'>{$sizeMB}</strong>\n\t\t\t\t</tr>\n\t\t\t\t"; } $html[] = "<tr>\n\t<td class=legend style='font-size:16px'>{total}:</td>\n\t<td><strong style='font-size:16px'>" . FormatBytes($total) . "</strong>\n\t</tr>\n\t"; $html[] = "</table>"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function inject_blacklists($uid) { $zarafa = new mapizarafa(); if (!$zarafa->Connect($uid)) { system_user_events($uid, $zarafa->error, __FUNCTION__, __FILE__, __LINE__, "contacts"); return; } $array = $zarafa->GetSendersFromFolder("Junk E-mail"); if (count($array) > 0) { inject_blacklists_tomysql($uid, $array); } }
function AJAX_USER_WARNING() { $f = array(); $userid = $_GET["userid"]; $page = CurrentPageName(); $users = new usersMenus(); $sock = new sockets(); $user = new user($userid); if ($users->PROXYTINY_APPLIANCE) { return; } if ($users->SQUID_APPLIANCE) { return; } if ($users->ZARAFA_INSTALLED) { if (isset($user->objectClass_array["zarafa-user"])) { include_once dirname(__FILE__) . "/ressources/class.mapi-zarafa.inc"; $mapi = new mapizarafa(); if (!$mapi->Connect($userid, $user->password)) { $f[] = "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=1% valign='top' style='vertical-align:top' style='vertical-align:top'><img src='img/warning-panneau-24.png'></td>\n\t\t\t\t\t\t<td style='font-size:13px;color:#D45D17'>\n\t\t\t\t\t\t\t<strong>{mailbox_error}</strong><br>\n\t\t\t\t\t\t\t<i style='font-size:9px;color:#D45D17'>{$mapi->error}</i>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t"; } else { $storesize = $mapi->storesize; $size = FormatBytes($storesize / 1024); $f[] = "\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td width=1% valign='top' style='vertical-align:top' style='vertical-align:top'><img src='img/info-24.png'></td>\n\t\t\t\t\t<td style='font-size:13px;color:#D45D17'>\n\t\t\t\t\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('domains.edit.user.zarafa.store.size.php?uid={$userid}')\"\n\t\t\t\t\t\tstyle='text-decoration:underline;font-weight:bold'>{mailbox_size}: {$size}</a>\n\t\t\t\t\t\t\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t"; } } } $uidNumber = $user->uidNumber; $ldap = new clladp(); $sr = @ldap_search($ldap->ldap_connection, $ldap->suffix, "(uidNumber={$uidNumber})", array('uid', 'dn')); if ($sr) { $hash = ldap_get_entries($ldap->ldap_connection, $sr); if ($hash["count"] > 0) { for ($i = 0; $i < $hash["count"]; $i++) { $uids[$hash[$i]["uid"][0]] = $hash[$i]["dn"]; } if (count($uids) > 1) { while (list($uid, $dn) = each($uids)) { $uiderr[] = "<li>{$uid} ({$dn})</li>"; } $f[] = "\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=1% valign='top' style='vertical-align:top' style='vertical-align:top'><img src='img/warning-panneau-24.png'></td>\n\t\t\t\t\t<td style='font-size:13px;color:#D45D17'>\n\t\t\t\t\t\t<strong>{duplicate_uidNumber}</strong><br>\n\t\t\t\t\t\t<i style='font-size:9px;color:#D45D17'>" . @implode("\n", $uiderr) . "</i>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=2 align='right'>\n\t\t\t\t\t" . button("{generate_new_uid} »»", "Loadjs('{$page}?generate-newuid-js&userid={$userid}')") . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t"; } } } if ($user->SAMBA_ENABLED) { if ($user->NotASambaUser) { $f[] = "\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=1% valign='top' style='vertical-align:top' style='vertical-align:top'><img src='img/warning-panneau-24.png'></td>\n\t\t\t\t\t<td style='font-size:13px;color:#D45D17'>\n\t\t\t\t\t\t<strong>{this_not_a_samba_user}</strong><br>\n\t\t\t\t\t\t<i style='font-size:9px;color:#D45D17'>{this_not_a_samba_user_explain}</i>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=2 align='right'>\n\t\t\t\t\t" . button("{activate} »»", "Loadjs('{$page}?enable-shared=yes&userid={$userid}')") . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t"; } $datas = base64_decode($sock->getFrameWork("samba.php?idof={$_GET["userid"]}")); if (preg_match("#No such user#", $datas)) { $f[] = "\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=1% valign='top' style='vertical-align:top' style='vertical-align:top'><img src='img/warning-panneau-24.png'></td>\n\t\t\t\t\t<td style='font-size:13px;color:#D45D17'>\n\t\t\t\t\t\t<strong>{id_no_such_user}</strong><br>\n\t\t\t\t\t\t<i style='font-size:10px;color:#D45D17'>{id_no_such_user_explain}</i>\n\t\t\t\t\t\t</td>\n\t\t\t\t</tr>"; } else { $len = strlen($datas); if ($len > 3) { $f[] = "<tr>\n\t\t\t\t\t\t<td width=1% valign='top' style='vertical-align:top' style='vertical-align:top'><img src='img/24-green.png'></td>\n\t\t\t\t\t\t<td style='font-size:13px;color:black'>\n\t\t\t\t\t\t<div><strong style='font-size:13px'>{operating_system_user_has}</strong><br></div>\n\t\t\t\t\t\t<i style='font-size:9px;color:#black'>{$datas}</i>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>"; } } } if ($users->ZARAFA_INSTALLED) { $ZarafaUserSafeMode = $sock->GET_INFO("ZarafaUserSafeMode"); if ($ZarafaUserSafeMode == 1) { $f[] = "\n\t\t\t<tr>\n\t\t\t\t<td width=1% valign='top' style='vertical-align:top' style='vertical-align:top'><img src='img/error-24.png'></td>\n\t\t\t\t<td style='font-size:13px;color:#D45D17'>\n\t\t\t\t\t<strong>{this_not_a_samba_user}</strong><br>\n\t\t\t\t\t<i style='font-size:10px;color:#D45D17'>{ZARAFA_SAFEMODE_EXPLAIN}</i>\n\t\t\t\t\t</td>\n\t\t\t</tr>"; } } if (count($f) > 0) { $tpl = new templates(); $html = "<div style='width:98%' class=form><table style='width:100%'><tbody>" . @implode("\n", $f) . "</tbody></table></form>"; echo $tpl->_ENGINE_parse_body($html); } }
function query() { if ($_GET["OnlyUsers"] == "yes") { $_GET["OnlyUsers"] = 1; } $users = new user(); $query = $_POST["query"]; if ($_POST["qtype"] == "groups") { query_group(); return; } $nogetent = false; $uid = $_GET["uid"]; $OnlyUsers = $_GET["OnlyUsers"]; $OnlyGroups = $_GET["OnlyGroups"]; $OnlyGUID = $_GET["OnlyGUID"]; $OnlyName = $_GET["OnlyName"]; $OnlyCheckAD = $_GET["OnlyCheckAD"]; $OnlyLDAP = $_GET["OnlyLDAP"]; $Zarafa = $_GET["Zarafa"]; if (!is_numeric($OnlyGUID)) { $OnlyGUID = 0; } if (!is_numeric($OnlyUsers)) { $OnlyUsers = 0; } if (!is_numeric($OnlyName)) { $OnlyName = 0; } if (!is_numeric($OnlyCheckAD)) { $OnlyCheckAD = 0; } if (!is_numeric($OnlyLDAP)) { $OnlyLDAP = 0; } if ($OnlyLDAP == 1) { $_GET["OnlyAD"] = 0; } $ObjectZarafa = false; if ($Zarafa == 1) { $nogetent = true; $ObjectZarafa = true; } $hash = array(); if (!isset($_GET["prepend"])) { $_GET["prepend"] = 0; } else { if ($_GET["prepend"] == 'yes') { $_GET["prepend"] = 1; } if ($_GET["prepend"] == 'no') { $_GET["prepend"] = 0; } } $WORKGROUP = null; $mapi = new mapizarafa(); if (!$mapi->list_folders($_GET["uid"], true)) { json_error_show($mapi->error, 1); } $hash = $mapi->Folders; $data = array(); $data['page'] = 1; $data['total'] = count($hash); $data['rows'] = array(); $c = 0; if ($GLOBALS["VERBOSE"]) { echo "query():: hash = " . count($hash) . " entries...<br\n"; } while (list($folder, $array) = each($hash)) { $ID = $array["ID"]; $type = $array["TYPE"]; $img = "icon_mailfolder.gif"; if ($type == "SYNC_FOLDER_TYPE_USER_APPOINTMENT") { $img = "icon_calendar.gif"; } if ($type == "SYNC_FOLDER_TYPE_USER_CONTACT") { $img = "icon_contact.gif"; } if ($_GET["callback"] != null) { $js = "{$_GET["callback"]}('{$folder}','{$ID}','{$uid}','{$type}')"; } $c++; if ($c > $_POST["rp"]) { break; } $data['rows'][] = array('id' => md5($folder), 'cell' => array("<img src='img/{$img}'>", "<span style='font-size:14px;font-weight:bolder'>{$folder}</span>", "<span style='font-size:14px'>" . imgsimple("arrow-right-24.png", "{add}", $js) . "</span>")); } $data['total'] = $c; echo json_encode($data); }