本文整理汇总了PHP中User_Model::updateUser方法的典型用法代码示例。如果您正苦于以下问题:PHP User_Model::updateUser方法的具体用法?PHP User_Model::updateUser怎么用?PHP User_Model::updateUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User_Model
的用法示例。
在下文中一共展示了User_Model::updateUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: emDirect
if ($User_Model->isUserExist($login, $uid)) {
emDirect("./user.php?action=edit&uid={$uid}&error_exist=1");
}
if (strlen($password) > 0 && strlen($password) < 6) {
emDirect("./user.php?action=edit&uid={$uid}&error_pwd_len=1");
}
if ($password != $password2) {
emDirect("./user.php?action=edit&uid={$uid}&error_pwd2=1");
}
$userData = array('username' => $login, 'nickname' => $nickname, 'email' => $email, 'description' => $description, 'role' => $role, 'ischeck' => $ischeck);
if (!empty($password)) {
$PHPASS = new PasswordHash(8, true);
$password = $PHPASS->HashPassword($password);
$userData['password'] = $password;
}
$User_Model->updateUser($userData, $uid);
$CACHE->updateCache('user');
emDirect('./user.php?active_update=1');
}
if ($action == 'del') {
LoginAuth::checkToken();
$users = $User_Model->getUsers();
$uid = isset($_GET['uid']) ? intval($_GET['uid']) : '';
if (UID == $uid) {
emDirect('./user.php');
}
//创始人账户不能被删除
if ($uid == 1) {
emDirect('./user.php?error_del_a=1');
}
$User_Model->deleteUser($uid);
示例2: emDirect
if ($email != '' && !checkMail($email)) {
emDirect("./blogger.php?error_b=1");
} elseif (strlen($newpass) > 0 && strlen($newpass) < 6) {
emDirect("./blogger.php?error_c=1");
} elseif (!empty($newpass) && $newpass != $repeatpass) {
emDirect("./blogger.php?error_d=1");
} elseif ($User_Model->isUserExist($login, UID)) {
emDirect("./blogger.php?error_e=1");
} elseif ($User_Model->isNicknameExist($nickname, UID)) {
emDirect("./blogger.php?error_f=1");
}
}
if (!empty($newpass)) {
$PHPASS = new PasswordHash(8, true);
$newpass = $PHPASS->HashPassword($newpass);
$User_Model->updateUser(array('password' => $newpass), UID);
}
if (!empty($login)) {
$User_Model->updateUser(array('username' => $login), UID);
}
$photo_type = array('gif', 'jpg', 'jpeg', 'png');
$usericon = $photo;
if ($_FILES['photo']['size'] > 0) {
$file_info = uploadFile($_FILES['photo']['name'], $_FILES['photo']['error'], $_FILES['photo']['tmp_name'], $_FILES['photo']['size'], $photo_type, true);
if (!empty($file_info['file_path'])) {
$usericon = !empty($file_info['thum_file']) ? $file_info['thum_file'] : $file_info['file_path'];
}
}
$User_Model->updateUser(array('nickname' => $nickname, 'email' => $email, 'photo' => $usericon, 'description' => $description), UID);
$CACHE->updateCache('user');
emDirect("./blogger.php?active_edit=1");