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


PHP User::setEmail方法代码示例

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


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

示例1: setEmail

 /**
  * Set email
  *
  * @return string
  */
 public function setEmail($email)
 {
     $email = is_null($email) ? '' : $email;
     parent::setEmail($email);
     $this->setUsername($email);
     return $this;
 }
开发者ID:nfqakademija,项目名称:cooFood,代码行数:12,代码来源:User.php

示例2: updateParent

 public function updateParent()
 {
     parent::setEmail($this->getEmail());
     parent::setEmailCanonical($this->getEmailCanonical());
     parent::setPassword($this->getPassword());
     parent::setUsername($this->getUsername());
     parent::setUsernameCanonical($this->getUsernameCanonical());
 }
开发者ID:artz20,项目名称:Tv-shows-zone,代码行数:8,代码来源:UserProxy.php

示例3: setUserData

 /**
  * Set user data using shibboleth heders as data source
  *
  * @param \FOS\UserBundle\Entity\User                             $user
  * @param \KULeuven\ShibbolethBundle\Security\ShibbolethUserToken $token
  */
 private function setUserData(BaseUser $user, ShibbolethUserToken $token)
 {
     if ($user instanceof User) {
         $user->setGivenName($token->getGivenName());
         $user->setSurname($token->getSurname());
     }
     $user->setPlainPassword('no_passwd');
     if (null != $token->getMail()) {
         $user->setEmail($token->getMail());
     } else {
         $user->setEmail($token->getUsername() . '@kuleuven.be');
     }
     if ($token->isStudent()) {
         $user->addRole('ROLE_STUDENT');
     } elseif ($token->isStaff()) {
         $user->addRole('ROLE_STAFF');
     } else {
         $user->addRole('ROLE_GUEST');
     }
     $user->addRole('ROLE_USER');
     $user->setEnabled(true);
     $this->userManager->updateUser($user);
 }
开发者ID:rejsmont,项目名称:LabDB,代码行数:29,代码来源:ShibbolethUserProvider.php

示例4: setEmail

 /**
  * @param string $email
  *
  * @return User
  */
 public function setEmail($email)
 {
     parent::setEmail($email);
     $this->setUsername($email);
     return $this;
 }
开发者ID:roman-movchan,项目名称:salefactor,代码行数:11,代码来源:User.php

示例5: setEmail

 public function setEmail($email)
 {
     parent::setEmail($email);
     $this->setUsername($this->getEmail());
 }
开发者ID:2remdou,项目名称:nicetruc,代码行数:5,代码来源:User.php

示例6: setUserData

 /**
  * Set user data using imap data source
  *
  * @param \FOS\UserBundle\Entity\User                             $user
  * @param \Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken $token
  */
 private function setUserData(BaseUser $user, UsernamePasswordToken $token)
 {
     $parts = $this->emailParser->parse($user->getUsername());
     $this->verifyDomain($parts['domain']);
     $localPart = $parts['local'];
     $unumber = str_replace('u', '', $localPart);
     $url = "http://www.kuleuven.be/wieiswie/en/person/" . $unumber;
     $ch = curl_init();
     $timeout = 5;
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
     $html = curl_exec($ch);
     curl_close($ch);
     $dom = new \DOMDocument();
     @$dom->loadHTML($html);
     $uname = "";
     foreach ($dom->getElementsByTagName('h1') as $h1) {
         $uname = $h1->nodeValue;
     }
     $uemail = "";
     foreach ($dom->getElementsByTagName('script') as $script) {
         $emailPre = trim($script->nodeValue);
         if (!empty($emailPre)) {
             $emailPre = str_replace('document.write(String.fromCharCode(', '', $emailPre);
             $emailPre = str_replace('))', '', $emailPre);
             $emailArray = explode(',', $emailPre);
             $emailLink = "";
             foreach ($emailArray as $element) {
                 $emailLink .= chr(eval('return ' . $element . ';'));
             }
             $domInner = new \DOMDocument();
             @$domInner->loadHTML($emailLink);
             foreach ($domInner->getElementsByTagName('a') as $a) {
                 $uemail = $a->nodeValue;
             }
         }
     }
     $names = explode(" ", $uname);
     $mailparts = $this->emailParser->parse($uemail);
     $mailuname = $mailparts['local'];
     $mailnames = explode(".", $mailuname);
     $surnameIndex = 0;
     foreach ($names as $index => $name) {
         if (strtolower(substr($mailnames[1], 0, strlen($name))) === strtolower($name)) {
             $surnameIndex = $index;
         }
     }
     if ($user instanceof User) {
         $givenName = implode(" ", array_slice($names, 0, $surnameIndex));
         $user->setGivenName($givenName);
         $lastName = implode(" ", array_slice($names, $surnameIndex));
         $user->setSurname($lastName);
     }
     $user->setEmail($uemail);
     $user->setPlainPassword($this->generateRandomString());
     $user->addRole('ROLE_USER');
     $user->addRole('ROLE_KULEUVEN');
     $user->setEnabled(true);
     $this->userManager->updateUser($user);
 }
