예제 #1
0
function WhiteListSender()
{
    $sql = "SELECT mail_from,mail_to from messages WHERE zMD5=\"{$_GET["id"]}\"";
    $result = QUERY_SQL($sql);
    $ligne = @sqlite3_fetch_array(QUERY_SQL($sql));
    $mail_from = $ligne["mail_from"];
    if ($mail_from == null) {
        SinglePage(ParseLogs("ERROR\n"));
        exit;
    }
    $ldap = new clladp();
    $upd["KasperkyASDatasAllow"] = $mail_from;
    $uid = $ldap->uid_from_email($ligne["mail_to"]);
    if ($uid == null) {
        SinglePage(ParseLogs("ERROR\n"));
        exit;
    }
    $hash = $ldap->UserDatas($uid);
    $dn = $hash["dn"];
    if (!$ldap->Ldap_add_mod($dn, $upd)) {
        $error = $ldap->ldap_last_error . "\n";
    }
    $sock = new sockets();
    $error = $error . $sock->getfile('releaseallmailfrommd5:' . $_GET["id"]);
    SinglePage(ParseLogs($error));
}
예제 #2
0
function find_member()
{
    $tofind = $_GET["find-member"];
    if ($_SESSION["uid"] == -100) {
        $ou = $_GET["ou"];
    } else {
        $ou = $_SESSION["ou"];
    }
    $ldap = new clladp();
    if (is_base64_encoded($ou)) {
        $ou = base64_decode($ou);
    }
    if ($tofind == null) {
        $tofind = '*';
    } else {
        $tofind = "*{$tofind}*";
    }
    $tofind = str_replace('***', '*', $tofind);
    writelogs("FIND {$tofind} IN OU \"{$ou}\"", __FUNCTION__, __FILE__, __LINE__);
    $filter = "(&(objectClass=userAccount)(|(cn={$tofind})(mail={$tofind})(displayName={$tofind})(uid={$tofind}) (givenname={$tofind}) ))";
    $attrs = array("displayName", "uid", "mail", "givenname", "telephoneNumber", "title", "sn", "mozillaSecondEmail", "employeeNumber");
    $dn = "ou={$ou},dc=organizations,{$ldap->suffix}";
    $hash = $ldap->Ldap_search($dn, $filter, $attrs, 20);
    $users = new user();
    $number = $hash["count"];
    for ($i = 0; $i < $number; $i++) {
        $user = $hash[$i];
        $html = $html . formatUser($user);
    }
    return $html;
}
예제 #3
0
function SaveCyrusPassword()
{
    $ldap = new clladp();
    $_POST["SaveCyrusPassword"] = url_decode_special_tool(trim($_POST["SaveCyrusPassword"]));
    if ($_POST["SaveCyrusPassword"] == null) {
        echo "Error: No password defined\n";
        return;
    }
    if (strpos($_POST["SaveCyrusPassword"], '@') > 0) {
        echo "@,: denied character\n";
        return;
    }
    if (strpos($_POST["SaveCyrusPassword"], ':') > 0) {
        echo "@,: denied character\n";
        return;
    }
    $attrs["userPassword"][0] = $_POST["SaveCyrusPassword"];
    $dn = "cn=cyrus,dc=organizations,{$ldap->suffix}";
    if ($ldap->ExistsDN($dn)) {
        if (!$ldap->Ldap_modify($dn, $attrs)) {
            echo $ldap->ldap_last_error;
            return;
        }
    }
    $dn = "cn=cyrus,{$ldap->suffix}";
    if ($ldap->ExistsDN($dn)) {
        if (!$ldap->Ldap_modify($dn, $attrs)) {
            echo $ldap->ldap_last_error;
            return;
        }
    }
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?cyrus-change-password="******"SaveCyrusPassword"]));
}
예제 #4
0
function changecomputername()
{
    if (substr($_POST["userid"], strlen($_POST["userid"]) - 1, 1) != "\$") {
        $_POST["userid"] = $_POST["userid"] . "\$";
    }
    $comp = new computers($_POST["userid"]);
    $MAC = $comp->ComputerMacAddress;
    $_POST["NewHostname"] = trim(strtolower($_POST["NewHostname"]));
    $_POST["NewHostname"] = str_replace('$', '', $_POST["NewHostname"]);
    $actualdn = $comp->dn;
    $newrdn = "cn={$_POST["NewHostname"]}\$";
    $ldap = new clladp();
    if (!preg_match("#^cn=(.+?),[a-zA-Z\\s]+#", $actualdn, $re)) {
        echo "Unable to preg_match {$actualdn}\n";
        return;
    }
    $newDN = str_replace($re[1], $_POST["NewHostname"] . '$', $actualdn);
    if ($newDN == null) {
        echo "Unable to preg_match {$actualdn} -> {$re[1]}\n";
        return;
    }
    if (!$ldap->Ldap_rename_dn($newrdn, $actualdn, null)) {
        echo "Rename failed {$ldap->ldap_last_error}\nFunction:" . __FUNCTION__ . "\nFile:" . __FILE__ . "\nLine" . __LINE__ . "\nExpected DN:{$newDN}";
        return;
    }
    $upd["uid"][0] = $_POST["NewHostname"] . '$';
    if (!$ldap->Ldap_modify($newDN, $upd)) {
        echo "Update UID {$upd["uid"][0]} failed:\n{$ldap->ldap_last_error}\nFunction:" . __FUNCTION__ . "\nFile:" . __FILE__ . "\nLine" . __LINE__ . "\nExpected DN:{$newDN}\nExpected value:{$_POST["NewHostname"]}";
        return;
    }
    $ocs = new ocs($MAC);
    $ocs->ComputerName = $_POST["NewHostname"];
    $ocs->ComputerIP = $comp->ComputerIP;
    $ocs->EditComputer();
}
예제 #5
0
function save()
{
    $email = $_GET["postmaster"];
    $ldap = new clladp();
    $users = new usersMenus();
    $mustcheck = false;
    if ($users->cyrus_imapd_installed) {
        $mustcheck = true;
    }
    if ($users->ZARAFA_INSTALLED) {
        $mustcheck = true;
    }
    if ($mustcheck) {
        $ldap = new clladp();
        $uid = $ldap->uid_from_email($email);
        if ($uid == null) {
            $tpl = new templates();
            echo $tpl->javascript_parse_text("\n{$email}\n{mailbox_does_not_exists}");
            return;
        }
    }
    $sock = new sockets();
    $sock->SET_INFO("PostfixPostmaster", $email);
    $sock->getFrameWork("cmd.php?postfix-hash-aliases=yes");
    $sock->getFrameWork("cmd.php?postmaster-cron=yes");
}
예제 #6
0
function search_user()
{
    header("Pragma: no-cache");
    header("Expires: 0");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-cache, must-revalidate");
    $stringtofind = $_GET["search_user"];
    $tpl = new templates();
    $usermenu = new usersMenus();
    $ldap = new clladp();
    if ($usermenu->AsAnAdministratorGeneric == true) {
        $hash_full = $ldap->UserSearch(null, $stringtofind);
    } else {
        $us = $ldap->UserDatas($_SESSION["uid"]);
        $hash_full = $ldap->UserSearch($us["ou"], $stringtofind);
    }
    $html = "<table style='width:100%'>";
    for ($i = 0; $i < $hash_full[0]["count"]; $i++) {
        $displayname = $hash_full[0][$i]["displayname"][0];
        $mail = $hash_full[0][$i]["mail"][0];
        if (strlen($mail) > 27) {
            $mail = substr($mail, 0, 24) . '...';
        }
        $uid = $hash_full[0][$i]["uid"][0];
        $js = "RestoreMbxSelectedUser('{$uid}');";
        $html = $html . "<tr " . CellRollOver($js) . ">\n\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t<td><code nowrap>{$displayname}</code></td>\n\t\t\t<td><code>{$mail}</code></td>\n\t\t</tr>\n\t\t\t\n\t\t";
    }
    $html = $html . "</table>";
    echo $html;
}
예제 #7
0
function formulaire()
{
    $users = new usersMenus();
    $ldap = new clladp();
    $tpl = new templates();
    $page = CurrentPageName();
    if ($users->AsAnAdministratorGeneric) {
        $hash = $ldap->hash_get_ou(false);
    } else {
        $hash = $ldap->Hash_Get_ou_from_users($_SESSION["uid"], 1);
    }
    if (count($hash) == 1) {
        $org = $hash[0];
        $hash_groups = $ldap->hash_groups($org, 1);
        $hash_domains = $ldap->hash_get_domains_ou($org);
        $groups = Field_array_Hash($hash_groups, 'groupid');
        $domains = Field_array_Hash($hash_domains, 'domain');
    }
    $artica = new artica_general();
    $EnableVirtualDomainsInMailBoxes = $artica->EnableVirtualDomainsInMailBoxes;
    while (list($num, $ligne) = each($hash)) {
        $ous[$ligne] = $ligne;
    }
    $ou = Field_array_Hash($ous, 'organization', null, "ChangeFormValues()");
    $form = "\n\t\n\t<input type='hidden' id='EnableVirtualDomainsInMailBoxes' value='{$EnableVirtualDomainsInMailBoxes}'>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend>{organization}:</td>\n\t\t\t<td>{$ou}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{group}:</td>\n\t\t\t<td><span id='select_groups'>{$groups}</span>\n\t\t</tr>\n\t\t<tr>\n\t\t<tr>\n\t\t\t<td class=legend>{firstname}:</td>\n\t\t\t<td>" . Field_text('firstname', null, 'width:120px', null, 'ChangeFormValues()') . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td class=legend>{lastname}:</td>\n\t\t\t<td>" . Field_text('lastname', null, 'width:120px', null, "ChangeFormValues()") . "</td>\n\t\t</tr>\t\t\n\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend>{email}:</td>\n\t\t\t<td>" . Field_text('email', null, 'width:120px', null, "ChangeFormValues()") . "@<span id='select_domain'>{$domains}</span></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{login}:</td>\n\t\t\t<td>" . Field_text('login', null, 'width:120px') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{password}:</td>\n\t\t\t<td>" . Field_password('password') . "</td>\n\t\t</tr>\t\n\t\t<tr><td colspan=2><hr></td></tr>\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'>\n\t\t\t\t<input type='button' OnClick=\"javascript:SaveAddUser();\" value='{add}&nbsp;&raquo;'>\n\t\t\t</td>\n\t\t</tr>\n\t\t\n\t\t</table>\n\t";
    $form = RoundedLightWhite($form);
    $html = "<h1>{add_user}</H1>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' width=1%><div id='ffform'><img src='img/identity-add-96.png'></div></td>\n\t\t<td valign='top'>{$form}</div></td>\n\t</tr>\n\t</table>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
예제 #8
0
function ROUNDCUBE($database, $ou)
{
    $ldap = new clladp();
    $users = $ldap->hash_users_ou($ou);
    if (!is_array($users)) {
        return;
    }
    reset($users);
    while (list($uid, $displayname) = each($users)) {
        if ($uid == null) {
            continue;
        }
        echo "Starting......: Groupware Checking roundcube {$database}:: {$uid} - {$displayname}\n";
        $id = ROUNDCUBE_GetidFromUser($database, $uid);
        $u = new user($uid);
        if ($id == 0) {
            ROUNDCUBE_CreateRoundCubeUser($database, $uid, $u->mail, '127.0.0.1');
            $id = ROUNDCUBE_GetidFromUser($database, $uid);
        }
        if ($id == 0) {
            continue;
        }
        $identity_id = ROUNDCUBE_GetidentityFromuser_id($database, $id);
        if ($identity_id == 0) {
            ROUNDCUBE_CreateRoundCubeIdentity($database, $id, $displayname, $u->mail, $ou);
            $identity_id = ROUNDCUBE_GetidentityFromuser_id($database, $id);
        }
        if ($identity_id == 0) {
            continue;
        }
        $count = $count + 1;
        ROUNDCUBE_UpdateRoundCubeIdentity($bd, $identity_id, $u->mail);
    }
}
function export_to_zarafa($uid)
{
    $f[] = "First Name,Middle Name,Last Name,Title,Suffix,Initials,Web Page,Gender,Birthday,Anniversary,Location,Language,Internet Free Busy,Notes,E-mail Address,E-mail 2 Address,E-mail 3 Address,Primary Phone,Home Phone,Home Phone 2,Mobile Phone,Pager,Home Fax,Home Address,Home Street,Home Street 2,Home Street 3,Home Address PO Box,Home City,Home State,Home Postal Code,Home Country,Spouse,Children,Manager's Name,Assistant's Name,Referred By,Company Main Phone,Business Phone,Business Phone 2,Business Fax,Assistant's Phone,Company,Job Title,Department,Office Location,Organizational ID Number,Profession,Account,Business Address,Business Street,Business Street 2,Business Street 3,Business Address PO Box,Business City,Business State,Business Postal Code,Business Country,Other Phone,Other Fax,Other Address,Other Street,Other Street 2,Other Street 3,Other Address PO Box,Other City,Other State,Other Postal Code,Other Country,Callback,Car Phone,ISDN,Radio Phone,TTY/TDD Phone,Telex,User 1,User 2,User 3,User 4,Keywords,Mileage,Hobby,Billing Information,Directory Server,Sensitivity,Priority,Private,Categories";
    $ldap = new clladp();
    $ct = new user($uid);
    $dn = "ou={$uid},ou=People,dc={$ct->ou},dc=NAB,{$ldap->suffix}";
    $filter = "(objectClass=inetOrgPerson)";
    $attrs = array();
    $hash = $ldap->Ldap_search($dn, $filter, array("employeeNumber"));
    if ($GLOBALS["VERBOSE"]) {
        echo "[{$uid}]: Exporting {$hash["count"]} user(s)\n";
    }
    for ($i = 0; $i < $hash["count"]; $i++) {
        $emp = new contacts(null, $hash[$i]["employeenumber"][0]);
        $f[] = @implode(",", $emp->ContactTocsvArray());
    }
    $tmpfile = "/tmp/{$uid}." . time() . ".csv";
    @file_put_contents("{$tmpfile}", @implode("\n", $f));
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    $basename = basename($tmpfile);
    $cmd = $php . " " . dirname(__FILE__) . "/exec.zarafa.csv2contacts.php {$uid} \"{$ct->password}\" {$basename} 2>&1";
    if ($GLOBALS["VERBOSE"]) {
        echo "[{$uid}]: {$cmd}\n";
    }
    exec($cmd, $results);
    if ($GLOBALS["VERBOSE"]) {
        while (list($num, $line) = each($results)) {
            echo "[{$uid}]: {$line}\n";
        }
    }
}
예제 #10
0
function save()
{
    $email = $_GET["luser_relay"];
    $ldap = new clladp();
    $users = new usersMenus();
    $mustcheck = false;
    if ($users->cyrus_imapd_installed) {
        $mustcheck = true;
    }
    if ($users->ZARAFA_INSTALLED) {
        $mustcheck = true;
    }
    if (preg_match("#^@(.+)#", $email, $re)) {
        $mustcheck = false;
        $email = null;
    }
    if ($mustcheck) {
        $ldap = new clladp();
        $uid = $ldap->uid_from_email($email);
        if ($uid == null) {
            $tpl = new templates();
            echo $tpl->javascript_parse_text("\n{$email}\n{mailbox_does_not_exists}");
            return;
        }
    }
    $sock = new sockets();
    $sock->SET_INFO("luser_relay", $email);
    $sock->getFrameWork("cmd.php?postfix-luser-relay=yes");
}
function FindComputerByIP()
{
    if ($_GET["SelectDansGuardianExceptionipList"] == '*') {
        $_GET["SelectDansGuardianExceptionipList"] = null;
    }
    if ($_GET["SelectDansGuardianExceptionipList"] == null) {
        $tofind = "*";
    } else {
        $tofind = "{$_GET["SelectDansGuardianExceptionipList"]}*";
    }
    $filter_search = "(&(objectClass=ArticaComputerInfos)(|(cn={$tofind})(ComputerIP={$tofind})(uid={$tofind}))(gecos=computer))";
    writelogs($filter_search, __FUNCTION__, __FILE__, __LINE__);
    $ldap = new clladp();
    $attrs = array("uid", "ComputerIP", "ComputerOS", "ComputerMachineType");
    $dn = "{$ldap->suffix}";
    $hash = $ldap->Ldap_search($dn, $filter_search, $attrs, 10);
    $html = "<table style='width:250px' class=table_form>";
    for ($i = 0; $i < $hash["count"]; $i++) {
        $realuid = $hash[$i]["uid"][0];
        $hash[$i]["uid"][0] = str_replace('$', '', $hash[$i]["uid"][0]);
        $ip = $hash[$i][strtolower("ComputerIP")][0];
        if (trim($ip) == null) {
            continue;
        }
        $js = "AddDansGuardianExceptionipList('{$ip}');";
        $html = $html . "<tr " . CellRollOver($js, "{add}") . ">\n\t\t<td width=1%><img src='img/base.gif'></td>\n\t\t<td nowrap><strong>{$hash[$i]["uid"][0]}</strong></td>\n\t\t<td ><strong>{$ip}</strong></td>\n\t</tr>\n\t";
    }
    $html = $html . "</table>";
    $html = "<center><div style='height:300px;overflow:auto'>{$html}</div></center>";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html);
}
예제 #12
0
function BuildDHCP()
{
    $ldap = new clladp();
    if ($ldap->ldapFailed) {
        echo "Starting......: DHCP SERVER ldap connection failed,aborting\n";
        return;
    }
    if (!$ldap->ExistsDN("dc=organizations,{$ldap->suffix}")) {
        echo "Starting......: DHCP SERVER dc=organizations,{$ldap->suffix} no such branch, aborting\n";
        return;
    }
    echo "Starting......: DHCP SERVER ldap connection success\n";
    $dhcpd = new dhcpd();
    $conf = $dhcpd->BuildConf();
    $confpath = dhcp3Config();
    $unix = new unix();
    @mkdir(dirname($confpath), null, true);
    @file_put_contents($confpath, $conf);
    echo "Starting......: DHCP SERVER saving \"{$confpath}\" (" . strlen($conf) . " bytes) done\n";
    if (is_dir("/var/lib/dhcp3")) {
        shell_exec("/bin/chown -R dhcpd:dhcpd /var/lib/dhcp3");
        shell_exec("/bin/chmod 755 /var/lib/dhcp3");
    }
    $complain = $unix->find_program("aa-complain");
    if (is_file($complain)) {
        $dhcpd3 = $unix->find_program("dhcpd3");
        if (is_file($dhcpd3)) {
            shell_exec("{$complain} {$dhcpd3} >/dev/null 2>&1");
        }
    }
}
function start_parse()
{
    if ($GLOBALS["VERBOSE"]) {
        "echo Loading...\n";
    }
    $unix = new unix();
    if ($GLOBALS["VERBOSE"]) {
        "echo Loading done...\n";
    }
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $timefile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    $pid = @file_get_contents($pidfile);
    if (!$GLOBALS["FORCE"]) {
        if ($pid < 100) {
            $pid = null;
        }
        $unix = new unix();
        if ($unix->process_exists($pid, basename(__FILE__))) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Already executed pid {$pid}\n";
            }
            return;
        }
        $timeexec = $unix->file_time_min($timefile);
        if ($timeexec < 10) {
            return;
        }
        $mypid = getmypid();
        @file_put_contents($pidfile, $mypid);
    }
    @unlink($timefile);
    @file_put_contents($timefile, time());
    $ldap = new clladp();
    if (!$ldap->IsKerbAuth()) {
        return;
    }
    $q = new mysql_squid_builder();
    $sql = "SELECT ID,GroupName FROM webfilters_sqgroups WHERE `enabled`=1 AND `GroupType`='proxy_auth_statad'";
    $results = $q->QUERY_SQL($sql);
    $REFRESH = false;
    $Count = mysql_num_rows($results);
    $UPDATED = array();
    while ($ligne = mysql_fetch_assoc($results)) {
        if (parse_object($ligne["ID"], $ligne["GroupName"])) {
            $UPDATED[] = $ligne["GroupName"];
            $REFRESH = true;
        }
    }
    if ($REFRESH) {
        squid_admin_mysql(1, "Reloading proxy service after updating " . count($UPDATED) . " Active Directory group(s)", @implode("\n", $UPDATED), __FILE__, __LINE__);
        $squid = $unix->LOCATE_SQUID_BIN();
        system("/etc/init.d/squid reload --force --script=exec.squid.static.ad.groups.php/" . __LINE__);
        $sock = new sockets();
        $EnableTransparent27 = intval($sock->GET_INFO("EnableTransparent27"));
        if ($EnableTransparent27 == 1) {
            system("/etc/init.d/squid-nat reload --script=" . basename(__FILE__));
        }
    }
}
예제 #14
0
function SingleGroup()
{
    $ldap = new clladp();
    $gid = $ldap->ArticaDefaultGroupGid();
    $page = "\n{$select_group}\n<script type=\"text/javascript\" language=\"javascript\" src=\"js/users.kav.php.js\"></script>\n<div id='rightInfos'></div>\n<script>LoadKavTab(0,'{$gid}');</script>";
    $tpl = new template_users('{antivirus_settings}', $page);
    echo $tpl->web_page;
}
function ORGANISTATION_FROM_USER()
{
    $ldap = new clladp();
    $hash = $ldap->Hash_Get_ou_from_users($_SESSION["uid"], 1);
    if (is_array($hash)) {
        return $hash[0];
    }
}
예제 #16
0
function popup_list()
{
    $ou = base64_decode($_GET["ou"]);
    $tpl = new templates();
    $gpid = $_GET["gpid"];
    if ($_POST["query"] != null) {
        $tofind = $_POST["query"];
    }
    $groups = new groups($gpid);
    $group_members = $groups->members_array;
    $ldap = new clladp();
    if ($tofind == null) {
        $tofind = '*';
    } else {
        $tofind = "*{$tofind}*";
    }
    $tofind = str_replace("**", "*", $tofind);
    $filter = "(&(objectClass=userAccount)(|(cn={$tofind})(mail={$tofind})(displayName={$tofind})(uid={$tofind}) (givenname={$tofind})))";
    $attrs = array("displayName", "uid", "mail", "givenname", "telephoneNumber", "title", "sn", "mozillaSecondEmail", "employeeNumber");
    $dn = "ou={$ou},dc=organizations,{$ldap->suffix}";
    $hash = $ldap->Ldap_search($dn, $filter, $attrs, 150);
    if (strlen(trim($ldap->ldap_last_error)) > 5) {
        json_error_show("Error:" . $ldap->ldap_last_error);
    }
    $number = $hash["count"];
    $data = array();
    $data['page'] = 1;
    $data['total'] = $number;
    $data['rows'] = array();
    $c = 0;
    for ($i = 0; $i < $number; $i++) {
        $exist = false;
        $userARR = $hash[$i];
        $uid = $userARR["uid"][0];
        if ($uid == null) {
            continue;
        }
        $md = md5($uid);
        $c++;
        if ($uid == "squidinternalauth") {
            continue;
        }
        if ($group_members[$uid]) {
            $exist = true;
        }
        $js = "add_already_member_add('" . base64_encode($uid) . "','{$md}');";
        $mail = texttooltip($userARR["mail"][0], "{add}:{$uid}", $js, null, 0, "font-size:13px");
        $color = "black";
        $add = imgsimple("arrow-right-24.png", "{add}:{$uid}", $js);
        if ($exist) {
            $add = "&nbsp;";
            $color = "#8a8a8a";
        }
        $data['rows'][] = array('id' => "uidS{$md}", 'cell' => array("<span style='font-size:14px;color:{$color}'>{$uid}</span>", "<span style='font-size:14px;color:{$color}'>{$mail}</span>", "<span style='font-size:14px;color:{$color}'>{$add}</span>"));
    }
    echo json_encode($data);
}
예제 #17
0
function popup_list()
{
    $ou = base64_decode($_GET["ou"]);
    $gpid = $_GET["gpid"];
    $tofind = $_GET["search"];
    $groups = new groups($gpid);
    $group_members = $groups->members_array;
    $ldap = new clladp();
    if ($tofind == null) {
        $tofind = '*';
    } else {
        $tofind = "*{$tofind}*";
    }
    $filter = "(&(objectClass=userAccount)(|(cn={$tofind})(mail={$tofind})(displayName={$tofind})(uid={$tofind}) (givenname={$tofind})))";
    $attrs = array("displayName", "uid", "mail", "givenname", "telephoneNumber", "title", "sn", "mozillaSecondEmail", "employeeNumber");
    $dn = "ou={$ou},dc=organizations,{$ldap->suffix}";
    $hash = $ldap->Ldap_search($dn, $filter, $attrs, 150);
    if (strlen($ldap->ldap_last_error) != 5) {
        $error = "<H2>{$ldap->ldap_last_error}</H2>";
    }
    $number = $hash["count"];
    $html = "{$error}\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t<th width=1%>" . imgtootltip("refresh-24.png", "{refresh}", "add_already_member_list_refresh()") . "</th>\n\t<th colspan=3>{members}:{$ou}</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
    $classtr = null;
    for ($i = 0; $i < $number; $i++) {
        $userARR = $hash[$i];
        $exist = false;
        $uid = $userARR["uid"][0];
        if ($uid == "squidinternalauth") {
            continue;
        }
        if ($group_members[$uid]) {
            $exist = true;
        }
        $js = "add_already_member_add('" . base64_encode($uid) . "');";
        $sn = texttooltip($userARR["sn"][0], "{add}:{$uid}", $js, null, 0, "font-size:13px");
        $givenname = texttooltip($userARR["givenname"][0], "{add}:{$uid}", $js, null, 0, "font-size:13px");
        $title = texttooltip($userARR["title"][0], "{add}:{$uid}", $js, null, 0, "font-size:13px");
        $mail = texttooltip($userARR["mail"][0], "{add}:{$uid}", $js, null, 0, "font-size:13px");
        $telephonenumber = texttooltip($userARR["telephonenumber"][0], "{add}:{$uid}", $js, null, 0, "font-size:13px");
        $color = "black";
        $add = imgtootltip("32-plus.png", "{add}:{$uid}", $js);
        if ($exist) {
            $add = "&nbsp;";
            $color = "#CCCCCC";
        }
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        $html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t<td width=1%><img src='img/contact-32.png'></td>\n\t\t\t<td style='font-size:14px;color:{$color}'>{$uid}</td>\n\t\t\t<td style='font-size:14px;color:{$color}'>{$mail}</td>\n\t\t\t<td style='font-size:14px;color:{$color}'>{$add}</td>\n\t\t\t\n\t\t</tr>\n\t\t";
    }
    $html = $html . "</table>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
예제 #18
0
function SaveSettings()
{
    $ou = $_GET["ou"];
    $upd["ArticaFakedMailFrom"][0] = $_GET["ArticaFakedMailFrom"];
    $upd["ArticaDenyNoMXRecords"][0] = $_GET["ArticaDenyNoMXRecords"];
    $upd["OuTrustMyUSers"][0] = $_GET["OuTrustMyUSers"];
    $ldap = new clladp();
    $dn = "ou={$ou},dc=organizations,{$ldap->suffix}";
    $ldap->Ldap_modify($dn, $upd);
}
예제 #19
0
function SyncOrg($ou)
{
    $ldap = new clladp();
    $hash = $ldap->UserSearch($ou, "");
    for ($i = 0; $i < $hash["count"]; $i++) {
        $uid = $hash[$i]["uid"][0];
        write_syslog("Checking {$uid}", __FILE__);
        $obm = new obm_user($uid);
    }
}
예제 #20
0
function INDEX()
{
    $ldap = new clladp();
    $hash = $ldap->UserDatas($_SESSION["uid"]);
    $mail = $hash["mail"];
    $Graph = InsertChart('js/charts.swf', "js/charts_library", "listener.graphs.php?weekMessagesPerDay={$mail}", 250, 250, "FFFFFF", true, $usermenus->ChartLicence);
    $html = $Graph;
    $JS["JS"][] = "js/user.quarantine.js";
    $tpl = new template_users('{messages_performance}', $html, 0, 0, 0, 0, $JS);
    echo $tpl->web_page;
}
예제 #21
0
function export($ou, $path)
{
    @file_put_contents($pidfile, getmypid());
    //if(strlen($GLOBALS["USER_QUERY"])>0){$filter="(uid={$GLOBALS["USER_QUERY"]})";}
    $ldap = new clladp();
    $pattern = "(&(objectclass=userAccount){$filter})";
    $attr = array();
    $sr = @ldap_search($ldap->ldap_connection, "ou={$ou},dc=organizations,{$ldap->suffix}", $pattern, $attr);
    $hash = ldap_get_entries($ldap->ldap_connection, $sr);
    $unix = new unix();
    $gzip = $unix->find_program("gzip");
    $users_array = array();
    if (is_array($hash)) {
        for ($i = 0; $i < $hash["count"]; $i++) {
            $usersArray[] = $hash[$i]["uid"][0];
        }
    }
    if (is_array($usersArray)) {
        while (list($index, $uid) = each($usersArray)) {
            echo "Parsing {$uid}\n";
            $u = new user($uid);
            $array_user = array();
            foreach ($u as $key => $value) {
                $array_user[$key] = $value;
            }
            $array_users_final[] = $array_user;
            unset($array_user);
        }
    }
    $groups = $ldap->hash_groups($ou, 1);
    while (list($num, $line) = each($groups)) {
        echo "Parsing group {$num} {$line}\n";
        $u = new groups($num);
        $array_group = array();
        foreach ($u as $key => $value) {
            $array_group[$key] = $value;
        }
        $array_group_final[] = $array_group;
        unset($array_group);
    }
    $array_final["USERS"] = $array_users_final;
    $array_final["GROUPS"] = $array_group_final;
    $tempfile = $unix->FILE_TEMP();
    $datas = base64_encode(serialize($array_final));
    @file_put_contents($tempfile, $datas);
    if (is_dir($path)) {
        compress($tempfile, $path . "/{$ou}.gz");
        echo "Saved in " . $path . "/{$ou}.gz\n";
        @chmod($path . "/{$ou}.gz", 0755);
    } else {
        echo $path . " no such directory...\n";
    }
    @unlink($tempfile);
}
예제 #22
0
function browse_domains_list()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $ldap = new clladp();
    $users = new usersMenus();
    $search = $_GET["search"];
    $search = "*{$search}*";
    $search = str_replace("***", "*", $search);
    $search = str_replace("**", "*", $search);
    $search_sql = str_replace("*", "%", $search);
    $search_sql = str_replace("%%", "%", $search_sql);
    $search_regex = str_replace(".", "\\.", $search);
    $search_regex = str_replace("*", ".*?", $search);
    if ($users->AsSystemAdministrator) {
        $q = new mysql();
        $sql = "SELECT domain FROM officials_domains WHERE domain LIKE '{$search_sql}' ORDER BY domain";
        writelogs("{$sql}", __FUNCTION__, __FILE__, __LINE__);
        $results = $q->QUERY_SQL($sql, "artica_backup");
        if (!$q->ok) {
            echo "<H2>{$q->mysql_error}</H2>";
        }
        while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
            $domains[$ligne["domain"]] = $ligne["domain"];
        }
        $hash = $ldap->hash_get_all_domains();
        while (list($num, $ligne) = each($hash)) {
            if (preg_match("#{$search_regex}#", $ligne)) {
                $domains[$ligne] = $ligne;
            }
        }
    } else {
        $hash = $ldap->hash_get_domains_ou($_SESSION["ou"]);
        while (list($num, $ligne) = each($hash)) {
            if (preg_match("#{$search_regex}#", $ligne)) {
                $domains[$ligne] = $ligne;
            }
        }
    }
    ksort($domains);
    $html = "\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t\t<th width=1%>{$add}</th>\n\t\t<th colspan=2>{domains}&nbsp;|&nbsp;{$search_regex}&nbsp;|&nbsp;{$search_sql}</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
    while (list($num, $ligne) = each($domains)) {
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        $select = imgtootltip("plus-24.png", "{select}", "SelectBrowseDomains('{$ligne}')");
        $html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t<td width=1%><img src='img/domain-32.png'></td>\n\t\t\t<td style='font-size:14px;font-weight:bold'>{$ligne}</td>\n\t\t\t<td width=1%>{$select}</td>\n\t\t</tr>\n\t\t";
    }
    $html = $html . "</table>\n\t<script>\n\t\t\n\t\tfunction SelectBrowseDomains(domain){\n\t\t\tdocument.getElementById('{$_GET["field"]}').value=domain\n\t\t\tYahooSetupControlHide();\n\t\t}\n\n\t</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $ldap = new clladp();
    $t = time();
    $ImportAdSettings = unserialize($sock->GET_INFO("ZarafaImportADSettings"));
    $OUS = $ldap->hash_get_ou(true);
    $html = "\n\t<div style='font-size:30px;margin-bottom:20px'>{active_directory_importation}</div>\n\t<div style='font-size:22px' class=explain>{active_directory_importation_contacts_explain}</div>\n\t\n\t\n\t\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{organization}:</td>\n\t\t<td>" . Field_array_Hash($OUS, "ADOU", $ImportAdSettings["ADOU"], "style:font-size:22px;") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{activedirectory_server}:</td>\n\t\t<td>" . Field_text("ADSERVERNAME", $ImportAdSettings["ADSERVERNAME"], "font-size:22px;padding:3px;width:250px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{suffix}:</td>\n\t\t<td>" . Field_text("LDAP_SUFFIX", $ImportAdSettings["LDAP_SUFFIX"], "font-size:22px;padding:3px;width:580px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{username}:</td>\n\t\t<td>" . Field_text("WINDOWS_SERVER_ADMIN", $ImportAdSettings["WINDOWS_SERVER_ADMIN"], "font-size:22px;padding:3px;width:390px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{password}:</td>\n\t\t<td>" . Field_password("WINDOWS_SERVER_PASS", $ImportAdSettings["WINDOWS_SERVER_PASS"], "font-size:22px;padding:3px;width:390px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t\n\t<tr style='height:70px'>\n\t\t<td colspan=3 align='right'>" . button("{import_contacts}", "Save{$t}()", 30) . "</td>\n\t</tR>\n\t\n\t</table>\n\t</div>\n\t<script>\n\t\t\n\t\t\n\nvar xSave{$t}=function(obj){\n\tvar tempvalue=obj.responseText;\n    if(tempvalue.length>5){alert(tempvalue);}\n    Loadjs('zarafa.import-ad-contacts.progress.php');\n}\t\n\t\t\nfunction Save{$t}(){\n\tvar pp=encodeURIComponent(document.getElementById('WINDOWS_SERVER_PASS').value);\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ADOU',document.getElementById('ADOU').value);\n\tXHR.appendData('ADSERVERNAME',document.getElementById('ADSERVERNAME').value);\n\tXHR.appendData('WINDOWS_SERVER_ADMIN',document.getElementById('WINDOWS_SERVER_ADMIN').value);\n\tXHR.appendData('LDAP_SUFFIX',encodeURIComponent(document.getElementById('LDAP_SUFFIX').value));\n\t\n\tXHR.appendData('WINDOWS_SERVER_PASS',pp);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
예제 #24
0
function UserEmptyQuarantine()
{
    $ldap = new clladp();
    include_once 'ressources/class.mysql.inc';
    $hash = $ldap->UserDatas($_SESSION["uid"]);
    $mail = $hash["mail"];
    $sql = "UPDATE `messages` SET `Deleted` = '1' WHERE mail_to LIKE '%{$mail}%' AND `filter_action`='quarantine' AND Deleted='0'";
    QUERY_SQL($sql);
    include_once 'ressources/class.sockets.inc';
    $sock = new sockets();
    $sock->getfile('quarantine_delete_all:' . $_SESSION["uid"]);
}
예제 #25
0
function INDEX()
{
    $ldap = new clladp();
    $hash = $ldap->UserDatas($_SESSION["uid"]);
    $mail = $hash["mail"];
    $Graph = InsertChart('js/charts.swf', "js/charts_library", "listener.graphs.php?weekMessagesPerDay={$mail}", 600, 250, "FFFFFF", true, $usermenus->ChartLicence);
    $Graph1 = InsertChart('js/charts.swf', "js/charts_library", "listener.graphs.php?QuarMessagesPerDay={$mail}", 600, 250, "FFFFFF", true, $usermenus->ChartLicence);
    $html = "\n<H4>{graph_week_receive}</H4>\n{$Graph}\n<H4>{graph_week_quarantine}</H4>\n{$Graph1}\n<H4>{quarantine_domains}</h4>\n" . BigDomainsReceive($mail);
    $JS["JS"][] = "js/user.quarantine.js";
    $tpl = new template_users('{messages_performance}', $html, 0, 0, 0, 0, $JS);
    echo $tpl->web_page;
}
예제 #26
0
function Confirm()
{
    $ldap = new clladp();
    $dn = base64_decode($_GET["dn"]);
    if ($dn == null) {
        echo "DN IS NULL";
        return;
    }
    if (!$ldap->ldap_delete(base64_decode($_GET["dn"]))) {
        echo $ldap->ldap_last_error;
    }
}
예제 #27
0
function sync($ou){
	
if(!Build_pid_func(__FILE__,__FUNCTION__)){
	writelogs(basename(__FILE__).":Already executed.. aborting the process",basename(__FILE__),__FILE__,__LINE__);
	return;
}
$unix=new unix();	
$imapsync=$unix->find_program("imapsync");


	if(!is_file($unix->find_program("imapsync"))){
		writelogs("Unable to stat imapsync",__FUNCTION__,__FILE__,__LINE__);
		send_email_events("Could not migrate from cyrus to zarafa","Unable to stat imapsync tool,aborting","mailbox");
		return;
	}
	
	$ou=base64_decode($ou);
	
	
	$ldap=new clladp();
	$members=$ldap->hash_users_ou($ou);
	writelogs("Loading $ou organization ".count($members)." members imapsync=$imapsync",__FUNCTION__,__FILE__,__LINE__);
	send_email_events("migration from cyrus to zarafa starting","Cyrus to zarafa starting (". count($members)." members)","mailbox");
	

	while (list ($uid, $name) = each ($members) ){
		if($uid==null){continue;}
		$user=new user($uid);
		send_email_events("migration from cyrus to zarafa starting","Cyrus to zarafa starting (". count($members)." members)","mailbox");
		$cmdline="$imapsync  --noauthmd5  --subscribe --host1 127.0.0.1 --port1 1143";
		$cmdline=$cmdline." --user1 $uid --password1 $user->password --delete --expunge1";
		$cmdline=$cmdline." --sep2 / --prefix2 \"\" --host2 127.0.0.1 --user2 $uid --password2 $user->password >/root/imapsync.$uid 2>&1";
		writelogs("$cmdline",__FUNCTION__,__FILE__,__LINE__);
		shell_exec($cmdline);
		$datas=@file_get_contents("/root/imapsync.$uid");
		if($GLOBALS["VERBOSE"]){
			echo "$datas";
		}
		if(strlen($datas)>0){
			send_email_events("$uid migration status",@file_get_contents("/root/imapsync.$uid"),"mailbox");
		}
		@unlink("/root/imapsync.$uid");
		
		
	}
	
	
	
	
	
	
}
예제 #28
0
function build_single_instance($ip)
{
    $sql = "SELECT `value`,`ou` FROM postfix_multi WHERE `key`='myhostname' AND `ip_address`='{$ip}'";
    $q = new mysql();
    $unix = new unix();
    $ldap = new clladp();
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    $ou = $ligne["ou"];
    $hostname = $ligne["value"];
    $main = new maincf_multi($hostname, $ou);
    echo "Starting......: dkimproxy {$hostname}\n";
    $freeport = $main->GET("dkimproxy_listenport");
    $array = unserialize(base64_decode($main->GET_BIGDATA("dkimproxy_datas")));
    $unix = new unix();
    $key = "/etc/dkimproxy/{$hostname}/private.key";
    @mkdir("/etc/dkimproxy/{$hostname}", 640, true);
    if (!is_file($key)) {
        echo "Starting......: dkimproxy {$hostname} generating public and private key\n";
        $openssl = $unix->find_program("openssl");
        @mkdir("/etc/dkimproxy/{$hostname}", 640, true);
        shell_exec("{$openssl} genrsa -out /etc/dkimproxy/{$hostname}/private.key 1024");
        shell_exec("{$openssl} rsa -in /etc/dkimproxy/{$hostname}/private.key -pubout -out /etc/dkimproxy/{$hostname}/public.key");
    }
    if ($hostname == "master") {
        $domains = $ldap->AllDomains();
    } else {
        $domains = $ldap->hash_get_domains_ou($ou);
    }
    while (list($dom, $nil) = each($domains)) {
        $dd[] = $dom;
    }
    $conf[] = "# specify what address/port DKIMproxy should listen on";
    $conf[] = "listen    {$ip}:{$freeport}";
    $conf[] = "# specify what address/port DKIMproxy forwards mail to";
    $conf[] = "relay     {$ip}:33560";
    $conf[] = "# specify what domains DKIMproxy can sign for (comma-separated, no spaces)";
    $conf[] = "domain    " . @implode(",", $dd);
    $conf[] = "# specify what signatures to add";
    $conf[] = "signature dkim(c=relaxed)";
    $conf[] = "signature domainkeys(c=nofws)";
    $conf[] = "# specify location of the private key";
    $conf[] = "keyfile   /etc/dkimproxy/{$hostname}/private.key";
    $conf[] = "# specify the selector (i.e. the name of the key record put in DNS)";
    $conf[] = "selector  {$array["selector_name"]}";
    $conf[] = "min_servers 5";
    $conf[] = "min_spare_servers 2";
    $conf[] = "";
    echo "Starting......: dkimproxy {$hostname} generating {$hostname}.conf " . count($dd) . " domain(s)\n";
    @file_put_contents("/etc/dkimproxy/{$hostname}.conf", @implode("\n", $conf));
}
예제 #29
0
function WhiteListed()
{
    $ldap = new clladp();
    $unix = new unix();
    $SPAMASSASSIN_LOCAL_CF = $unix->SPAMASSASSIN_LOCAL_CF();
    $spammassDirectory = dirname($SPAMASSASSIN_LOCAL_CF);
    $assp = array();
    $spamassassin = array();
    $miltergrey = array();
    $blacks = $ldap->BlackListFromDomain();
    if (is_array($blacks)) {
        while (list($to, $array) = each($blacks)) {
            $spamassassin[] = "#rcpt :{$to}";
            while (list($index, $from) = each($array)) {
                if ($from == "*@*") {
                    continue;
                }
                if (preg_match("#(.+?)@(.+)#", $from, $re)) {
                    $first_part = $re[1];
                    $domain = $re[2];
                } else {
                    $first_part = "*";
                    $domain = $from;
                }
                $domain = str_replace("@", "", $domain);
                $spamassassin[] = "blacklist_from\t{$first_part}@{$domain}";
            }
        }
    }
    echo "Starting......: " . date("H:i:s") . " writing whitelist/blacklists for ASSP\n";
    @mkdir("/usr/share/assp/files");
    @mkdir("/usr/local/etc");
    @file_put_contents("/usr/share/assp/files/whiteorg.txt", implode("\n", $assp));
    echo "Starting......: " . date("H:i:s") . " writing whitelist/blacklists for Amavis\n";
    $final = implode("\n", $sender_scores_sitewide);
    $final = $final . "\n";
    @file_put_contents("/usr/local/etc/sender_scores_sitewide", $final);
    @chmod("/usr/local/etc/sender_scores_sitewide", 0644);
    @chown("/usr/local/etc/sender_scores_sitewide", "postfix");
    if (is_file('/usr/local/sbin/amavisd')) {
        if (is_file('/usr/local/etc/amavisd.conf')) {
            if (is_file('/var/spool/postfix/var/run/amavisd-new/amavisd-new.pid')) {
                sys_THREAD_COMMAND_SET('/usr/local/sbin/amavisd -c /usr/local/etc/amavisd.conf -P /var/spool/postfix/var/run/amavisd-new/amavisd-new.pid reload');
            }
        }
    }
    echo "Starting......: " . date("H:i:s") . " writing whitelist/blacklists for spamassassin\n";
    @file_put_contents("{$spammassDirectory}/wbl.cf", implode("\n", $spamassassin));
}
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $ldap = new clladp();
    $u = new user($_GET["userid"]);
    $oldorg = $u->ou;
    $ous = $ldap->hash_get_ou(true);
    unset($ous[$u->ou]);
    $ous[null] = "{select}";
    $success = $tpl->javascript_parse_text("{success}");
    $field = Field_array_Hash($ous, "nextou", null, "style:font-size:16px;padding:3px");
    $html = "\n\t<div class=explain id='useranimateddiv'>{change_user_organization_text}</div>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<td class=legend>{organization}:</td>\n\t\t<td>{$field}</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align=right><hr>" . button("{move}", "MoveUserToOu()") . "</td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\tfunction MoveUserToOu(){\n\t\tvar XHR = new XHRConnection();\n\t\tAnimateDiv('useranimateddiv');\n\t    XHR.appendData('nextou',document.getElementById('nextou').value);\n\t    XHR.appendData('ou','{$u->ou}');\n\t    XHR.appendData('userid','{$_GET["userid"]}');\n\t    XHR.sendAndLoad('{$page}', 'POST',x_MoveUserToOu); \n\t\n\t}\n\n\t\n\tvar x_MoveUserToOu= function (obj) {\n\t\tvar ou=document.getElementById('nextou').value;\n\t\tvar results=trim(obj.responseText);\n\t\tif(results.length>2){alert('<'+results+'>');user_changeorg_load();return;}\n\t\tYahooUserHide();\n\t\tYahooWin4Hide();\n\t\tif(document.getElementById('org_main')){RefreshTab('org_main');}\n\t\talert('{$success} {$_GET["userid"]} -> '+ou);\n\t}\n</script>\t\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}