gluu
公開メンバ関数 | 限定公開変数類 | 静的限定公開変数類 | 非公開変数類 | 全メンバ一覧
oxdrp\Uma_rs_check_access クラス
oxdrp\Uma_rs_check_access の継承関係図
Inheritance graph
oxdrp\Uma_rs_check_access 連携図
Collaboration graph

公開メンバ関数

 __construct ()
 
 getRequestOxdId ()
 
 getResponseTicket ()
 
 setRequestOxdId ($request_oxd_id)
 
 getRequestRpt ()
 
 setRequestRpt ($request_rpt)
 
 getRequestPath ()
 
 setRequestPath ($request_path)
 
 getRequestHttpMethod ()
 
 setRequestHttpMethod ($request_http_method)
 
 getResponseAccess ()
 
 setCommand ()
 
 setParams ()
 
 request ()
 
 getResponseStatus ()
 
 setResponseStatus ()
 
 getResponseData ()
 
 getData ()
 
 getCommand ()
 
 getResponseObject ()
 
 getResponseJSON ()
 
 getParams ()
 
 is_JSON ($string)
 
 define_variables ($configOBJECT)
 
 oxd_socket_request ($data, $char_count=8192)
 
 error_message ($error)
 
 log ($process, $message)
 

限定公開変数類

 $command
 
 $params = array()
 
 $data = array()
 
 $response_json
 
 $response_object
 
 $response_status
 
 $response_data = array()
 
 $base_url = __DIR__
 

静的限定公開変数類

static $socket = null
 

非公開変数類

 $request_oxd_id = null
 
 $request_rpt = null
 
 $request_path = null
 
 $request_http_method = null
 
 $response_access
 
 $response_ticket
 

詳解

構築子と解体子

◆ __construct()

oxdrp\Uma_rs_check_access::__construct ( )

Constructor

戻り値
void
106  {
107  parent::__construct(); // TODO: Change the autogenerated stub
108  }

関数詳解

◆ define_variables()

oxdrp\Client_Socket_OXD_RP::define_variables (   $configOBJECT)
inherited

Defining oxd-setting.json file for static object Oxd_RP_config

戻り値
void
105  {
106  Oxd_RP_config::$op_host = $configOBJECT->op_host;
107  Oxd_RP_config::$oxd_host_port = $configOBJECT->oxd_host_port;
108  Oxd_RP_config::$authorization_redirect_uri = $configOBJECT->authorization_redirect_uri;
109  Oxd_RP_config::$post_logout_redirect_uri = $configOBJECT->post_logout_redirect_uri;
110  Oxd_RP_config::$scope = $configOBJECT->scope;
111  Oxd_RP_config::$application_type = $configOBJECT->application_type;
112  Oxd_RP_config::$response_types = $configOBJECT->response_types;
113  Oxd_RP_config::$grant_types = $configOBJECT->grant_types;
114  Oxd_RP_config::$acr_values = $configOBJECT->acr_values;
115 
116  }
static $op_host
Definition: Oxd_RP_config.php:67
static $authorization_redirect_uri
Definition: Oxd_RP_config.php:77
static $application_type
Definition: Oxd_RP_config.php:92
static $oxd_host_port
Definition: Oxd_RP_config.php:72
static $acr_values
Definition: Oxd_RP_config.php:108
static $grant_types
Definition: Oxd_RP_config.php:102
static $response_types
Definition: Oxd_RP_config.php:97
static $post_logout_redirect_uri
Definition: Oxd_RP_config.php:82
static $scope
Definition: Oxd_RP_config.php:87

◆ error_message()

oxdrp\Client_Socket_OXD_RP::error_message (   $error)
inherited

Showing errors and exit.

引数
string$error
戻り値
void
151  {
152  die($error);
153  }

◆ getCommand()

oxdrp\Client_OXD_RP::getCommand ( )
inherited

Protocol name for request.

戻り値
string
229  {
230  return $this->command;
231  }
$command
Definition: Client_OXD_RP.php:84

