• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Registration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Registration的典型用法代码示例。如果您正苦于以下问题:PHP Registration类的具体用法?PHP Registration怎么用?PHP Registration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Registration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $number = $input->getOption('number');
     $debug = true;
     try {
         // Create a instance of Registration class.
         $r = new \Registration($number, $debug);
         $r->codeRequest('sms');
         // could be 'voice' too
     } catch (\Exception $e) {
         $output->writeln('<error>the number is invalid ' . $number . '</error>');
         return false;
     }
     $helper = $this->getHelper('question');
     $question = new Question('Digite seu código de confirmação recebido por SMS (sem hífen "-"): ', false);
     $question->setValidator(function ($value) use($output, $r) {
         try {
             $response = $r->codeRegister($value);
             $output->writeln('<fg=green>Your password is: ' . $response->pw . ' and your login: ' . $response->login . '</>');
         } catch (\Exception $e) {
             $output->writeln("<error>Código inválido, tente novamente mais tarde!</error>");
             return false;
         }
         return true;
     });
     $codigo = $helper->ask($input, $output, $question);
     $output->writeln('<fg=green>Your number is ' . $number . ' and your code: ' . $codigo . '</>');
 }
开发者ID:brenodouglas,项目名称:wpp-cli,代码行数:28,代码来源:Confirm.php


示例2: registration

 /**
  * To register new user
  * Subject for validations (e.g username length)
  **/
 public function registration()
 {
     $username = Param::get('username');
     $password = Param::get('pword');
     $password_match = Param::get('pword_match');
     $fname = Param::get('fname');
     $lname = Param::get('lname');
     $email = Param::get('email');
     $registration = new Registration();
     $login_info = array('username' => $username, 'user_password' => $password, 'fname' => $fname, 'lname' => $lname, 'email' => $email);
     //To check if all keys are null
     if (!array_filter($login_info)) {
         $status = "";
     } else {
         try {
             foreach ($login_info as $key => $value) {
                 if (!is_complete($value)) {
                     throw new ValidationException("Please fill up all fields");
                 }
             }
             if (!is_password_match($password, $password_match)) {
                 throw new ValidationException("Password did not match");
             }
             $info = $registration->userRegistration($login_info);
             $status = notice("Registration Complete");
         } catch (ExistingUserException $e) {
             $status = notice($e->getMessage(), "error");
         } catch (ValidationException $e) {
             $status = notice($e->getMessage(), "error");
         }
     }
     $this->set(get_defined_vars());
 }
开发者ID:LowellaMercurio,项目名称:board-1,代码行数:37,代码来源:user_controller.php


示例3: actionCompetitions

 public function actionCompetitions()
 {
     $model = new Registration();
     $model->unsetAttributes();
     $model->user_id = $this->user->id;
     $this->render('competitions', array('model' => $model));
 }
开发者ID:sunshy360,项目名称:cubingchina,代码行数:7,代码来源:UserController.php


示例4: actionRegister

 public function actionRegister()
 {
     $formModel = new Registration();
     //$this->performAjaxValidation($formModel);
     if (isset($_POST['Registration'])) {
         $formModel->email = $_POST['Registration']['email'];
         $formModel->username = $_POST['Registration']['username'];
         $formModel->password = $_POST['Registration']['password'];
         $formModel->password_repeat = $_POST['Registration']['password_repeat'];
         $formModel->verification_code = $_POST['Registration']['verification_code'];
         if ($formModel->validate()) {
             $model = new User();
             if ($model->insert(CassandraUtil::uuid1(), array('email' => $_POST['Registration']['email'], 'username' => $_POST['Registration']['username'], 'password' => User::encryptPassword($_POST['Registration']['password']), 'active' => false, 'blocked' => false)) === true) {
                 echo 'Model email ' . $formModel->email . ' && username ' . $formModel->username;
                 if (!User::sendRegisterVerification($formModel->email, $formModel->username)) {
                     echo 'failed';
                 } else {
                     echo 'done';
                 }
                 die;
                 //$this->redirect(array('user/profile'));
             }
         }
     }
     $this->render('register', array('model' => $formModel));
 }
