コード例 #1
0
ファイル: UserManager.php プロジェクト: samuvack/admin
 /**
  * Validate a user object.
  *
  * Invokes User::validate(),
  * and additionally tests that the User's email address and username (if set) are unique across all users.'.
  *
  * @param User $user
  * @return array An array of error messages, or an empty array if the User is valid.
  */
 public function validate(AUser $user)
 {
     $errors = $user->validate();
     // If username is required, ensure it is set.
     if ($this->isUsernameRequired && !$user->getRealUsername()) {
         $errors['username'] = '******';
     }
     return $errors;
 }
コード例 #2
0
ファイル: Mailer.php プロジェクト: samuvack/admin
 public function sendResetMessage(AUser $user)
 {
     $url = $this->baseUrl . $this->urlGenerator->generate(self::ROUTE_RESET_PASSWORD, array('token' => $user->getConfirmationToken()), true);
     $context = array('user' => $user, 'resetUrl' => $url);
     $this->sendMessage($this->resetTemplate, $context, $this->getFromEmail(), $user->getEmail());
 }