本文整理汇总了PHP中user::setEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP user::setEmail方法的具体用法?PHP user::setEmail怎么用?PHP user::setEmail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类user
的用法示例。
在下文中一共展示了user::setEmail方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addUserObject
public function addUserObject($urlParams = null)
{
$user = new user();
$user->setEmail($urlParams['email']);
$user->setName($urlParams['name']);
$this->helper->persist($user, true);
$id = $user->getId();
$this->helper->flush();
return $this->getUserObject(array('id' => $id));
}
示例2: login
function login($email, $password)
{
// 登陆
$ud = new userdao();
$u = new user();
$u->setEmail($email);
$u->setPassword($password);
$code = $ud->login($u);
if ($code == 1) {
$_SESSION['token'] = md5(time());
remsg(1, "success");
} else {
session_destroy();
remsg(0, "账户名或密码错误!");
}
}
示例3: test
public function test()
{
$username = "howdy";
$password = "123456";
$email = "gg@gmail.com";
user::create_new_user($username, $password, $email);
$this->assertEquals(1, user::getNumberOfUsers(), "number of users is not correct after adding a new user");
$r = user::getUserByUsername($username);
$this->assertEquals($username, $r['username'], "username was not saved correctly");
$this->assertEquals($email, $r['email'], "email is not saved correctly");
$this->assertEquals(md5(md5($password) . md5($r['salt'])), $r['password'], "password not correct");
user::clear_table();
$this->assertEquals(0, user::getNumberOfUsers());
$this->assertFalse(user::doesUsernameExist($username), "doesUsernameExist() in user is broken");
user::create_new_user($username, $password, $email);
$this->assertTrue(user::doesUsernameExist($username), "doesUsernameExist() in user is broken");
$this->assertFalse(user::doesEmailExist($email . "bla"), "doesEmailExist() in user is broken");
$this->assertTrue(user::doesEmailExist($email), "doesEmailExist() in user is broken");
$newPassword = "hello";
user::resetPassword($username, $newPassword);
$r = user::getUserByUsername($username);
$this->assertEquals(md5(md5($newPassword) . md5($r['salt'])), $r['password'], "restting password is broken");
$newEmail = "ee@gmail.com";
user::setEmail($username, $newEmail);
$r = user::getUserByUsername($username);
$this->assertEquals($newEmail, $r['email'], "setEmail is broken");
user::deleteUserByUsername($username);
$this->assertFalse(user::doesUsernameExist($username), "deleteUserByUsername() in user is broken");
user::create_new_user($username, $password, $email);
$this->assertTrue(user::isLogin($username, $password), "isLogin is broken");
$this->assertFalse(user::isLogin($username, $password . "d"), "isLogin is broken");
$this->assertFalse(user::isLogin($username . "d", $password), "isLogin is broken");
$user_info = user::getUserByUsername($username);
$user_info2 = user::getUserById($user_info['id']);
$this->assertEquals($user_info['username'], $user_info2['username'], "mismatched usernames when getting user by ID");
$gcm_id1 = "APA91bFpUo1z8PfiyCZG7HzThDyJ0MIg86BB1kj0A-ZGASK_iJ-RTu8pUB4t_5jMgwqkolWCahT4QOOAnp9nNdCox7pd9vlJao1-ncYHqvlS89lOpjdoci2_3XXGxcIWgrWwTz1tC8OlURokekQdbDCGKWuqfzfXLKrhisGxJYpF1ivuItZtJns";
$this->assertTrue(safe_input::is_valid_gcm_id($gcm_id1), "[is_valid_gcm_id()]");
//user::setGCM($user_id,$gcm_id)
$this->assertTrue(user::setGCM($user_info['id'], $gcm_id1), "[user::setGCM()]");
$user_info = user::getUserByUsername($username);
$this->assertEquals($gcm_id1, $user_info['gcmID'], "setGCM()");
$gcm_id2 = "APA91bHGJbxPpIUNirvnCQib7kojM12Qu2MBBd9dGHXSu0hsfB_Al2rQ4E8UWgpMXhNVIGT6IlSjLE-MB2F0RrBeN_llEYzPErIQoewxnDeON6uqBIHkLcMIY2NQtQHX3TNYBrlNc74wmh7aYec9kLMp5QGogVYSao1Q-RtIx4QV140YHBBASXM";
$this->assertTrue(user::setGCM($user_info2['id'], $gcm_id2), "[user::setGCM()]");
$user_info2 = user::getUserById($user_info['id']);
$this->assertEquals($gcm_id2, $user_info2['gcmID'], "setGCM()");
}
示例4: user
if ($_POST['ngaydangky'] == '') {
$error = 'khong duoc de trong';
} else {
$ngayDangKy = $_POST['ngaydangky'];
}
if ($_POST['trangthai'] == '') {
$error = 'khong duoc de trong';
} else {
$trangThai = $_POST['trangthai'];
}
if ($tenDangNhap && $matKhau && $email && $hoTen && $maQuyen && $ngayDangKy && $trangThai) {
$user1 = new user();
$user1->set_tk($tenDangNhap);
$user1->set_mk($matKhau);
$user1->setName($hoTen);
$user1->setEmail($email);
$user1->set_qtc($maQuyen);
$user1->setNgaydangky($ngayDangKy);
$user1->setTrangthai($trangThai);
if ($user1->add_user() == "user exist") {
$error = 'tai khoan da ton tai';
} else {
header('location:admin-board.php');
}
}
}
?>
<form method="post">
<span style="color:red; text-align:center;"><h3><?php
if (isset($error)) {
echo $error;
示例5: user
echo $language['save'];
?>
</button>
<button type="reset" name="cancel"><?php
echo $language['cancel'];
?>
</button>
</div>
</form>
<?php
} else {
if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$user = new user();
$user->setUsername($_POST['username']);
$user->setPassword($_POST['password']);
$user->setEmail($_POST['email']);
$user->setRank($_POST['rank']);
if ($user->existUserByName() == 0) {
if ($user->insert()) {
print 'sucess';
} else {
print 'failure';
}
} else {
print 'O username ja existe';
}
} else {
print 'Email invalido';
print '<script type="text/javascript">setTimeout(goBack(),2000);</script>';
}
}
示例6:
$user->setId($_REQUEST['i']);
$tmp = $user->returnOneUser();
$user->setUsername($tmp['name']);
if (!empty($_REQUEST['password']) && !empty($_REQUEST['confirm_password'])) {
if ($_REQUEST['password'] == $_REQUEST['confirm_password']) {
$user->setPassword($_REQUEST['password']);
} else {
print 'Passwords erradas';
}
} else {
if (empty($_REQUEST['password']) && empty($_REQUEST['confirm_password'])) {
$user->setOldPassword($tmp['password']);
} else {
print 'ola';
}
}
$user->setEmail($_REQUEST['email']);
$user->setRank($_REQUEST['rank']);
if ($user->update()) {
print 'sucess';
} else {
print 'failure';
}
} else {
print 'Email invalido';
//print'<script type="text/javascript">setTimeout(goBack(),2000);</script>';
}
}
} else {
print 'error';
}
示例7: user
$error = 'khong duoc de trong6';
} else {
$ngayDangKy = $_POST['ngaydangky'];
}
if ($_POST['trangthai'] == '') {
$error = 'khong duoc de trong7';
} else {
$trangThai = $_POST['trangthai'];
}
if ($tenDangNhap && $pass && $hoTen && $email && $maQuyen && $ngayDangKy && $trangThai) {
$user2 = new user();
$user2->setId($userid);
$user2->set_tk($tenDangNhap);
$user2->set_mk($pass);
$user2->setName($hoTen);
$user2->setEmail($email);
$user2->set_qtc($maQuyen);
$user2->setNgaydangky($ngayDangKy);
$user2->setTrangthai($trangThai);
if ($user2->edit_user() == 'user exist') {
$error = 'tai khoan da ton tai';
} else {
header('location:admin-board.php');
}
}
}
?>
<form method="post"><table align="center" width="400" border="1">
<tr>
<td colspan="2"><?php
if (isset($error)) {
示例8: user
<?php
require_once '../classes/connection.class.php';
require_once '../classes/user.class.php';
require_once '../classes/locate.class.php';
if (isset($_POST['submit'])) {
$user_id = $_POST['user_id'];
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
}
$updateUserObject = new user();
$updateUserObject->setUserID($user_id);
$updateUserObject->setUsername($username);
$updateUserObject->setPassword($password);
$updateUserObject->setEmail($email);
$flag = $updateUserObject->updateUser();
/*echo '<pre>';
print_r($updateUserObject);
echo '</pre>';
exit;*/
if ($flag) {
$_SESSION['user_updated'] = $err = "The user has been updated successfully";
new Locate('../index.php?page=user&action=view');
} else {
$_SESSION['user_not_updated'] = $err = "The user couldn't be updated";
new Locate('../index.php?page=user&action=view');
}
示例9:
<li><a href="../nbc">NBC</a></li>
<li><a href="../abc">ABC</a></li>
<li><a href="../abc_family">ABC Family</a></li>
<li><a href="../usa">USA</a></li>
</ul>
</div>
</aside>
<section id="main_section"><!-- meet of the website-->
<div>
<h3>My Info</h3>
<div id="result" style="padding:5px; color:red">
<?php
if (isset($_POST['email'])) {
if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$result = $user->setEmail($_POST['email']);
echo $result;
} else {
echo "invalid email";
}
} else {
if (isset($_POST['username'])) {
if (validateUsername($_POST['username'])) {
//continue
$res = $user->setUsername($_POST['username']);
echo $res;
} else {
echo "Username already taken.";
}
} else {
if (isset($_POST['aboutMe'])) {