Esempio n. 1
0
 /**
  * Get detailed information about the current user in JSON.
  * 
  * - id
  * - login
  * - first_name
  * - last_name
  * - email
  * - lang
  * - roles
  * 
  * @throws common_Exception If the 'userid' parameter is missing.
  */
 public function getUserInfo()
 {
     if (!$this->hasRequestParameter('userid')) {
         throw new common_Exception("Missing parameter 'userid'");
     }
     $user = new core_kernel_classes_Resource($this->getRequestParameter('userid'));
     return $this->returnSuccess(array('info' => tao_actions_UserApi::buildInfo($user)));
 }
Esempio n. 2
0
 /**
  * Allows a remote system to connect a tao User
  */
 public function login()
 {
     $user = $this->doLogin();
     if ($user == false) {
         return $this->returnFailure(__('Login failed'));
     } else {
         $this->returnSuccess(array('user' => tao_actions_UserApi::buildInfo($user)));
     }
 }