开发者ID:rejsmont,项目名称:LabDB,代码行数:67,代码来源:ImapUserProvider.php

示例7: setEmail

 /**
  * Set the email and username.
  *
  * @param string $email
  *
  * @return User
  */
 public function setEmail($email)
 {
     parent::setUsername($email);
     return parent::setEmail($email);
 }
开发者ID:ubermichael,项目名称:pkppln-php,代码行数:12,代码来源:User.php

示例8: setEmail

 /**
  * @param string $email
  * @return \Network\StoreBundle\Entity\User
  */
 public function setEmail($email)
 {
     parent::setEmail($email);
     if (empty($this->username)) {
         $this->setUsername($email);
     }
     return $this;
 }
开发者ID:rotanov,项目名称:fefu-social-network,代码行数:12,代码来源:User.php

示例9: setEmail

 public function setEmail($e)
 {
     parent::setEmail($e);
     $this->setUsername($e);
 }
开发者ID:Rexota,项目名称:cdn-server,代码行数:5,代码来源:User.php

示例10: setEmail

 public function setEmail($email)
 {
     parent::setEmail($email);
     $this->username = $email;
     return $this;
 }
开发者ID:Chablo,项目名称:btsappliwebrepository,代码行数:6,代码来源:User.php

示例11: setEmail

 /**
  * @param string $email
  */
 public function setEmail($email)
 {
     $this->setUsername($email);
     parent::setEmail($email);
 }
开发者ID:raymonschouwenaar,项目名称:website,代码行数:8,代码来源:Dojo.php

示例12: setEmail

 /**
  * Sets the email.
  *
  * @param string $email
  * @return void
  */
 public function setEmail($email)
 {
     if ($this->username === null) {
         $this->setUsername($email);
     }
     parent::setEmail($email);
 }
开发者ID:geoffreytran,项目名称:zym,代码行数:13,代码来源:User.php

示例13: setUserData

 /**
  * Set user data using imap data source
  *
  * @param \FOS\UserBundle\Entity\User                             $user
  * @param \Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken $token
  */
 private function setUserData(BaseUser $user, UsernamePasswordToken $token)
 {
     $email = $user->getUsername();
     $parts = $this->emailParser->parse($email);
     $this->verifyDomain($parts['domain']);
     $userNameArray = explode('.', $parts['local']);
     if ($user instanceof User) {
         $givenName = ucfirst($userNameArray[0]);
         $user->setGivenName($givenName);
         $lastName = ucfirst($userNameArray[1]);
         $user->setSurname($lastName);
     }
     $user->setEmail($email);
     $user->setPlainPassword($this->generateRandomString());
     $user->addRole('ROLE_USER');
     $user->addRole('ROLE_ICM');
     $user->setEnabled(true);
     $this->userManager->updateUser($user);
 }
开发者ID:rejsmont,项目名称:LabDB,代码行数:25,代码来源:ImapUserProvider.php


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