当前位置: 首页>>代码示例>>PHP>>正文


PHP Model_User::setEmail方法代码示例

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


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

示例1: rejestracjaAction

 public function rejestracjaAction()
 {
     $form = new Form_Register();
     $request = $this->getRequest();
     if ($request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $data = $form->getValues();
             $model = new Model_User();
             $model->setFirstname($data['firstname']);
             $model->setLastname($data['lastname']);
             $model->setUsername($data['username']);
             $model->setPassword(md5($data['password']));
             $model->setEmail($data['email']);
             $mapper = Model_UserMapper::getInstance();
             $mapper->save($model);
             $this->createConfig($data['username']);
             $server = new Zend_View_Helper_ServerUrl();
             $server->setScheme('http');
             $this->_redirect($server->serverUrl($this->view->url(array('controller' => 'autentykacja', 'action' => 'logowanie'))));
             //                $this->_redirect('/autentykacja/logowanie');
         } else {
             $this->view->errorMessage = 'Nie uzupełniono wymaganych pól.';
         }
     }
     $this->view->form = $form;
 }
开发者ID:BGCX261,项目名称:zieli-svn-to-git,代码行数:26,代码来源:UzytkownicyController.php

示例2: _populate

 protected function _populate($data)
 {
     $obj = new Model_User();
     $obj->setId($data['id']);
     $obj->setUsername($data['username']);
     $obj->setFirstname($data['firstname']);
     $obj->setLastname($dane['lastname']);
     $obj->setEmail($dane['email']);
     $obj->setPassword($dane['password']);
     return $obj;
 }
开发者ID:BGCX261,项目名称:zieli-svn-to-git,代码行数:11,代码来源:UserMapper.php

示例3: registerprocessAction

 public function registerprocessAction()
 {
     $request = $this->getRequest();
     // Check if we have a POST request
     if (!$request->isPost()) {
         return $this->_helper->redirector('register');
     }
     // Get our form and validate it
     $form = $this->getRegisterForm();
     if (!$form->isValid($request->getPost())) {
         // Invalid entries
         $this->view->form = $form;
         $this->getLog()->warn("Registration attempt failed");
         return $this->render('register');
         // re-render the login form
     }
     $values = $form->getValues();
     // generate user uri
     $fullname = $values['firstname'] . " " . $values['lastname'];
     $uri = $this->getLA()->getUriForTitle($fullname, LOOMP::User());
     $activationkey = md5(microtime() . $uri);
     // create user account in db
     $user = new Model_User();
     $user->setEmail($values['mail'])->setPassword($values['password'])->setActivation($activationkey)->setActive(false)->setUserlevel(Model_User::USER_LEVEL_USER)->setUri($uri)->setFirstname($values['firstname'])->setLastname($values['lastname'])->setOrganisation($values['organisation']);
     if (!$user->save()) {
         $this->getLog()->err("Registration for {$user} failed - " . $user->ErrorMsg());
         return $this->render('register');
     }
     $this->getLog()->info("Registration for {$user} succeeded");
     $server_config = Zend_Registry::getInstance()->configuration->server;
     $activation_link = LOOMP_BASE_PATH . $this->view->url(array('controller' => 'login', 'action' => 'activate'), 'default', true) . "?key=" . $activationkey;
     // send e-mail to user
     $mail = new Zend_Mail('UTF-8');
     $mail->setBodyHTML("Welcome to LOOMP!\n <a href='{$activation_link}'>Activate your account by clicking here</a>.");
     $mail->setFrom('loomp@' . $server_config->host, 'LOOMP Registration');
     $mail->addTo($user->getEmail(), $user->getFullname());
     $mail->setSubject("Account Activation for " . $user->getFullname());
     $mail->send();
     $this->getLog()->info("Registration mail sent to " . $user->getEmail());
     // display thanks page
     $this->view->mail = $user->getEmail();
     // do nothing, thank you page will be rendered
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:43,代码来源:LoginController.php

示例4: signUpAction

 public function signUpAction()
 {
     if (!$this->_request->isXmlHttpRequest()) {
         return;
     }
     $arp = new AjaxResponse();
     $arp->setStatus(AjaxResponse::STATUS_FAILED);
     $email = trim($this->_getParam('email'));
     $password = trim($this->_getParam('password'));
     if (empty($email) || empty($password)) {
         $this->json($arp);
         return;
     }
     if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
         $arp->addErrorItem('email', 'You entered an invalid E-mail address.');
         $this->json($arp);
         return;
     }
     $emailExists = Model_User::isEmailExists($email);
     if ($emailExists) {
         $arp->addErrorItem('email', 'E-mail address already exists.');
         $this->json($arp);
         return;
     }
     $hashedPassword = hash('sha256', $password);
     $user = new Model_User();
     $user->setEmail($email);
     $user->setPassword($hashedPassword);
     $user->setCreatedTime(time());
     $user->save();
     $this->setLoginCookie($email, $hashedPassword);
     $arp->setStatus(AjaxResponse::STATUS_OK);
     $this->json($arp);
 }
开发者ID:RobertCar,项目名称:RobertCarrential,代码行数:34,代码来源:PrivateCarController.php


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