本文整理汇总了PHP中UserDao::updateName方法的典型用法代码示例。如果您正苦于以下问题:PHP UserDao::updateName方法的具体用法?PHP UserDao::updateName怎么用?PHP UserDao::updateName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserDao
的用法示例。
在下文中一共展示了UserDao::updateName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleForm
public function handleForm(Context $context, $action)
{
//TODO: Check user level >= ADMIN
if ($action == "savePassword") {
if (isset($_POST['newpass']) && $_POST['newpass'] != "" && (isset($_POST['confpass']) && $_POST['confpass'] != "")) {
$newPassword = $_POST['newpass'];
$confirmPassword = $_POST['confpass'];
if ($newPassword = $confirmPassword) {
UserDao::updateUserPassword($_POST['userid'], $newPassword);
$context->addMessage("Password Successfully Changed.");
} else {
$context->addError("Passwords Don't Match.");
}
} else {
$context->addError("Required Field Left Blank.");
}
} else {
if ($action == "saveEmail") {
if (isset($_POST['email']) && $_POST['email'] != "") {
$email = $_POST['email'];
UserDao::updateUserEmail($_POST['userid'], $email);
$context->addMessage("Email Successfully Changed.");
} else {
$context->addError("Required Field Left Blank.");
}
} else {
if ($action == "saveUserLevel") {
if (isset($_POST['level']) && $_POST['level'] != "") {
$userlevel = $_POST['level'];
UserDao::updateUserLevel($_POST['userid'], $userlevel);
$context->addMessage("User Level Successfully Changed.");
} else {
$context->addError("Required Field Left Blank.");
}
} else {
if ($action == "saveNotes") {
if (isset($_POST['notes']) && $_POST['notes'] != "") {
$notes = $_POST['notes'];
UserDao::updateUserNotes($_POST['userid'], $notes);
$context->addMessage("Notes Successfully Changed.");
} else {
$context->addError("Required Field Left Blank.");
}
} else {
if ($action == "saveName") {
if (isset($_POST['name']) && $_POST['name'] != "") {
$name = $_POST['name'];
UserDao::updateName($_POST['userid'], $name);
$context->addMessage("Name Successfully Changed.");
} else {
$context->addError("Required Field Left Blank.");
}
} else {
$context->addError("Incorrect Action.");
}
}
}
}
}
}