开发者ID:redlaw,项目名称:lintinzone,代码行数:26,代码来源:RegistrationController.php


示例5: saveRegistration

 /**
  * Save Registration
  * @param <type> $array
  */
 public static function saveRegistration($array, $lang = null)
 {
     $r = new Registration();
     foreach ($array as $key => $value) {
         $field = (string) $key;
         $r->{$field} = $value;
     }
     ZFCore_Utils::log('Add registration: ' . var_export($array, true));
     $r->save();
     if (is_null($lang)) {
         $subject = "Retreat with Chögyal Namkhai Norbu";
         $body = "You are registered for the retreat in Merigar East. Thank you for the collaboration. See you in the Gar! \n";
     } elseif ($lang == 'ro') {
         $subject = "Retragerea de Invataturi Dzogchen cu Chögyal Namkhai Norbu";
         $body = "Cererea Dvs. de participare la retragerea din Merigar Est a fost inregistrata.\n  Va multumim pentru colaborare.\n                     Va asteptam cu drag la Gar.\n";
     } elseif ($lang == 'ru') {
         $subject = "Ретрит с Чгъялом Намкай Норбу";
         $body = "Вы зарешгистрированны на ретрит в Восточном Меригаре.\n    Спасибо за сотрудничество.\n    До встречи в Гаре\n";
     }
     // to user
     $options['from'] = "[email protected]";
     $options['to'] = $array['email'];
     $options['subject'] = $subject;
     $options['body'] = $body;
     ZFCore_Utils::sendEmail($options);
     // to admin
     $options['from'] = "[email protected]";
     $options['to'] = '[email protected]';
     $options['subject'] = "[RETREAT] new registration";
     $options['body'] = 'Add registration: ' . var_export($array, true);
     ZFCore_Utils::sendEmail($options);
 }
开发者ID:abtris,项目名称:retreatin,代码行数:36,代码来源:Registration.php


示例6: actionRegistration

 public function actionRegistration()
 {
     $competition = $this->getCompetition();
     $user = $this->getUser();
     $registration = Registration::getUserRegistration($competition->id, $user->id);
     if (!$competition->isPublic() || !$competition->isRegistrationStarted()) {
         Yii::app()->user->setFlash('info', Yii::t('Competition', 'The registration is not open yet.'));
         $this->redirect($competition->getUrl('competitors'));
     }
     $showRegistration = $registration !== null && $registration->isAccepted();
     if ($competition->isRegistrationEnded() && !$showRegistration) {
         Yii::app()->user->setFlash('info', Yii::t('Competition', 'The registration has been closed.'));
         $this->redirect($competition->getUrl('competitors'));
     }
     if ($competition->isRegistrationFull() && !$showRegistration) {
         Yii::app()->user->setFlash('info', Yii::t('Competition', 'The limited number of competitor has been reached.'));
         $this->redirect($competition->getUrl('competitors'));
     }
     if ($user->isUnchecked()) {
         $this->render('registration403', array('competition' => $competition));
         Yii::app()->end();
     }
     if ($registration !== null) {
         $registration->formatEvents();
         $this->setWeiboShareDefaultText($competition->getRegistrationDoneWeiboText(), false);
         $this->render('registrationDone', array('user' => $user, 'accepted' => $registration->isAccepted(), 'competition' => $competition, 'registration' => $registration));
         Yii::app()->end();
     }
     $model = new Registration();
     $model->competition = $competition;
     if ($competition->isMultiLocation()) {
         $model->location_id = null;
     }
     if (isset($_POST['Registration'])) {
         $model->attributes = $_POST['Registration'];
         $model->user_id = $this->user->id;
         $model->competition_id = $competition->id;
         $model->total_fee = $model->getTotalFee(true);
         $model->ip = Yii::app()->request->getUserHostAddress();
         $model->date = time();
         $model->status = Registration::STATUS_WAITING;
         if ($competition->check_person == Competition::NOT_CHECK_PERSON && $competition->online_pay != Competition::ONLINE_PAY) {
             $model->status = Registration::STATUS_ACCEPTED;
         }
         if ($model->save()) {
             Yii::app()->mailer->sendRegistrationNotice($model);
             $this->setWeiboShareDefaultText($competition->getRegistrationDoneWeiboText(), false);
             $model->formatEvents();
             $this->render('registrationDone', array('user' => $user, 'accepted' => $model->isAccepted(), 'competition' => $competition, 'registration' => $model));
             Yii::app()->end();
         }
     }
     $model->formatEvents();
     $this->render('registration', array('competition' => $competition, 'model' => $model));
 }
