Пример #1
0
 public function register($name, $email, $password, $captcha)
 {
     // verify captcha if secret is available
     $secret = $this->config->getValue('recaptcha_secret');
     if (!empty($secret)) {
         $this->verifyCaptcha($captcha, $secret);
     }
     $scopes = $this->getDefaultScopes();
     $userId = $this->user->create(Table\User::STATUS_DISABLED, $name, $email, $password, $scopes);
     // send activation mail
     $this->sendActivationMail($userId, $name, $email);
 }
Пример #2
0
 /**
  * Returns the POST response
  *
  * @param \PSX\Record\RecordInterface $record
  * @return array|\PSX\Record\RecordInterface
  */
 protected function doPost($record)
 {
     $this->userService->create($record->status, $record->name, $record->email, $record->password, $record->scopes);
     return array('success' => true, 'message' => 'User successful created');
 }