Beispiel #1
0
function _mail_baseGroupEdit($ldapArr, $postArr)
{
    if (!isset($ldapArr["cn"][0])) {
        return;
    }
    print "<div class=\"formblock\" style=\"background-color: #FFD;\">";
    print "<h3>" . _T("Mail plugin", "mail") . "</h3>\n";
    $mail = "";
    $maildomain = "";
    if (hasGroupMailObjectClass($ldapArr['cn'][0])) {
        $hasMail = "checked";
        if (isset($ldapArr["mail"])) {
            $mail = $ldapArr["mail"][0];
        }
        if (hasVDomainSupport()) {
            $tmparr = explode("@", $mail);
            $mail = $tmparr[0];
            $maildomain = $tmparr[1];
        }
    } else {
        $mail = computeMailGroupAlias($ldapArr['cn'][0]);
        $hasMail = "";
        if (hasVDomainSupport()) {
            $vdomains = getVDomains("");
            if (count($vdomains) == 1) {
                $maildomain = $vdomains[0][1]["virtualdomain"][0];
            }
        }
    }
    if ($hasMail == "" && $mail == "") {
        print _T("No mail alias can be set for this group", "mail");
    } else {
        print '<table cellspacing="0">';
        if (hasZarafaSupport()) {
            $trz = new TrFormElement(_T("Zarafa group", "mail"), new CheckboxTpl("zarafaGroup"));
            $trz->display(array("value" => isZarafaGroup($ldapArr['cn'][0]) ? "checked" : ""));
        }
        $test = new TrFormElement(_T("Enable mail alias for users of this group ", "mail"), new CheckboxTpl("mailgroupaccess"));
        $param = array("value" => $hasMail, "extraArg" => 'onclick="toggleVisibility(\'maildiv\');"');
        $test->display($param);
        print "</table>";
        if (!$hasMail) {
            $style = 'style =" display: none;"';
        }
        print '<div id="maildiv" ' . $style . '>';
        print '<table cellspacing="0">';
        if (!hasVDomainSupport()) {
            $m = new TrFormElement(_T("Mail alias", "mail"), new InputTpl("mailgroupalias"));
            $m->displayRo(array("value" => $mail));
        } else {
            print '<tr><td width="40%" style="text-align: right;">' . _T("Mail alias", "mail") . '</td><td>' . $mail . '<input  type="hidden" value="' . $mail . '" name="mailgroupalias">&nbsp;@&nbsp;';
            print '<input type="text" id="autocomplete" name="maildomain" value="' . $maildomain . '" /><div id="autocomplete_choices" class="autocomplete"></div>';
            print '<script type="text/javascript">new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "' . urlStrRedirect('mail/domains/ajaxMailDomainFilter') . '", {paramName: "value"});</script>';
            print '</td></tr>';
        }
        print "</table>";
        print "</div>";
    }
    print "</div>";
}
Beispiel #2
0
function uploadFormView()
{
    ?>

<style type="text/css">
.center {
    text-align: center;
}
.attributelist li {
	display: inline;
	float: left;
	padding: 3px;
	margin: 0px;
	list-style: none;
}
.attributelist ul {
    margin: 0px;
    padding: 0px;
}
</style>
<form id="bulkimport" enctype="multipart/form-data" method="post">
    <div class="formblock" style="background-color: #F4F4F4;">
        <input type="hidden" name="stage" value="preimport"/>
        <table cellspacing="0">
<?php 
    $test = new TrFormElement(_T("CSV file: ", "bulkimport"), new FileTpl("csvfile"));
    $test->display(null);
    ?>

        </table>
        <p class="center"><input name="next" type="submit" class="btnPrimary" value="<?php 
    echo _T("Load CSV", "bulkimport");
    ?>
" /></p>
        <table cellspacing="0">
            <tr>
                <td>
                    <p><strong><?php 
    echo _T("Description:", "bulkimport");
    ?>
</strong></p>
                    <?php 
    echo _T("You can import, modify and delete user accounts using a CSV file.", "bulkimport");
    ?>
                    <ol>
                        <li><?php 
    echo _T("If the users in the CSV file don't exist, you can import them.", "bulkimport");
    ?>
</li>
                        <li><?php 
    echo _T("If the users in the CSV file exist, you can modify them or delete them.", "bulkimport");
    ?>
</li>
                    </ol>
                    <strong><?php 
    echo _T("CSV Header requirements:", "bulkimport");
    ?>
</strong>
                    <ul>
                        <li><?php 
    echo _T("Required attribute:", "bulkimport");
    ?>
 "login"</li>
                        <li><?php 
    echo _T("Required for import:", "bulkimport");
    ?>
 "password", "firstname", "surname"</li>
                        <li><?php 
    echo _T("Additional headers can be set and must match the attribute name in LDAP, for example:", "bulkimport");
    ?>
 "login", "password", "firstname", "surname", "primaryGroup", "mail"</li>
                    </ul>
                    <strong><?php 
    echo _T("CSV Formatting:", "bulkimport");
    ?>
</strong>
                    <ul>
                        <li><?php 
    echo _T("Delimiter:", "bulkimport");
    ?>
 ,</li>
                        <li><?php 
    echo _T("Wrapper:", "bulkimport");
    ?>
 &quot;</li>
                        <li><?php 
    echo _T("Escape character:", "bulkimport");
    ?>
 \</li>
                    </ul>
                    <strong><?php 
    echo _T("Special attributes", "bulkimport");
    ?>
</strong> ('yes' <?php 
    echo _T("or", "bulkimport");
    ?>
 'no')<strong>:</strong>
                    <ul>
                        <li>createhomedir ('yes' <?php 
    echo _T("by default", "bulkimport");
    ?>
)</li>
                        <li>files ('yes' <?php 
    echo _T("by default for delete operation, users home directory will be removed.", "bulkimport");
    ?>
)</li>
                    </ul>
                    <strong><?php 
    echo _T("Defaults:", "bulkimport");
    ?>
</strong>
                    <ul>
                        <li>homedir (<?php 
    echo _T("the default home directory path", "bulkimport");
    ?>
)</li>
                        <li>primaryGroup (<?php 
    echo _T("the default primary group", "bulkimport");
    ?>
)</li>
                    </ul>
                    <strong><?php 
    echo _T("Supported attributes:", "bulkimport");
    ?>
</strong>
                    <ul class="attributelist">
                    <?php 
    foreach (importusers::getValidAttributes() as $attribute) {
        echo "<li>" . $attribute . "</li>";
    }
    ?>
                    </ul>
                </td>
            </tr>
        </table>
    </div>
</form>

<?php 
}
Beispiel #3
0
}
?>