开发者ID:sunshy360,项目名称:cubingchina,代码行数:55,代码来源:CompetitionController.php


示例7: run

 public function run()
 {
     $form = new RegistrationForm();
     if (Yii::app()->request->isPostRequest && !empty($_POST['RegistrationForm'])) {
         $module = Yii::app()->getModule('user');
         $form->setAttributes($_POST['RegistrationForm']);
         // проверка по "черным спискам"
         // проверить на email
         if (!$module->isAllowedEmail($form->email)) {
             // перенаправить на экшн для фиксации невалидных email-адресов
             $this->controller->redirect(array(Yii::app()->getModule('user')->invalidEmailAction));
         }
         if (!$module->isAllowedIp(Yii::app()->request->userHostAddress)) {
             // перенаправить на экшн для фиксации невалидных ip-адресов
             $this->controller->redirect(array(Yii::app()->getModule('user')->invalidIpAction));
         }
         if ($form->validate()) {
             // если требуется активация по email
             if ($module->emailAccountVerification) {
                 $registration = new Registration();
                 // скопируем данные формы
                 $registration->setAttributes($form->getAttributes());
                 if ($registration->save()) {
                     // отправка email с просьбой активировать аккаунт
                     $mailBody = $this->controller->renderPartial('application.modules.user.views.email.needAccountActivationEmail', array('model' => $registration), true);
                     Yii::app()->mail->send($module->notifyEmailFrom, $registration->email, Yii::t('user', 'Регистрация на сайте {site} !', array('{site}' => Yii::app()->name)), $mailBody);
                     // запись в лог о создании учетной записи
                     Yii::log(Yii::t('user', "Создана учетная запись {nick_name}!", array('{nick_name}' => $registration->nick_name)), CLogger::LEVEL_INFO, UserModule::$logCategory);
                     Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Учетная запись создана! Инструкции по активации аккаунта отправлены Вам на email!'));
                     $this->controller->refresh();
                 } else {
                     $form->addErrors($registration->getErrors());
                     Yii::log(Yii::t('user', "Ошибка при создании  учетной записи!"), CLogger::LEVEL_ERROR, UserModule::$logCategory);
                 }
             } else {
                 // если активации не требуется - сразу создаем аккаунт
                 $user = new User();
                 $user->createAccount($form->nick_name, $form->email, $form->password);
                 if ($user && !$user->hasErrors()) {
                     Yii::log(Yii::t('user', "Создана учетная запись {nick_name} без активации!", array('{nick_name}' => $user->nick_name)), CLogger::LEVEL_INFO, UserModule::$logCategory);
                     // отправить email с сообщением о успешной регистрации
                     $emailBody = $this->controller->renderPartial('application.modules.user.views.email.accountCreatedEmail', array('model' => $user), true);
                     Yii::app()->mail->send($module->notifyEmailFrom, $user->email, Yii::t('user', 'Регистрация на сайте {site} !', array('{site}' => Yii::app()->name)), $emailBody);
                     Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Учетная запись создана! Пожалуйста, авторизуйтесь!'));
                     $this->controller->redirect(array('/user/account/login/'));
                 } else {
                     $form->addErrors($user->getErrors());
                     Yii::log(Yii::t('user', "Ошибка при создании  учетной записи без активации!"), CLogger::LEVEL_ERROR, UserModule::$logCategory);
                 }
             }
         }
     }
     $this->controller->render('registration', array('model' => $form));
 }
