예제 #1
0
function getNewToken($id, $secret)
{
    $post = "grant_type=client_credentials&scope=send_notification";
    $ret = makePost("https://api.hipchat.com/v2/oauth/token", $post, $id, $secret);
    LogMe("getNewToken: {$ret}");
    $json = json_decode($ret);
    return $json;
}
예제 #2
0
 private function addBadge($badge, $user, $from, $reason)
 {
     LogMe("addBadge {$badge} {$user} {$from} {$reason}");
     $b = $this->getBadge($badge);
     if (!$b) {
         $this->db->exec("INSERT INTO badges (`badge`) VALUES('" . addslashes($badge) . "')");
         $b = $this->getBadge($badge);
     }
     $this->db->exec("INSERT INTO awards (`badgeid`, `user`, `user2`, `reason`) VALUES('" . $b['id'] . "', '" . addslashes($user) . "', '" . addslashes($from) . "', '" . addslashes($reason) . "')");
 }