◆ getData()

oxdrp\Client_OXD_RP::getData ( )
inherited

Data which need to send oXD server.

戻り値
array
218  {
219  $this->data = array('command' => $this->getCommand(), 'params' => $this->getParams());
220  return $this->data;
221  }
getParams()
Definition: Client_OXD_RP.php:273
$data
Definition: Client_OXD_RP.php:92
getCommand()
Definition: Client_OXD_RP.php:228

◆ getParams()

oxdrp\Client_OXD_RP::getParams ( )
inherited

Parameters for request.

戻り値
array
274  {
275  return $this->params;
276  }
$params
Definition: Client_OXD_RP.php:88

◆ getRequestHttpMethod()

oxdrp\Uma_rs_check_access::getRequestHttpMethod ( )
戻り値
string
175  {
177  }
$request_http_method
Definition: Uma_rs_check_access.php:82

◆ getRequestOxdId()

oxdrp\Uma_rs_check_access::getRequestOxdId ( )
戻り値
string
115  {
116  return $this->request_oxd_id;
117  }
$request_oxd_id
Definition: Uma_rs_check_access.php:70

◆ getRequestPath()

oxdrp\Uma_rs_check_access::getRequestPath ( )
戻り値
string
158  {
159  return $this->request_path;
160  }
$request_path
Definition: Uma_rs_check_access.php:78

◆ getRequestRpt()

oxdrp\Uma_rs_check_access::getRequestRpt ( )
戻り値
string
141  {
142  return $this->request_rpt;
143  }
$request_rpt
Definition: Uma_rs_check_access.php:74

◆ getResponseAccess()

oxdrp\Uma_rs_check_access::getResponseAccess ( )
戻り値
string
192  {
193  $this->response_access = $this->getResponseData()->access;
194  return $this->response_access;
195  }
$response_access
Definition: Uma_rs_check_access.php:90
getResponseData()
Definition: Client_OXD_RP.php:201

◆ getResponseData()

oxdrp\Client_OXD_RP::getResponseData ( )
inherited

If data is not empty it is returning response data from oxd-server in format array. If data empty or error , you have problem with parameter or protocol.

戻り値
array
202  {
203  if (!$this->getResponseObject()) {
204  $this->response_data = 'Data is empty';
205  $this->error_message($this->response_data);
206  } else {
207  $this->response_data = $this->getResponseObject()->data;
208  }
209  return $this->response_data;
210  }
$response_data
Definition: Client_OXD_RP.php:108
error_message($error)
Definition: Client_Socket_OXD_RP.php:150
getResponseObject()
Definition: Client_OXD_RP.php:246

◆ getResponseJSON()

oxdrp\Client_OXD_RP::getResponseJSON ( )
inherited

If response data is not empty it is returning response data from oxd-server in format json. If response data empty or error , you have problem with parameter or protocol.

戻り値
string
257  {
258  return $this->response_json;
259  }
$response_json
Definition: Client_OXD_RP.php:96

◆ getResponseObject()

oxdrp\Client_OXD_RP::getResponseObject ( )
inherited

If response data is not empty it is returning response data from oxd-server in format object. If response data empty or error , you have problem with parameter or protocol.

戻り値
object
247  {
248  return $this->response_object;
249  }
$response_object
Definition: Client_OXD_RP.php:100

◆ getResponseStatus()

oxdrp\Client_OXD_RP::getResponseStatus ( )
inherited

Response status

戻り値
string, OK on success, error on failure
182  {
183  return $this->response_status;
184  }
$response_status
Definition: Client_OXD_RP.php:104

◆ getResponseTicket()

oxdrp\Uma_rs_check_access::getResponseTicket ( )
戻り値
string
123  {
124  $this->response_ticket = $this->getResponseData()->ticket;
125  return $this->response_ticket;
126  }
$response_ticket
Definition: Uma_rs_check_access.php:98
getResponseData()
Definition: Client_OXD_RP.php:201