开发者ID:RSol,项目名称:yupe,代码行数:54,代码来源:RegistrationAction.php


示例8: prepareForSale

 public static function prepareForSale(Vehicle $vehicle)
 {
     $registration = new Registration($vehicle);
     $registration->allocateVehicleNumber();
     $registration->allocateLicensePlate();
     Documentation::printBrochure($vehicle);
     $vehicle->cleanInterior();
     $vehicle->cleanExteriorBody();
     $vehicle->polishWindows();
     $vehicle->takeForTestDrive();
     return 'Vehicle prepared for sale';
 }
开发者ID:phoenixproject,项目名称:phpdpe,代码行数:12,代码来源:vehicle_facade.php


示例9: resetpassword

 function resetpassword()
 {
     $userId = Users::getUserIdByCode($_POST["txtCode"]);
     if ($userId != -1) {
         $date = Users::getCodeDate($_POST["txtCode"]);
         $date = strtotime($date) + 600;
         if (strtotime(date("Y-m-d H:i:s")) <= $date) {
             if ($_POST["txtPassword"] == $_POST["txtPasswordConfirm"]) {
                 $salt = Registration::generateSalt();
                 $crypt = crypt($_POST["txtPassword"], $salt);
                 Users::updatePassword($userId, $crypt, $salt);
                 Users::deleteCode($userId);
                 header(CONNECTION_HEADER);
             }
         } else {
             Users::deleteCode($userId);
             $data = array("Forgot" => true);
             $this->renderTemplate(file_get_contents(RESET_PAGE), $data);
         }
     } else {
         Users::deleteCode($userId);
         $data = array("Forgot" => true);
         $this->renderTemplate(file_get_contents(RESET_PAGE), $data);
     }
 }
开发者ID:Swapon444,项目名称:Patrimoine,代码行数:25,代码来源:reset.php


示例10: index

 public function index()
 {
     $friday = Registration::where(DB::raw('DAYOFWEEK(registrations.created_at)'), '=', 6)->sum('tickets');
     $saturday = Registration::where(DB::raw('DAYOFWEEK(registrations.created_at)'), '=', 7)->sum('tickets');
     $this->layout->with('subtitle', '');
     $this->layout->content = View::make('home')->with('friday_registration_count', $friday)->with('saturday_registration_count', $saturday);
 }
开发者ID:ajwgibson,项目名称:illuminate,代码行数:7,代码来源:HomeController.php


示例11: RegisterUser

 public static function RegisterUser($regData)
 {
     global $db;
     $info = ['emptyData' => false, 'emailUse' => false, 'userUse' => false, 'falseEmail' => false, 'pwNotMatch' => false, 'success' => false];
     if (empty($regData['username']) || empty($regData['email']) || empty($regData['password'])) {
         $info['emptyData'] = true;
     } else {
         if ($regData['password'] != $regData['password2']) {
             $info['pwNotMatch'] = true;
         } else {
             if (!Main::ValidEmail($regData['email'])) {
                 $info['falseEmail'] = true;
             } else {
                 $regData['username'] = $db->SafeString($regData['username']);
                 $regData['email'] = $db->SafeString($regData['email']);
                 $regData['password'] = $db->SafeString($regData['password']);
                 $mailCheck = Registration::CheckEmail($regData['email']);
                 $userCheck = Registration::CheckUsername($regData['username']);
                 if (!$mailCheck && !$userCheck) {
                     $password = Main::HyperHash($regData['password']);
                     $q = "INSERT INTO `" . $db->prefix . "users` (`hbbid`, `name`, `password`, `email`, `member_group`, `register_date`, `salt`) VALUES\r\n\t\t\t\t\t('" . userHash($regData['username'], $regData['email']) . "', '" . $regData['username'] . "',\r\n\t\t\t\t\t'" . $password['password'] . "', '" . $regData['email'] . "', '3', '" . time() . "', '" . $password['salt'] . "')";
                     $db->Query($q);
                     $info['success'] = true;
                 } else {
                     if ($mailCheck) {
                         $info['emailUse'] = true;
                     } else {
                         $info['userUse'] = true;
                     }
                 }
             }
         }
     }
     return $info;
 }
