コード例 #1
0
ファイル: OnlineController.php プロジェクト: sujinw/passport
 /**
  * 将用户添加到在线列表
  *
  * @param integer $uid     用户ID
  * @param string  $ticket  单点登录票据
  * @throws ResourceException
  */
 public function postUserAction($uid, $ticket = '')
 {
     if ($ticket == '') {
         $ticket = Hash::unique_string();
     }
     $online = new Online();
     $online->ticket = $ticket;
     $online->UID = $uid;
     if ($online->create()) {
         $this->response(200, 'OK');
     } else {
         throw new ResourceException('Internal Server Error', 500);
     }
 }