Esempio n. 1
0
 public function getChatsResponse()
 {
     $chats = array();
     if (is_array($this->getResource())) {
         foreach ($this->getResource() as $chat) {
             $chat->time = array('hours' => gmdate('H', strtotime($chat->ts)), 'minutes' => gmdate('i', strtotime($chat->ts)));
             $chat->gravatar = Helper::gravatarFromHash($chat->gravatar);
             $chats[] = $chat;
         }
         $response = array('chats' => $chats);
         return json_encode($response);
     }
     return json_encode(array('chats' => $chats));
 }
Esempio n. 2
0
 public function getLoginResponse()
 {
     $response = array('status' => 1, 'name' => $this->getName(), 'gravatar' => Helper::gravatarFromHash($this->getGravatar()));
     return json_encode($response);
 }
Esempio n. 3
0
 public function checkloggedAction()
 {
     $response = array('logged' => false);
     if ($_SESSION['user']['name']) {
         $response['logged'] = true;
         $response['loggedAs'] = array('name' => $_SESSION['user']['name'], 'gravatar' => Helper::gravatarFromHash($_SESSION['user']['gravatar']));
     }
     $this->response = json_encode($response);
     return $this->response;
 }