Exemplo n.º 1
0
 /**
  * store user method.
  *
  * Method is called after user data is stored in the database
  *
  * @param 	array		holds the new user data
  * @param 	bool		true if a new user is stored
  * @param	bool		true if user was succesfully stored in the database
  * @param	string		message
  */
 public function onAfterStoreUser($user, $isnew, $succes, $msg)
 {
     $this->_createToken($user['username']);
     $userId = $user['id'];
     if ($this->_person) {
         //unblock the user
         $user = KService::get('repos://site/users')->find($userId);
         $user->block = false;
         $user->save();
         $user = $this->_api->getUser();
         if (KRequest::get('post.import_avatar', 'cmd') && $user->large_avatar) {
             $this->_person->setPortraitImage(array('url' => $user->large_avatar));
         }
         $this->_person->enabled = true;
         $this->_person->save();
     }
 }