开发者ID:ChampaWasTaken,项目名称:HyperBB,代码行数:35,代码来源:register.class.php


示例12: updateContact

 function updateContact()
 {
     if (isset($_POST["contactId"])) {
         $phone = Registration::normalizePhoneNumber($_POST["phone"]);
         Loans::updateContact($_POST["contactId"], $_POST["name"], $_POST["mail"], $phone);
     }
 }
开发者ID:Swapon444,项目名称:Patrimoine,代码行数:7,代码来源:managecontacts.php


示例13: index

 /**
  * Displays a tabular list of registrations.
  */
 public function index()
 {
     $this->layout->with('subtitle', 'Registrations');
     $registrations = Registration::orderBy('registrations.created_at', 'desc')->join('bookings', 'registrations.booking_id', '=', 'bookings.id', 'left outer')->addSelect('registrations.*')->addSelect('bookings.first')->addSelect('bookings.last')->addSelect('bookings.email');
     $filtered = false;
     $filter_name = Session::get('registrations_filter_name', '');
     $filter_email = Session::get('registrations_filter_email', '');
     $filter_friday = Session::get('registrations_filter_friday', '');
     $filter_saturday = Session::get('registrations_filter_saturday', '');
     if (!empty($filter_name)) {
         $registrations = $registrations->where(function ($query) use($filter_name) {
             $query->where('bookings.first', 'LIKE', "%{$filter_name}%")->orWhere('bookings.last', 'LIKE', "%{$filter_name}%")->orWhere('registrations.name', 'LIKE', "%{$filter_name}%");
         });
         $filtered = true;
     }
     if (!empty($filter_email)) {
         $registrations = $registrations->where(function ($query) use($filter_email) {
             $query->where('bookings.email', 'LIKE', "%{$filter_email}%")->orWhere('registrations.email_address', 'LIKE', "%{$filter_email}%");
         });
         $filtered = true;
     }
     if (!empty($filter_friday)) {
         $registrations = $registrations->where(DB::raw('DAYOFWEEK(registrations.created_at)'), '=', 6);
         $filtered = true;
     }
     if (!empty($filter_saturday)) {
         $registrations = $registrations->where(DB::raw('DAYOFWEEK(registrations.created_at)'), '=', 7);
         $filtered = true;
     }
     $registrations = $registrations->paginate(25);
     $this->layout->content = View::make('registrations.index')->with('registrations', $registrations)->with('filtered', $filtered)->with('filter_name', $filter_name)->with('filter_email', $filter_email)->with('filter_friday', $filter_friday)->with('filter_saturday', $filter_saturday);
 }
开发者ID:ajwgibson,项目名称:capacity,代码行数:35,代码来源:RegistrationController.php


示例14: registerNumberAction

 /** REGISTER NUMBER ***/
 public function registerNumberAction()
 {
     $request = $this->getRequest();
     $debug = true;
     $result = false;
     $username = null;
     $nickname = null;
     if ($request->isPost()) {
         $data = $request->getPost();
         $username = $data['number'];
         // Telephone number including the country code without '+' or '00'.
         $nickname = $data['nickname'];
         $register = new \Registration($username, $debug);
         $result = $register->codeRequest('sms');
     }
     return new ViewModel(array('result' => $result, 'username' => $username, 'nickname' => $nickname));
 }
开发者ID:dFenille,项目名称:whatsApi,代码行数:18,代码来源:IndexController.php


示例15: getInstance

 public static function getInstance()
 {
     if (self::$instance === null)
     {
         self::$instance = new Registration();
     }
     return self::$instance;
 }
开发者ID:hlag,项目名称:svs,代码行数:8,代码来源:Registration.php


