Exemplo n.º 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>";
}
Exemplo n.º 2
0
function addQuerySection($Form, $p)
{
    /* ================= BEGIN QUERY ===================== */
    $span = new SpanElement(_T("Query", "pkgs"), "pkgs-title");
    $Form->add(new TrFormElement("", $span), array());
    $check = '';
    $style = 'display:none';
    if ($p['associateinventory'] == 1) {
        $check = 'checked';
        $style = '';
    }
    $Form->add(new TrFormElement(_T('Associate inventory', 'pkgs'), new CheckboxTpl('associateinventory')), array("value" => $check));
    $Qfields = getQFields();
    addQuery($Form, array('Qvendor', _T('Vendor', 'pkgs')), $p, $Qfields['Qvendor'], 3, '', $style);
    addQuery($Form, array('Qsoftware', _T('Software', 'pkgs')), $p, $Qfields['Qsoftware'], 3, 'Qvendor', $style);
    addQuery($Form, array('Qversion', _T('Version', 'pkgs')), $p, $Qfields['Qversion'], 2, 'Qsoftware', $style);
    $Bool = new TrFormElement(_T('Bool', 'pkgs'), new InputTpl('boolcnd'));
    $Bool->setStyle("display:none");
    $Form->add($Bool, array("value" => $p['boolcnd']));
    /* ================= END QUERY ===================== */
    /* =================   BEGIN LICENSE   ===================== */
    $Form->add(new TrFormElement(_T('Number of licenses', 'pkgs'), new InputTpl('licenses'), array('class' => 'associateinventory', 'style' => $style)), array("value" => $p['licenses']));
    /* ==================   END LICENSE   ====================== */
}
Exemplo n.º 3
0
    $f->add($tr, array("value" => $zones[0][0]));
}
$f->add(new TrFormElement(_T("Source IP(s)"), new InputTpl("src_ip"), array("tooltip" => _T("Allow connection from IP(s) address(es) (separate IPs with ',')."))), array("value" => ""));
$zones = getZonesInterfaces($dst);
if (count($zones) > 1) {
    $destinations = array();
    $destinationsVals = array();
    foreach ($zones as $zone) {
        $destinations[] = sprintf("%s (%s)", $zone[0], $zone[1]);
        $destinationsVals[] = $zone[0];
    }
    $destinationsTpl = new SelectItem("destination");
    $destinationsTpl->setElements($destinations);
    $destinationsTpl->setElementsVal($destinationsVals);
    $f->add(new TrFormElement(_T("Destination zone"), $destinationsTpl));
} else {
    $tr = new TrFormElement(_T("Destination zone"), new HiddenTpl("destination"));
    $tr->setStyle("display: none");
    $f->add($tr, array("value" => $zones[0][0]));
}
$f->add(new TrFormElement(_T("Destination IP"), new InputTpl("dest_ip"), array("tooltip" => _T("The computer IP in the internal network where the request will be transfered."))), array("value" => "", "required" => true));
$f->add(new TrFormElement(_T("Destination port(s)"), new InputTpl("dest_port", "/^[0-9]+\$/"), array("tooltip" => _T("If not specified, destination port(s) will be the same as the incoming port(s)"))), array("value" => ""));
$f->pop();
$f->addButton("brule", _T("Add rule"));
$f->display();
if (!servicesModuleEnabled()) {
    echo '<br/>';
    $f = new ValidatingForm(array("id" => "service"));
    $f->addButton("brestart", _T("Restart service"));
    $f->display();
}
Exemplo n.º 4
0
}
$dst_zones = getZonesInterfaces($dst);
if (count($dst_zones) > 1) {
    $destinations = array("All");
    $destinationsVals = array("all");
    foreach ($dst_zones as $zone) {
        $destinations[] = sprintf("%s (%s)", $zone[0], $zone[1]);
        $destinationsVals[] = $zone[0];
    }
    $destinationsTpl = new SelectItem("destination");
    $destinationsTpl->setElements($destinations);
    $destinationsTpl->setElementsVal($destinationsVals);
    $destinationsTpl->setSelected(fromPOST("destination"));
    $f->add(new TrFormElement(_T("Destination zone"), $destinationsTpl));
} else {
    $tr = new TrFormElement(_T("Destination zone"), new HiddenTpl("destination"));
    $tr->setStyle("display: none");
    $f->add($tr, array("value" => "all"));
}
if ($dst != array("fw")) {
    $tr = new TrFormElement(_T("Limit destination IP(s)"), new InputTpl("destination_ip"), array("tooltip" => "Specify destination IP(s), IP range(s), network for this rule separated by commas. (eg: 155.186.235.0/24,155.186.233.23)"));
    $f->add($tr, array("value" => fromPOST("destination_ip")));
}
$macros = getServices();
$services = array("", "Custom rule...") + $macros;
$servicesVals = array("", "custom") + $macros;
$serviceTpl = new SelectItem("service", "toggleCustom");
$serviceTpl->setElements($services);
$serviceTpl->setElementsVal($servicesVals);
$f->add(new TrFormElement(_T("Service"), $serviceTpl), array("value" => fromPOST('service')));
$f->pop();
Exemplo n.º 5
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 
}
Exemplo n.º 6
0
<?php 
}
?>

<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");
    ?>
Exemplo n.º 7
0
    <td>
    </td>
    <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") {
Exemplo n.º 8
0
<table cellspacing="0" id="permsTable" <?php 
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");
Exemplo n.º 9
0
 function TrFormElementcollapse($tpl, $extraInfo = array())
 {
     parent::TrFormElement($desc, $tpl, $extraInfo);
 }
Exemplo n.º 10
0
Arquivo: edit.php Projeto: psyray/mmc
renderTPL("groups");
?>
</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>
Exemplo n.º 11
0
        $backup = $_POST["backup"] ? True : False;
        if (in_array("imaging", $_SESSION["modulesList"])) {
            //$dede = xmlrpc_imagingClearMenuFromUuid($uuid);
            $dede = xmlrpc_imagingClearMenuFromUuidAllLocation($uuid);
        }
        delComputer($uuid, $backup);
        if (!isXMLRPCError()) {
            new NotifyWidgetSuccess(_("The computer has been deleted."));
        }
        header("Location: " . urlStrRedirect("base/computers/index"));
        exit;
    }
} else {
    $uuid = urldecode($_GET["objectUUID"]);
    $f = new PopupForm(_("Delete this computer"));
    $f->push(new Table());
    $tr = new TrFormElement(_("Do you want a backup to be done ?"), new CheckBoxTpl("backup"), array("value" => ''));
    // Set first column to 100%, because without this setting, checkbox width is too large
    $tr->setFirstColWidth('100%');
    $f->add($tr);
    // this checkbox has to be checked to delete a computer
    $tr = new TrFormElement(_("I am aware that <b>all related images (non-master)</b> will be <b>DELETED</b>.<br />Check this box if it is what you want."), new CheckBoxTpl("imageWarning"), array("value" => ''));
    $tr->setFirstColWidth('100%');
    $f->add($tr);
    $hidden = new HiddenTpl("objectUUID");
    $f->add($hidden, array("value" => $uuid, "hide" => True));
    $f->pop();
    $f->addValidateButton("bconfirm");
    $f->addCancelButton("bback");
    $f->display();
}
Exemplo n.º 12
0
renderTPL("groups");
?>
</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>