◆ is_JSON()

oxdrp\Client_OXD_RP::is_JSON (   $string)
inherited

Checking format string.

引数
string$string
戻り値
bool
284  {
285  return is_string($string) && is_object(json_decode($string)) ? true : false;
286  }

◆ log()

oxdrp\Client_Socket_OXD_RP::log (   $process,
  $message 
)
inherited

Saving process in log file.

引数
string$process
string$message
戻り値
void
161  {
162  $OldFile = $this->base_url.'/logs/oxd-php-server-'.date("Y-m-d") .'.log';
163  $person = "\n".date('l jS \of F Y h:i:s A')."\n".$process.$message."\n";
164  file_put_contents($OldFile, $person, FILE_APPEND | LOCK_EX);
165 
166  }

◆ oxd_socket_request()

oxdrp\Client_Socket_OXD_RP::oxd_socket_request (   $data,
  $char_count = 8192 
)
inherited

Sending request to oXD server via socket

引数
string$data
int$char_count
戻り値
object
124  {
125  if (!self::$socket = stream_socket_client( '127.0.0.1:' . Oxd_RP_config::$oxd_host_port, $errno, $errstr, STREAM_CLIENT_PERSISTENT)) {
126  $this->log("Client: socket::socket_connect is not connected, error: ",$errstr);
127  die($errno);
128  }else{
129  $this->log("Client: socket::socket_connect", "socket connected");
130  }
131  $this->log("Client: oxd_socket_request", fwrite(self::$socket, $data));
132  fwrite(self::$socket, $data);
133  $result = fread(self::$socket, $char_count);
134  if($result){
135  $this->log("Client: oxd_socket_response", $result);
136  }else{
137  $this->log("Client: oxd_socket_response", 'Error socket reading process.');
138  }
139  if(fclose(self::$socket)){
140  $this->log("Client: oxd_socket_connection", "disconnected.");
141  }
142  return $result;
143  }
static $oxd_host_port
Definition: Oxd_RP_config.php:72
log($process, $message)
Definition: Client_Socket_OXD_RP.php:161

◆ request()

oxdrp\Client_OXD_RP::request ( )
inherited

send function sends the command to the oxD server.

Args: command (dict) - Dict representation of the JSON command string

戻り値
void
143  {
144  $this->setParams();
145 
146  $jsondata = json_encode($this->getData(), JSON_UNESCAPED_SLASHES);
147 
148  if(!$this->is_JSON($jsondata)){
149  $this->log("Sending parameters must be JSON.",'Exiting process.');
150  $this->error_message('Sending parameters must be JSON.');
151  }
152  $lenght = strlen($jsondata);
153  if($lenght<=0){
154  $this->log("Length must be more than zero.",'Exiting process.');
155  $this->error_message("Length must be more than zero.");
156  }else{
157  $lenght = $lenght <= 999 ? "0" . $lenght : $lenght;
158  }
159 
160  $this->response_json = $this->oxd_socket_request(utf8_encode($lenght . $jsondata));
161 
162  $this->response_json = str_replace(substr($this->response_json, 0, 4), "", $this->response_json);
163  if ($this->response_json) {
164  $object = json_decode($this->response_json);
165  if ($object->status == 'error') {
166  $this->error_message($object->data->error . ' : ' . $object->data->error_description);
167  } elseif ($object->status == 'ok') {
168  $this->response_object = json_decode($this->response_json);
169  }
170  } else {
171  $this->log("Response is empty...",'Exiting process.');
172  $this->error_message('Response is empty...');
173  }
174  }
error_message($error)
Definition: Client_Socket_OXD_RP.php:150
is_JSON($string)
Definition: Client_OXD_RP.php:284
oxd_socket_request($data, $char_count=8192)
Definition: Client_Socket_OXD_RP.php:124
log($process, $message)
Definition: Client_Socket_OXD_RP.php:161
getData()
Definition: Client_OXD_RP.php:217

◆ setCommand()

oxdrp\Uma_rs_check_access::setCommand ( )

Protocol command to oxd server

戻り値
void
202  {
203  $this->command = 'uma_rs_check_access';
204  }

◆ setParams()

oxdrp\Uma_rs_check_access::setParams ( )

Protocol parameter to oxd server

戻り値
void
211  {
212  $this->params = array(
213  "oxd_id" => $this->getRequestOxdId(),
214  "rpt" => $this->getRequestRpt(),
215  "path" => $this->getRequestPath(),
216  "http_method" => $this->getRequestHttpMethod()
217  );
218  }
getRequestOxdId()
Definition: Uma_rs_check_access.php:114
getRequestPath()
Definition: Uma_rs_check_access.php:157
getRequestRpt()
Definition: Uma_rs_check_access.php:140
getRequestHttpMethod()
Definition: Uma_rs_check_access.php:174

◆ setRequestHttpMethod()

oxdrp\Uma_rs_check_access::setRequestHttpMethod (   $request_http_method)
引数
string$request_http_method
戻り値
void
184  {
185  $this->request_http_method = $request_http_method;
186  }
$request_http_method
Definition: Uma_rs_check_access.php:82

◆ setRequestOxdId()

oxdrp\Uma_rs_check_access::setRequestOxdId (   $request_oxd_id)
引数
string$request_oxd_id
戻り値
void
133  {
134  $this->request_oxd_id = $request_oxd_id;
135  }
$request_oxd_id
Definition: Uma_rs_check_access.php:70

◆ setRequestPath()

oxdrp\Uma_rs_check_access::setRequestPath (   $request_path)
引数
null$request_path
戻り値
void
167  {
168  $this->request_path = $request_path;
169  }
$request_path
Definition: Uma_rs_check_access.php:78

◆ setRequestRpt()

oxdrp\Uma_rs_check_access::setRequestRpt (   $request_rpt)
引数
string$request_rpt
戻り値
void
150  {
151  $this->request_rpt = $request_rpt;
152  }
$request_rpt
Definition: Uma_rs_check_access.php:74

◆ setResponseStatus()

oxdrp\Client_OXD_RP::setResponseStatus ( )
inherited

Setting response status

戻り値
void
192  {
193  $this->response_status = $this->getResponseObject()->status;
194  }
getResponseObject()
Definition: Client_OXD_RP.php:246

メンバ詳解

◆ $base_url

oxdrp\Client_Socket_OXD_RP::$base_url = __DIR__
protectedinherited

◆ $command

oxdrp\Client_OXD_RP::$command
protectedinherited

◆ $data

oxdrp\Client_OXD_RP::$data = array()
protectedinherited

◆ $params

oxdrp\Client_OXD_RP::$params = array()
protectedinherited

◆ $request_http_method

oxdrp\Uma_rs_check_access::$request_http_method = null
private

◆ $request_oxd_id

oxdrp\Uma_rs_check_access::$request_oxd_id = null
private

◆ $request_path

oxdrp\Uma_rs_check_access::$request_path = null
private

◆ $request_rpt

oxdrp\Uma_rs_check_access::$request_rpt = null
private

◆ $response_access

string oxdrp\Uma_rs_check_access::$response_access
private

Response parameter from oxd-server Access grant response (granted or denied)

◆ $response_data

oxdrp\Client_OXD_RP::$response_data = array()
protectedinherited

◆ $response_json

oxdrp\Client_OXD_RP::$response_json
protectedinherited

◆ $response_object

oxdrp\Client_OXD_RP::$response_object
protectedinherited

◆ $response_status

oxdrp\Client_OXD_RP::$response_status
protectedinherited

◆ $response_ticket

string oxdrp\Uma_rs_check_access::$response_ticket
private

Response parameter from oxd-server Tiket number

◆ $socket

oxdrp\Client_Socket_OXD_RP::$socket = null
staticprotectedinherited

このクラス詳解は次のファイルから抽出されました: