Ejemplo n.º 1
0
 /**	 
  * get detailed information about a person
  * @param string $format
  * @param string $username
  * @return string xml/json
  */
 private function personget($format, $username = '')
 {
     if (empty($username)) {
         $user = $this->checkpassword();
     } else {
         $user = $this->checkpassword(false);
     }
     $this->checktrafficlimit($user);
     if (empty($username)) {
         $username = $user;
     }
     $DBuser = OCSUser::get_user_info($username);
     if (is_null($DBuser)) {
         $txt = $this->generatexml($format, 'failed', 101, 'person not found');
         echo $txt;
     } else {
         if (empty($user)) {
         } else {
             $xml = array();
             $xml[0]['personid'] = $DBuser['login'];
             $xml[0]['firstname'] = $DBuser['firstname'];
             $xml[0]['lastname'] = $DBuser['lastname'];
             $xml[0]['email'] = $DBuser['email'];
             //$xml[0]['description']=H01_UTIL::bbcode2html($DBuser['description']);
             $txt = $this->generatexml($format, 'ok', 100, '', $xml, 'person', 'full', 2);
             //$txt=$this->generatexml($format,'failed',102,'data is private');
             echo $txt;
         }
     }
 }