示例16: updatePassword

 function updatePassword()
 {
     if (isset($_POST["UserId"])) {
         $salt = Registration::generateSalt();
         $crypt = crypt($_POST["Password"], $salt);
         Users::updatePassword($_POST["UserId"], $crypt, $salt);
     }
 }
开发者ID:Swapon444,项目名称:Patrimoine,代码行数:8,代码来源:manageprofile.php


示例17: register

 function register($user, $pswd, $email)
 {
     $reg = new Registration();
     $reg->SetUsername($user);
     $reg->SetPassword($pswd);
     $reg->SetEmail($email);
     $error = $reg->InsertUserToSql();
     // see notes at the class
     if ((!empty($error['2']) || !empty($error['0'])) && $error[0] != '00000') {
         $res["success"] = FALSE;
         $res["msg"] = implode($error, ',');
     } else {
         $res["success"] = TRUE;
         $res["msg"] = "The user was added successfully";
     }
     return $res;
 }
开发者ID:apocoder,项目名称:ExtDesk,代码行数:17,代码来源:class.user.php


示例18: run

 public function run($code)
 {
     $recovery = RecoveryPassword::model()->with('user')->find('code = :code', array(':code' => $code));
     if (!$recovery) {
         Yii::log(Yii::t('user', 'Код восстановления пароля {code} не найден!', array('{code}' => $code)), CLogger::LEVEL_ERROR, UserModule::$logCategory);
         Yii::app()->user->setFlash(YFlashMessages::ERROR_MESSAGE, Yii::t('user', 'Код восстановления пароля не найден! Попробуйте еще раз!'));
         $this->controller->redirect(array('/user/account/recovery'));
     }
     // автоматическое восстановление пароля
     if (Yii::app()->getModule('user')->autoRecoveryPassword) {
         $newPassword = Registration::model()->generateRandomPassword();
         $recovery->user->password = Registration::model()->hashPassword($newPassword, $recovery->user->salt);
         $transaction = Yii::app()->db->beginTransaction();
         try {
             if ($recovery->user->save() && RecoveryPassword::model()->deleteAll('user_id = :user_id', array(':user_id' => $recovery->user->id))) {
                 $transaction->commit();
                 $emailBody = $this->controller->renderPartial('application.modules.user.views.email.passwordAutoRecoverySuccessEmail', array('model' => $recovery->user, 'password' => $newPassword), true);
                 Yii::app()->mail->send(Yii::app()->getModule('user')->notifyEmailFrom, $recovery->user->email, Yii::t('user', 'Успешное восстановление пароля!'), $emailBody);
                 Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Новый пароль отправлен Вам на email!'));
                 Yii::log(Yii::t('user', 'Успешное восстановление пароля!'), CLogger::LEVEL_ERROR, UserModule::$logCategory);
                 $this->controller->redirect(array('/user/account/login'));
             }
         } catch (CDbException $e) {
             $transaction->rollback();
             Yii::app()->user->setFlash(YFlashMessages::ERROR_MESSAGE, Yii::t('user', 'Ошибка при смене пароля!'));
             Yii::log(Yii::t('user', 'Ошибка при автоматической смене пароля {error}!', array('{error}' => $e->getMessage())), CLogger::LEVEL_ERROR, UserModule::$logCategory);
             $this->controller->redirect(array('/user/account/recovery'));
         }
     }
     // выбор своего пароля
     $changePasswordForm = new ChangePasswordForm();
     // если отправили фому с новым паролем
     if (Yii::app()->request->isPostRequest && isset($_POST['ChangePasswordForm'])) {
         $changePasswordForm->setAttributes($_POST['ChangePasswordForm']);
         if ($changePasswordForm->validate()) {
             $transaction = Yii::app()->db->beginTransaction();
             try {
                 // смена пароля пользователя
                 $recovery->user->password = Registration::model()->hashPassword($changePasswordForm->password, $recovery->user->salt);
                 // удалить все запросы на восстановление для данного пользователя
                 if ($recovery->user->save() && RecoveryPassword::model()->deleteAll('user_id = :user_id', array(':user_id' => $recovery->user->id))) {
                     $transaction->commit();
                     Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Пароль изменен!'));
                     Yii::log(Yii::t('user', 'Успешная смена пароля для пользоателя {user}!', array('{user}' => $recovery->user->id)), CLogger::LEVEL_INFO, UserModule::$logCategory);
                     $emailBody = $this->controller->renderPartial('application.modules.user.views.email.passwordRecoverySuccessEmail', array('model' => $recovery->user), true);
                     Yii::app()->mail->send(Yii::app()->getModule('user')->notifyEmailFrom, $recovery->user->email, Yii::t('user', 'Успешное восстановление пароля!'), $emailBody);
                     $this->controller->redirect(array('/user/account/login'));
                 }
             } catch (CDbException $e) {
                 $transaction->rollback();
                 Yii::app()->user->setFlash(YFlashMessages::ERROR_MESSAGE, Yii::t('user', 'Ошибка при смене пароля!'));
                 Yii::log(Yii::t('Ошибка при смене пароля {error}!', array('{error}' => $e->getMessage())), CLogger::LEVEL_ERROR, UserModule::$logCategory);
                 $this->controller->redirect(array('/user/account/recovery'));
             }
         }
     }
     $this->controller->render('changePassword', array('model' => $changePasswordForm));
 }
