Esempio n. 1
0
function EditLdapUser()
{
    $ldap = new clladp();
    $hash = $ldap->ReadDNInfos($_GET["EditLdapUser"]);
    $pages = new HtmlPages();
    $tpl = new templates();
    echo DIV_SHADOW($pages->PageUser($hash), 'windows');
}
Esempio n. 2
0
function USER_SENDER_PARAM($userid)
{
    $us = new user($userid);
    $page = CurrentPageName();
    writelogs("USER_ACCOUNT::{$userid}", __FUNCTION__, __FILE__, __LINE__);
    $ldap = new clladp();
    $userarr = $ldap->UserDatas($userid);
    $hash = $ldap->ReadDNInfos($userarr["dn"]);
    $hash["ou"] = $userarr["ou"];
    $ou = $hash["ou"];
    if (preg_match('#(.+?)@(.+)#', $hash["mail"], $reg)) {
        $domain = $reg[2];
        $email = $reg[1];
    }
    $priv = new usersMenus();
    $button = button("{submit}", "ParseForm('userLdapform2','{$page}',true);");
    $buttonSenderCanonical = button("{sender_canonical} {advanced_options}", "Loadjs('domains.edit.user.sender.php?uid={$userid}')");
    if ($priv->AllowAddUsers == false) {
        $button = null;
        $delete = null;
        $buttonSenderCanonical = null;
    }
    $styleTDLeft = "style='padding:5px;font-size:11px'";
    $main = new main_cf();
    if ($main->main_array["smtp_sender_dependent_authentication"] == "yes") {
        $sasl = new smtp_sasl_password_maps();
        preg_match('#(.+?):(.+)#', $sasl->smtp_sasl_password_hash[$hash["sendercanonical"]], $ath);
        $sasl = "\n\t\t<tr>\n\t\t\t<td colspan=2 style='font-size:12px;padding:4px;font-weight:bold;border-bottom:1px solid #CCCCCC'>{smtp_sender_dependent_authentication}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend {$styleTDRight}>{username}:</strong>\n\t\t\t<td {$styleTDLeft}>" . Field_text('smtp_sender_dependent_authentication_username', $ath[1]) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend {$styleTDRight}>{password}:</strong>\n\t\t\t<td {$styleTDLeft}>" . Field_password('smtp_sender_dependent_authentication_password', $ath[2]) . "</td>\n\t\t</tr>\t\t\n\t\t";
    }
    $enable_internet = "\n\t\t<form name='userLdapform3'>\n\t\t\t\t<input type='hidden' name='ou' value='{$ou}'>\n\t\t\t\t<input type='hidden' name='SaveAllowedSMTP' value='yes'>\n\t\t\t\t<input type='hidden' name='dn' value='{$hash["dn"]}'>\n\t\t\t\t<input type='hidden' name='mail' value='{$email}'>\n\t\t\t\t<input type='hidden' name='user_domain' value='{$domain}'>\n\t\t\t\t<input type='hidden' name='uid' value='{$userid}'>\t\n\t\t<table style='width:100%'>\t\n\t\t<tr>\n\t\t\t<td colspan=2 style='font-size:12px;padding:4px;font-weight:bold;border-bottom:1px solid #CCCCCC'>{AllowedSMTPTroughtInternet}<p class=caption>{AllowedSMTPTroughtInternet_text}</p></td>\n\t\t</tr>\t\t\t\t\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend {$styleTDRight}>{AllowedSMTPTroughtInternet}:</strong>\n\t\t\t<td {$styleTDLeft}>" . Field_numeric_checkbox_img('AllowedSMTPTroughtInternet', $us->AllowedSMTPTroughtInternet, '{AllowedSMTPTroughtInternet_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td colspan=2 align='right'>\n\t\t\t<input type='button' value='{apply}&nbsp;&raquo;' OnClick=\"javascript:ParseForm('userLdapform3','{$page}',true);\">\n\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t\t</form>\n\t\t\n\t\t";
    if ($priv->AllowAddUsers == false) {
        $enable_internet = null;
    }
    $html = "\n\t\t\n\t\t<form name='userLdapform2'>\n\t\t\t\t<input type='hidden' name='ou' value='{$ou}'>\n\t\t\t\t<input type='hidden' name='SaveLdapUser' value='yes'>\n\t\t\t\t<input type='hidden' name='dn' value='{$hash["dn"]}'>\n\t\t\t\t<input type='hidden' name='mail' value='{$email}'>\n\t\t\t\t<input type='hidden' name='user_domain' value='{$domain}'>\n\t\t\t\t<input type='hidden' name='uid' value='{$userid}'>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td colspan=2 style='font-size:12px;padding:4px;font-weight:bold;border-bottom:1px solid #CCCCCC'>{sender_canonical}</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend {$styleTDRight}>" . Field_text('SaveSenderCanonical', $hash["sendercanonical"], 'width:70%') . "</strong>\n\t\t\t<td {$styleTDLeft}>" . imgtootltip('ed_delete.gif', '{delete}', "DeleteSenderCanonical('{$_GET["userid"]}');") . "</td>\n\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t<td colspan=2 align='right'>{$buttonSenderCanonical}</td>\t\n\t\t</tr>\n\t\t{$sasl}\n\t\t<tr>\n\t\t<td colspan=2 align=right>{$button}</td>\n\t\t</tr>\t\t\n\t\t</table>\n\t\t</form>\n\t\t<br>\n\t\t{$enable_internet}\n\t\t\n\t\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function Main_page_user($userid)
{
    $ldap = new clladp();
    $userarr = $ldap->UserDatas($userid);
    $hash = $ldap->ReadDNInfos($userarr["dn"]);
    $hash["ou"] = $userarr["ou"];
    $eMailT = explode('@', $array['mail']);
    $domain = $eMailT[1];
    $email = $eMailT[0];
    $usermenus = new usersMenus();
    $page = CurrentPageName();
    if ($nobox == 0) {
        $leftimg = "<img src='img/folder-user.gif'>";
    }
    //MailboxActive
    $domains = $ldap->hash_get_domains_ou($hash["ou"]);
    if (is_array($domains)) {
        while (list($num, $ligne) = each($domains)) {
            $fDomains[$ligne] = $ligne;
        }
        $domainName = "<tr>\n\t\t\t\t\t<td align='right'><strong>{domainName}:</strong>\n\t\t\t\t\t<td>" . Field_array_Hash($fDomains, 'domainName', $hash["domainName"], null, null, 0, 'width:120px') . "</td>\n\t\t\t\t\t</tr>";
    }
    if ($usermenus->cyrus_imapd_installed == true) {
        $button_mailboxes = "<input type='button' value='{mailbox settings}&nbsp;&raquo;' OnClick=\"javascript:TreeUserMailBoxForm('{$userid}');\" style='margin-right:20px'>";
    }
    if ($hash["displayname"] == null) {
        $hash["displayname"] = "unknown";
    }
    $html = "\n\t<fieldset>\n\t\n\t\t<legend>{$hash["displayname"]}</legend>\n\t\t<table>\n\t\t\t<tr>\n\t\t\t<td valign='top'>\n\t\t\t\t\n\t\t\t\t<form name='userLdapform'>\n\t\t\t\t<input type='hidden' name='SaveLdapUser' value='yes'>\n\t\t\t\t<input type='hidden' name='dn' value='{$hash["dn"]}'>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'><strong>{ou}:</strong>\n\t\t\t\t\t<td>{$hash["ou"]}</td>\n\t\t\t\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'><strong>{firstname}:</strong>\n\t\t\t\t\t<td>" . Field_text('givenname', $hash["givenname"]) . "</td>\n\t\t\t\t\t</tr>\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'><strong>{lastname}:</strong>\n\t\t\t\t\t<td>" . Field_text('sn', $hash["sn"], 'width:98%', null, 'user_autofill();') . "</td>\n\t\t\t\t\t</tr>\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'><strong>{DisplayName}:</strong>\n\t\t\t\t\t<td>" . Field_text('displayname', $hash["displayname"]) . "</td>\n\t\t\t\t\t</tr>\t\n\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'><strong>{email}:</strong>\n\t\t\t\t\t<td>" . Field_text('mail', $hash["mail"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'><strong>{sender_canonical}:</strong>\n\t\t\t\t\t<td>" . Field_text('SenderCanonical', $hash["sendercanonical"]) . "</td>\n\t\t\t\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t{$domainName}\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'><strong>{userid}:</strong>\n\t\t\t\t\t<td>" . Field_text('uid', $hash["uid"]) . "</td>\n\t\t\t\t\t</tr>\t\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'><strong>{password}:</strong>\n\t\t\t\t\t<td>" . Field_password("userpassword", $hash["userpassword"]) . "</td>\n\t\t\t\t\t</tr>\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'><strong>{MailboxActive}:</strong>\n\t\t\t\t\t<td>" . Field_TRUEFALSE_checkbox_img('MailboxActive', $hash["mailboxactive"]) . "</td>\n\t\t\t\t\t</tr>\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\n\t\t\t\t\t<td align='right'  colspan=2 ><input type='button' value='{submit}&nbsp;&raquo;' OnClick=\"javascript:ParseForm('userLdapform','{$page}',true);\"></td>\n\t\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t</table>\n\t\t\t\t</form>\t\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t</fieldset>";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html);
}