exit; } else { if ($error) { new NotifyWidgetFailure($error); } $FH->isError(true); // make next XML-RPC calls $errorStatus = 0; } } $p = new PageGenerator($title); $p->setSideMenu($sidemenu); $p->display(); $f = new ValidatingForm(); $f->push(new Table()); $f->add(new TrFormElement(_T("Alias name"), new MailInputTpl("mailalias")), array("value" => $FH->getArrayOrPostValue("mailalias"), "required" => true)); $checked = "checked"; if ($FH->getArrayOrPostValue("mailenable") != 'on' && $FH->getArrayOrPostValue("mailenable") != 'OK') { $checked = ""; } $f->add(new TrFormElement(_T("Enabled", "mail"), new CheckboxTpl("mailenable")), array("value" => $checked)); /* LDAP Users */ $users = get_users(); $usersTpl = new MembersTpl("users"); $usersTpl->setTitle(_T("Alias users", "mail"), _T("All users", "mail")); // get the alias users if ($FH->getPostValue("users")) { $alias_users = $FH->getPostValue("users"); } else { if ($mode == 'edit') { $alias_users = getVAliasUsers($alias);
} header("Location: " . urlStrRedirect("base/users/editppolicy", array("ppolicy" => $name))); exit; } } $p = new PageGenerator($title); $p->setSideMenu($sidemenu); $p->display(); $f = new ValidatingForm(); $f->push(new Table()); if ($mode == "add") { $nameTpl = new InputTpl("cn", '/^[0-9a-zA-Z_ -]*$/'); } else { $nameTpl = new HiddenTpl("cn"); } $f->add(new TrFormElement(_T("Name", "ppolicy"), $nameTpl), array("value" => $FH->getArrayOrPostValue("cn"), "required" => true)); $f->add(new TrFormElement(_T("Description", "ppolicy"), new InputTpl("description")), array("value" => $FH->getArrayOrPostValue("description"))); $f->add(new TrFormElement(_T("Minimum length", "ppolicy"), new InputTpl("pwdMinLength", '/^[0-9]*$/'), array("tooltip" => ppolicyTips("pwdMinLength"))), array("value" => $FH->getArrayOrPostValue("pwdMinLength"))); $f->add(new TrFormElement(_T("Password quality check", "ppolicy"), new InputTpl("pwdCheckQuality", '/^[012]$/'), array("tooltip" => ppolicyTips("pwdCheckQuality"))), array("value" => $FH->getArrayOrPostValue("pwdCheckQuality"))); $f->add(new TrFormElement(_T("Minimum age (seconds)", "ppolicy"), new InputTpl("pwdMinAge", '/^[0-9]*$/'), array("tooltip" => ppolicyTips("pwdMinAge"))), array("value" => $FH->getArrayOrPostValue("pwdMinAge"))); $f->add(new TrFormElement(_T("Maximum age (seconds)", "ppolicy"), new InputTpl("pwdMaxAge", '/^[0-9]*$/'), array("tooltip" => ppolicyTips("pwdMaxAge"))), array("value" => $FH->getArrayOrPostValue("pwdMaxAge"))); $f->add(new TrFormElement(_T("Number of grace authentications", "ppolicy"), new InputTpl("pwdGraceAuthNLimit", '/^[0-9]*$/'), array("tooltip" => ppolicyTips("pwdGraceAuthNLimit"))), array("value" => $FH->getArrayOrPostValue("pwdGraceAuthNLimit"))); if ($FH->getArrayOrPostValue("pwdMustChange") == 'TRUE' || $FH->getArrayOrPostValue("pwdMustChange") == 'on') { $pwdMustChange = "checked"; } else { $pwdMustChange = ""; } $f->add(new TrFormElement(_T("Force users to change their passwords on the first connection ?", "ppolicy"), new CheckboxTpl("pwdMustChange"), array("tooltip" => ppolicyTips("pwdMustChange"))), array("value" => $pwdMustChange)); $f->add(new TrFormElement(_T("Password history", "ppolicy"), new InputTpl("pwdInHistory", '/^[0-9]*$/'), array("tooltip" => ppolicyTips("pwdInHistory"))), array("value" => $FH->getArrayOrPostValue("pwdInHistory"))); if ($FH->getArrayOrPostValue("pwdLockout") == 'TRUE' || $FH->getArrayOrPostValue("pwdLockout") == 'on') { $pwdLockout = "checked";