Esempio n. 1
0
 protected function moods($argValues)
 {
     if ($this->method == 'GET') {
         try {
             $userId = authaccess::getValidUserId($argValues[0]);
             $history = moodhistory::getLastestMoods($userId, $argValues[1]);
             return $history;
         } catch (Exception $e) {
             return "ERROR - EXPIRED OR INVALID TOKEN";
         }
     } else {
         if ($this->method == 'POST') {
             try {
                 $userId = authaccess::getValidUserId($argValues[0]);
                 $history = moodhistory::addMood($userId, $this->input->groupId, $this->input->moodId);
                 return $history;
             } catch (Exception $e) {
                 return "ERROR - EXPIRED OR INVALID TOKEN";
             }
         } else {
             return "ERROR - NOT WORKING" . print_r($this->input, true);
         }
     }
 }