本文整理汇总了PHP中Player::setPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP Player::setPassword方法的具体用法?PHP Player::setPassword怎么用?PHP Player::setPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player::setPassword方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createAdminUser
private function createAdminUser($details)
{
if (isset($details['adminUserName']) && isset($details['adminUserName'])) {
$pl = new Player();
$pl->grantAdminAccess();
$pl->setUsername($details['adminUserName']);
$pl->setPassword($details['adminPassword']);
$pl->commit();
$session = new Session();
$session->signIn(array('username' => $details['adminUserName'], 'password' => $details['adminPassword'], 'rememberMe' => true));
}
}
示例2: createUser
public function createUser($username, $password)
{
$player = new Player();
if (!$player->exists()) {
$player->createTable();
}
$player->setUsername($username);
$player->setPassword($password);
$player->setEmail('post@dhtmlgoodies.com');
$player->setOnlinePlayer('1');
$player->commit();
return $player;
}
示例3: handleActions
function handleActions()
{
global $hasError;
global $errormsg;
if (!isset($_POST['action'])) {
return;
}
if ($_POST['action'] == "Change Password") {
$player = new Player($_POST['username']);
$player->setPassword($_POST['new_password']);
$result = "Password changed for user {$player->name} to {$_POST['new_password']}";
}
if (isset($result)) {
echo "<div class=\"notice\">{$result}</div>";
}
}
示例4: setPlayerIgnores
if ($player == NULL) {
echo "<center> You must <a href=\"login.php\">log in</a> to use your player control panel.</center>\n";
} else {
// Handle actions
if (isset($_POST['action'])) {
if ($_POST['action'] == 'setIgnores') {
setPlayerIgnores();
} else {
if ($_POST['action'] == 'changePassword') {
$success = false;
if ($_POST['newPassword2'] == $_POST['newPassword']) {
if (strlen($_POST['newPassword']) >= 6) {
$authenticated = Player::checkPassword($_POST['username'], $_POST['oldPassword']);
if ($authenticated) {
$player = new Player($_POST['username']);
$player->setPassword($_POST['newPassword']);
$result = "Password changed.";
$success = true;
} else {
$result = "Password *not* changed, your old password was incorrect!";
}
} else {
$result = "Password *not* changed, your new password needs to be longer!";
}
} else {
$result = "Password *not* changed, your new passwords did not match!";
}
} else {
if ($_POST['action'] == 'verifyAccount') {
$success = false;
if ($player->checkChallenge($_POST['challenge'])) {
示例5: getUserWithNonProvisionalElo
private function getUserWithNonProvisionalElo($eloValue = null)
{
$pl = new Player();
$pl->setUsername(uniqid('user'));
$pl->setPassword(uniqid('pass'));
$pl->commit();
$eloSetter = new EloSetter(1);
for ($i = 0; $i < 10; $i++) {
$eloSetter->registerResult($pl, $this->getUserWithElo(1500), 1);
$eloSetter->registerResult($pl, $this->getUserWithElo(1400), 1);
$eloSetter->registerResult($pl, $this->getUserWithElo(1200), -1);
$eloSetter->registerResult($pl, $this->getUserWithElo(2000), 0.5);
}
if (isset($eloValue)) {
$elo = new Elo($pl->getId(), 1);
$elo->setElo($eloValue);
$elo->commit();
return new Player($pl->getId());
}
return $pl;
}