本文整理汇总了PHP中FormHandler::getValue方法的典型用法代码示例。如果您正苦于以下问题:PHP FormHandler::getValue方法的具体用法?PHP FormHandler::getValue怎么用?PHP FormHandler::getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormHandler
的用法示例。
在下文中一共展示了FormHandler::getValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: callPluginFunction
$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');
foreach (array_diff($old, $new) as $group) {
del_member($group, $uid);
示例2: FormHandler
$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()) {
if ($FH->isUpdated("users")) {
示例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: getPPolicyAttributesKeys
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 />";
}
} else {
$error .= _T(sprintf("Password policy %s already exists.", $name), "ppolicy") . "<br />";
}
}
if (!$error && !isXMLRPCError()) {
$ppolicyattr = getPPolicyAttributesKeys();
$update = "";
foreach ($ppolicyattr as $attr => $info) {
/* foreach supported attributes */
if ($FH->isUpdated($attr) && $info[1] == "bool") {
if ($FH->getValue($attr) == "on") {
$value = "TRUE";
}
if ($FH->getValue($attr) == "off") {
$value = "FALSE";
}
setPPolicyAttribute($attr, $value, $name);
$update .= "<li>" . $info[0] . "</li>";
} else {
if ($FH->isUpdated($attr)) {
setPPolicyAttribute($attr, $FH->getValue($attr), $name);
$update .= "<li>" . $info[0] . "</li>";
}
}
}
if ($update) {