コード例 #1
0
ファイル: UnitService.function.php プロジェクト: jfefes/ORK3
function GetAttributeList($request)
{
    $response = array('Status' => ServiceErrorIds::FunctionUnimplemented, 'Error' => Unimplemented(), 'ComponentAttributeList' => array());
    if (!TokenIsSecure($request['SecureToken'])) {
        $response['Error'] = BadToken();
        $response['Status'] = $response['Error']['Code'];
        return $response;
    }
    $m = new yapo_mysql(DB_HOSTNAME, DB_DATABASE, DB_USERNAME, DB_PASSWORD);
    $y = new yapo($m, DB_PREFIX . 'cattribute');
    if ($y->find()) {
        do {
            $response['AttributeList'][] = array('AttributeId' => $y->cattribute_id, 'Name' => $y->attribute_name);
        } while ($y->next());
    }
    return $response;
}
コード例 #2
0
ファイル: Authorization.php プロジェクト: jfefes/ORK3
 public function RemoveAuthorization($request)
 {
     logtrace('RemoveAuthorization', $request);
     $response = [];
     if (is_null($request['AuthorizationId']) || !$request['AuthorizationId'] > 0) {
         $response = ProcessingError("AuthorizationId is not set.");
         return $response;
     } else {
         if (($requester_id = $this->IsAuthorized($request['Token'])) > 0) {
             $this->auth->clear();
             $this->auth->authorization_id = $request['AuthorizationId'];
             if ($this->auth->find()) {
                 list($type, $id) = $this->DetermineAuthType();
                 if ($this->HasAuthority($requester_id, $type, $id, AUTH_CREATE)) {
                     // Any call to an Authorization may have side-effects in the Auth table
                     $response = $this->remove_auth_h($request);
                 } else {
                     if ($type == AUTH_UNIT) {
                         $mundane = Ork3::$Lib->player->player_info($requester_id);
                         if ($this->HasAuthority($requester_id, AUTH_KINGDOM, $mundane['KingdomId'], AUTH_EDIT)) {
                             logtrace("RemoveAuthorization(): KPM Unit Bypass: "******"RemoveAuthorization(): BadToken: ", $requester_id);
             $response = BadToken();
         }
     }
     return $response;
 }