<form name="groupform" method="post" onsubmit="return validateForm();">
<table cellspacing="0">

<?php 
if ($_GET["action"] == "add") {
    $formElt = new InputTpl("groupname", "/^[a-zA-Z][0-9_a-zA-Z-]*\$/");
} else {
    $formElt = new HiddenTpl("groupname");
}
$tr = new TrFormElement(_("Group name"), $formElt);
$tr->display(array("value" => $groupname, "required" => True));
$tr = new TrFormElement(_("Description"), new InputTpl("groupdesc"));
$tr->display(array("value" => $groupdesc));
?>

</table>

<?php 
callPluginFunction("baseGroupEdit", array($detailArr, $_POST));
?>

<?php 
if ($_GET["action"] == "add") {
    ?>
<input name="badd" type="submit" class="btnPrimary" value="<?php 
    echo _("Create");
    ?>
" />
Beispiel #4
0
    <td>
        <?php 
echo _T("Permissions");
?>
    </td>
    </tr>
        <?php 
if ($permAll) {
    $checked = "checked";
} else {
    $checked = "";
}
$param = array("value" => $checked, "extraArg" => 'onclick="toggleVisibility(\'grouptable\');"');
$test = new TrFormElement(_T("Access for all"), new CheckboxTpl("permAll"));
$test->setCssError("permAll");
$test->display($param);
?>
</table>

<?php 
if ($permAll) {
    echo '<div id="grouptable" style="display:none">';
} else {
    echo '<div id="grouptable">';
}
?>
<table>
<?php 
if ($_GET["action"] == "add") {
    $acls = array(array(), array());
} else {
Beispiel #5
0
if ($permAll) {
    echo 'style="display:none"';
}
?>
>
    <tr>
        <td class="label" style="text-align: right;">Permissions</td>
        <td>
            <div id="samba-perms" ng-app="mmc.samba.perms" ng-controller="permsCtrl">
                <perms perms="perms" entities="entities" />
            </div>
        </td>
    <tr>
<?php 
$recursive = new TrFormElement(_T("Apply rights recursively"), new CheckboxTpl("recursive"));
$recursive->display(array("value" => "checked"));
?>
</table>

<div id="expertMode" class="expertMode" <?php 
displayExpertCss();
?>
>
<table cellspacing="0">
    <tr>
    <td>
    </td>
    <td>
        <?php 
echo _T("Administrator groups for this share");
?>
Beispiel #6
0
</table>
</div>

<div id="expertMode" class="expertMode" <?php 
displayExpertCss();
?>
>
<table cellspacing="0">
    <tr>
    <td>
    </td>
    <td>
    <?php 
$share = new TrFormElement(_T("Path"), new InputTpl("sharePath"));
$params = array("value" => $sharePath);
$share->display($params);
?>
    </td>
   </tr>
    
    <tr>
    <td>
    </td>
    <td>
        <?php 
echo _T("Users for this share");
?>
    </td>
   </tr>

<?php 
Beispiel #7
0
</table>
</div>

<div id="expertMode" class="expertMode" <?php 
displayExpertCss();
?>
>
<table cellspacing="0">
    <tr>
    <td>
    </td>
    <td>
    <?php 
$share_details = new TrFormElement(_T("Path", "samba4"), new InputTpl("sharePath"));
$params = array("value" => $sharePath);
$share_details->display($params);
?>
    </td>
   </tr>

    <tr>
    <td>
    </td>
    <td>
        <?php 
echo _T("Users for this share", "samba4");
?>
    </td>
   </tr>

<?php