开发者ID:RSol,项目名称:yupe,代码行数:58,代码来源:RecoveryPasswordAction.php


示例19: process

 function process($parameters)
 {
     $registration = new Registration();
     if (!$registration->checkIfAdmin($_SESSION['id_user'])) {
         $this->redirect('error');
     }
     //catch registration (button is pressed)
     if (isset($_POST['sent'])) {
         $data = $registration->sanitize(["email" => $_POST['email'], "tariff" => $_POST['tariff'], "firstname" => $_POST['firstname'], "surname" => $_POST['surname'], "telephone" => $_POST['telephone'], 'address' => $_POST['address'], "startDate" => $_POST['startDate'], "ic" => $_POST['ic'], "p" => $registration->getRandomHash()]);
         $this->data = $data;
         //for autofilling from previous page
         $result = $registration->validateData($data);
         if ($result['s'] == 'success') {
             $fakturoid = new FakturoidWrapper();
             $newCustomer = $fakturoid->createCustomer($data);
             if ($newCustomer == false) {
                 $result = ['s' => 'error', 'cs' => 'Bohužel se nepovedlo uložit data do Faktuoidu; zkus to prosím za pár minut', 'en' => 'Sorry, we didn\'n safe your data into Fakturoid; try it again after a couple of minutes please'];
             } else {
                 //add fakturoid_id into data structure
                 $data['fakturoid_id'] = $newCustomer->id;
                 $result = $registration->registerUser($data, $this->language);
             }
         }
         //change success message for admin
         if ($result['s'] == 'success') {
             $result = ['s' => 'success', 'cs' => 'Nový uživatel je úspěšně zaregistrován', 'en' => 'New member is successfully registred'];
         }
         $this->messages[] = $result;
     }
     $this->header['title'] = ['cs' => 'Registrace nového uživatele', 'en' => 'Registration of new user'];
     $this->data['tariffs'] = $registration->returnTariffsData($this->language);
     $this->view = 'forceRegistration';
 }
开发者ID:ParalelniPolis,项目名称:TMS2,代码行数:33,代码来源:ForceRegistrationController.php


示例20: actionCompetitors

 public function actionCompetitors()
 {
     $registrations = Registration::model()->with('user')->findAllByAttributes(array('competition_id' => $this->iGet('id'), 'status' => Registration::STATUS_ACCEPTED), array('order' => 'date ASC'));
     $names = array();
     foreach ($registrations as $registration) {
         $names[] = $registration->user->getAttributeValue('name', true);
     }
     $this->ajaxOK($names);
 }
开发者ID:sunshy360,项目名称:cubingchina,代码行数:9,代码来源:ToolsController.php



注:本文中的Registration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Registry类代码示例发布时间:2022-05-23
下一篇:
PHP Register类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap