本文整理汇总了PHP中UserPeer::doSelectFromConfirmationCode方法的典型用法代码示例。如果您正苦于以下问题:PHP UserPeer::doSelectFromConfirmationCode方法的具体用法?PHP UserPeer::doSelectFromConfirmationCode怎么用?PHP UserPeer::doSelectFromConfirmationCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserPeer
的用法示例。
在下文中一共展示了UserPeer::doSelectFromConfirmationCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeConfirmUser
/**
* Action to handle getting a confirmation code. Confirms user and spits out
* a success page if the code checks out... spits out an error page otherwise
*/
public function executeConfirmUser()
{
$user = UserPeer::doSelectFromConfirmationCode($this->getRequestParameter('code'));
if (!$user) {
$newCode = $this->getRequestParameter('code');
$oC = new Criteria();
$oC->add(UserPeer::ID, "SHA1(CONCAT(user.password, 'salt', user.id)) = '{$newCode}'", Criteria::CUSTOM);
$oC->add(UserPeer::TYPE, '1');
$userCheck = UserPeer::doSelectOne($oC);
if (!$userCheck) {
return sfView::ERROR;
}
}
if ($user) {
$user->setTypeConfirmed();
$user->save();
}
if ($user) {
$this->getUser()->signIn($user);
} else {
$this->getUser()->signIn($userCheck);
}
if ($kinkarsoUser) {
if ($user) {
$query = mysql_query("select * from shout where recipient_id=" . $user->getId() . " and poster_id=" . $kinkarsoUser->getId() . "") or die(mysql_error());
if (mysql_num_rows($query) == 0) {
ShoutPeer::createWelcomeComment($user, $kinkarsoUser);
}
}
$subject = 'Here\'s how to start tutoring on Rayku';
if ($user) {
$body = 'Hey ' . $user->getName() . ', welcome to Rayku.com!<br><br>';
}
$body .= 'Thanks for joining our community!<br><br>
Before you get started, there are 3 important steps before you can start tutoring!<br><br>
1) Activated your tutor status by clicking \'on\' in your <a href="' . sfConfig::get('app_rayku_url') . '/dashboard">dashboard page</a>.<br>
2) Important: Learn how to tutor on Rayku in 10 minutes by watching our <a href="' . sfConfig::get('app_rayku_url') . '/tutorshelp">tutor help videos</a>.<br>
3) Prepare to receive question notifications by connecting to our <strong><a href="' . sfConfig::get('app_notification_bot_url') . '/download/rayku.dmg">MacOS</a> / <a href="http://notification-bot.rayku.com/download/rayku.exe">Windows</a> notification software</strong>, <a href="http://rayku.com/dashboard/gtalk">google talk</a> and <a href="http://rayku.com/dashboard/facebook">facebook chat</a>.<br><br>
Enjoy, and do let us know if you ever have any questions - we\'re here to help!<br><br>
Thanks!<br>
Rayku Administration';
$currentuser = $kinkarsoUser;
//Send the message
if ($user) {
$currentuser->sendMessage($user->getId(), $subject, $body);
}
}
$this->forward('regtutor', 'profile');
}
示例2: executeConfirmuser
public function executeConfirmuser()
{
//Load the user from activation code
$user = UserPeer::doSelectFromConfirmationCode($_REQUEST['confirmationcode']);
//If the user doesn't exist, display an error
if (!$user) {
$oC = new Criteria();
$oC->add(UserPeer::ID, "SHA1( CONCAT( user.password, 'salt', user.id ) ) = '{$newCode}'", Criteria::CUSTOM);
$oC->add(UserPeer::TYPE, '1');
$userCheck = UserPeer::doSelectOne($oC);
if (!$userCheck) {
$_SESSION['confirm_user_error'] = "Invalid Confirmation Code.";
$this->redirect("/quickreg/confirmationcode");
//return sfView::ERROR;
}
}
//print_r($_POST);exit;
$newCode = $_REQUEST['confirmationcode'];
$courseId = $_REQUEST['course_id'];
$education = $_REQUEST['edu'];
$university = $_REQUEST['name'];
$courseCode = $_REQUEST['course_code'];
$year = $_REQUEST['asker_year'];
$grade = $_REQUEST['asker_grade'];
$dashHidden = $_REQUEST['dash_hidden'];
$_SESSION['course_id'] = $courseId;
$_SESSION['edu'] = $education;
$_SESSION['name'] = $university;
$_SESSION['course_code'] = $courseCode;
$_SESSION['dash_hidden'] = $dashHidden;
if ($year != 'Choose year') {
$_SESSION['year'] = $year;
}
if ($grade != 'Choose grade') {
$_SESSION['grade'] = $grade;
}
if ($user) {
$user->setTypeConfirmed();
$user->save();
}
if ($user) {
$this->getUser()->signIn($user);
} else {
$this->getUser()->signIn($userCheck);
}
$this->redirect("/expertmanager/list");
}
示例3: executeConfirmUser
/**
* Action to handle getting a confirmation code. Confirms user and spits out
* a success page if the code checks out... spits out an error page otherwise
*/
public function executeConfirmUser()
{
if (strlen($this->getRequestParameter('code')) > 40) {
$req = unserialize(base64_decode(urldecode($this->getRequestParameter('code'))));
$code = $req['code'];
$question = $req['question'];
} else {
$code = $this->getRequestParameter('code');
}
$user = UserPeer::doSelectFromConfirmationCode($code);
if (!$user) {
$newCode = $this->getRequestParameter('code');
$oC = new Criteria();
$oC->add(UserPeer::ID, "SHA1( CONCAT( user.password, 'salt', user.id ) ) = '{$code}'", Criteria::CUSTOM);
$oC->add(UserPeer::TYPE, '1');
$userCheck = UserPeer::doSelectOne($oC);
if (!$userCheck) {
return sfView::ERROR;
}
}
if ($user) {
$user->setTypeConfirmed();
$user->save();
// Referral module
// Rajesh Soni - 23 November 2012
$ref_points = 6;
$ref_points_user = 4;
$sql2 = "select referred_by from user where id=" . $user->getId();
if ($user->getId()) {
$result = mysql_query($sql2) or die($sql2 . mysql_error());
$row = mysql_fetch_row($result) or die($sql2 . mysql_error());
$ref_by_user = $row[0];
if ($ref_by_user) {
$sql2 = "update user set points= points + " . $ref_points . " where id=" . $ref_by_user . " LIMIT 1";
mysql_query($sql2) or die($sql2 . mysql_error());
$sql2 = "update user set points='" . $ref_points_user . "' where id=" . $user->getId() . " LIMIT 1";
mysql_query($sql2) or die($sql2 . mysql_error());
}
}
}
if ($user) {
$this->getUser()->signIn($user);
} else {
$this->getUser()->signIn($userCheck);
}
if ($question) {
$this->getRequest()->setParameter('question', $question);
// Rajesh Soni - 28 November 2012
$this->redirect("/referrals?register=success");
} elseif ($user) {
// Rajesh Soni - 28 November 2012
$this->redirect("/referrals?register=success");
} else {
$this->redirect("/referrals?register=success");
}
}