本文整理汇总了PHP中FormHandler::isUpdated方法的典型用法代码示例。如果您正苦于以下问题:PHP FormHandler::isUpdated方法的具体用法?PHP FormHandler::isUpdated怎么用?PHP FormHandler::isUpdated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormHandler
的用法示例。
在下文中一共展示了FormHandler::isUpdated方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: callPluginFunction
break;
default:
$mode = false;
break;
}
$redirect = false;
// if data is sent
if ($_POST) {
$uid = $FH->getPostValue('uid');
/* Check sent data */
$ret = callPluginFunction("verifInfo", array($FH, $mode));
if (!$error && !isXMLRPCError()) {
/* Add or edit user attributes */
$ret = callPluginFunction("changeUser", array($FH, $mode));
/* Primary group management */
if ($FH->isUpdated("primary")) {
$primaryGroup = getUserPrimaryGroup($uid);
if ($FH->getValue("primary") != $primaryGroup) {
/* Update the primary group */
$ret = callPluginFunction("changeUserPrimaryGroup", array($uid, $FH->getValue("primary"), $primaryGroup));
foreach ($ret as $plugin => $err) {
if ($err != 0 && $err != NULL) {
$result .= sprintf(_("Failed to change primary group in %s plugin"), $plugin) . "<br />";
}
}
}
}
/* Secondary groups management */
if ($FH->isUpdated("secondary")) {
$old = getUserSecondaryGroups($uid);
$new = $FH->getValue('secondary');
示例2: FormHandler
} else {
$FH = new FormHandler("editAliasFH", array());
}
if ($_GET["action"] == "add") {
$mode = "add";
$title = _T("Add a virtual alias", "mail");
} else {
$mode = "edit";
$title = _T("Edit virtual alias", "mail");
$sidemenu->forceActiveItem("index");
$alias = $_GET['alias'];
$FH->setArr(getVAlias($alias));
}
if ($_POST) {
if ($mode == "add") {
if ($FH->isUpdated("mailalias")) {
addVAlias($FH->getValue("mailalias"));
$alias = $FH->getValue("mailalias");
$result .= _T("The virtual alias has been created.", "mail") . "<br />";
} else {
$error .= _T("The alias name is required.", "mail");
setFormError("mailalias");
}
} else {
if ($FH->isUpdated("mailalias")) {
changeVAliasName($alias, $FH->getValue("mailalias"));
$alias = $FH->getValue("mailalias");
$result .= _T("Virtual alias name updated.", "mail") . "<br />";
}
}
if (!$error && !isXMLRPCError()) {
示例3: getFailoverConfig
} else {
$error .= _T("Failed to update the failover configuration.") . "<br />";
}
}
// get current configuration
$failoverConfig = getFailoverConfig();
$FH->setArr($failoverConfig);
// default values
$show = false;
if (isset($failoverConfig['secondary'])) {
$show = true;
}
if ($_POST) {
$result = "";
$error = "";
if ($FH->isUpdated("dhcp_failover") and $FH->getValue("dhcp_failover") == "off") {
delFailoverConfig();
delSecondaryServer();
if (!isXMLRPCError()) {
$result .= _T("Failover configuration disabled.") . "<br />";
} else {
$error .= _T("Failed to disable the failover configuration.") . "<br />";
}
}
if ($FH->getPostValue("dhcp_failover") == "on") {
if ($FH->isUpdated("secondary")) {
updateSecondaryServer($FH->getValue("secondary"));
if (!isXMLRPCError()) {
$result .= _T(sprintf("%s set as the secondary DHCP server.", $FH->getValue("secondary"))) . "<br />";
updateFailoverConfig($FH);
} else {
示例4: setFormError
}
if ($_GET["action"] == "addppolicy") {
$mode = "add";
$title = _T("Add a password policy", "ppolicy");
} else {
$mode = "edit";
$title = _T("Edit password policy", "ppolicy");
$sidemenu->forceActiveItem("indexppolicy");
$ppolicy = $_GET['ppolicy'];
$FH->setArr(getAllPPolicyAttributes($ppolicy));
}
if ($_POST) {
$name = $FH->getPostValue("cn");
$desc = $FH->getPostValue("description");
// Some sanity checks...
if ($FH->isUpdated("pwdMaxAge") or $FH->isUpdated("pwdMinAge")) {
$max = $FH->getPostValue("pwdMaxAge");
$min = $FH->getPostValue("pwdMinAge");
if ($min && $max && $min > $max) {
$error .= _T('"Maximum age" must be greater than "Minimum age".', 'ppolicy') . "<br />";
setFormError("pwdMinAge");
}
}
if ($mode == "add") {
if (!checkPPolicy($name)) {
addPPolicy($name, $desc);
if (!isXMLRPCError()) {
$result .= _T(sprintf("Password policy %s created.", $name), "ppolicy") . "<br />";
} else {
$error .= _T(sprintf("Failed to create %s password policy.", $name), "ppolicy") . "<br />";
}