Definition at line 25 of file XapiProxy.php.
◆ __construct()
XapiProxy\XapiProxy::__construct |
( |
string |
$client, |
|
|
string |
$token, |
|
|
?bool |
$plugin = false |
|
) |
| |
◆ blockSubStatements()
XapiProxy\XapiProxy::blockSubStatements |
( |
| ) |
|
◆ client()
XapiProxy\XapiProxy::client |
( |
| ) |
|
◆ cmdParts()
XapiProxy\XapiProxy::cmdParts |
( |
| ) |
|
◆ getDefaultLrsEndpoint()
XapiProxy\XapiProxy::getDefaultLrsEndpoint |
( |
| ) |
|
◆ getDefaultLrsKey()
XapiProxy\XapiProxy::getDefaultLrsKey |
( |
| ) |
|
◆ getDefaultLrsSecret()
XapiProxy\XapiProxy::getDefaultLrsSecret |
( |
| ) |
|
◆ getFallbackLrsEndpoint()
XapiProxy\XapiProxy::getFallbackLrsEndpoint |
( |
| ) |
|
◆ getFallbackLrsKey()
XapiProxy\XapiProxy::getFallbackLrsKey |
( |
| ) |
|
◆ getFallbackLrsSecret()
XapiProxy\XapiProxy::getFallbackLrsSecret |
( |
| ) |
|
◆ getXapiProxyRequest()
XapiProxy\XapiProxy::getXapiProxyRequest |
( |
| ) |
|
Definition at line 119 of file XapiProxy.php.
XapiProxyRequest $xapiProxyRequest
◆ getXapiProxyResponse()
XapiProxy\XapiProxy::getXapiProxyResponse |
( |
| ) |
|
Definition at line 129 of file XapiProxy.php.
XapiProxyResponse $xapiProxyResponse
◆ handleStatementEvaluation()
XapiProxy\XapiProxy::handleStatementEvaluation |
( |
object |
$xapiStatement | ) |
|
|
private |
Definition at line 230 of file XapiProxy.php.
References $DIC, ilLPStatusWrapper\_updateStatus(), ANONYMOUS_USER_ID, ilObjectFactory\getInstanceByObjId(), and ilObjCmiXapi\LAUNCH_MODE_NORMAL.
241 $statementEvaluation = new \ilXapiStatementEvaluation($this->
log(), $object);
242 $statementEvaluation->evaluateStatement($xapiStatement, $this->authToken->getUsrId());
246 $this->authToken->getObjId(),
247 $this->authToken->getUsrId()
251 if ($xapiStatement->verb->id == self::TERMINATED_VERB) {
253 $this->authToken->delete();
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
◆ isSubStatementCheck()
XapiProxy\XapiProxy::isSubStatementCheck |
( |
object |
$obj | ) |
|
|
private |
Definition at line 293 of file XapiProxy.php.
References ilObjectFactory\getInstanceByObjId().
296 $objActivityId = $object->getActivityId();
297 $statementActivityId = $obj->object->id;
298 if ($statementActivityId != $objActivityId) {
299 $this->
log()->debug($this->
msg(
"statement object id " . $statementActivityId .
" != activityId " . $objActivityId));
300 $this->
log()->debug($this->
msg(
"is Substatement"));
303 $this->
log()->debug($this->
msg(
"is not Substatement"));
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
◆ lrsType()
XapiProxy\XapiProxy::lrsType |
( |
| ) |
|
◆ method()
XapiProxy\XapiProxy::method |
( |
| ) |
|
◆ modifyBody()
XapiProxy\XapiProxy::modifyBody |
( |
string |
$body | ) |
|
Definition at line 197 of file XapiProxy.php.
199 $obj = json_decode($body,
false);
201 if (json_last_error() != JSON_ERROR_NONE) {
203 $this->
log()->error($this->
msg(json_last_error_msg()));
208 if (is_object($obj)) {
211 $this->
setValue($obj, (
string) $key, (
string) $value);
217 if (is_array($obj)) {
218 for ($i = 0; $i < count($obj); $i++) {
221 $this->
setValue($obj[$i], (
string) $key, (
string) $value);
227 return json_encode($obj);
setValue(object &$obj, string $path, string $value)
handleStatementEvaluation(object $xapiStatement)
◆ processStatements()
XapiProxy\XapiProxy::processStatements |
( |
\Psr\Http\Message\RequestInterface |
$request, |
|
|
|
$body |
|
) |
| |
Definition at line 134 of file XapiProxy.php.
References null.
138 $this->
log()->debug($this->
msg(
"all statement are allowed"));
141 $obj = json_decode($body,
false);
143 if (is_object($obj) && isset($obj->verb)) {
144 $this->
log()->debug($this->
msg(
"json is object and statement"));
146 $verb = $obj->verb->id;
148 $this->
log()->debug($this->
msg(
"sub-statement is NOT allowed, fake response - " . $verb));
149 $this->xapiProxyResponse->fakeResponseBlocked(
null);
156 $this->
log()->debug($this->
msg(
"statement is allowed, do nothing - " . $verb));
159 $this->
log()->debug($this->
msg(
"statement is NOT allowed, fake response - " . $verb));
160 $this->xapiProxyResponse->fakeResponseBlocked(
null);
164 if (is_array($obj) && count($obj) > 0 && isset($obj[0]->verb)) {
165 $this->
log()->debug($this->
msg(
"json is array of statements"));
168 foreach ($obj as $i => $singleObj) {
169 $ret[] = $singleObj->id;
172 $verb = $singleObj->verb->id;
174 $this->
log()->debug($this->
msg(
"sub-statement is NOT allowed - " . $verb));
177 $this->
log()->debug($this->
msg(
"statement is allowed - " . $verb));
183 $this->
log()->debug($this->
msg(
"no allowed statements in array - fake response..."));
184 $this->xapiProxyResponse->fakeResponseBlocked(
"");
186 } elseif (count($up) !== count($ret)) {
187 $this->
log()->debug($this->
msg(
"mixed with allowed and unallowed statements"));
188 return array($up,$ret);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
specificAllowedStatements()
isSubStatementCheck(object $obj)
◆ replacedValues()
XapiProxy\XapiProxy::replacedValues |
( |
| ) |
|
◆ setRequestParams()
XapiProxy\XapiProxy::setRequestParams |
( |
Request |
$request | ) |
|
◆ setStatus()
XapiProxy\XapiProxy::setStatus |
( |
object |
$obj | ) |
|
|
private |
◆ setValue()
XapiProxy\XapiProxy::setValue |
( |
object & |
$obj, |
|
|
string |
$path, |
|
|
string |
$value |
|
) |
| |
|
private |
Definition at line 258 of file XapiProxy.php.
260 $path_components = explode(
'.',
$path);
261 if (count($path_components) == 1) {
262 if (property_exists($obj, $path_components[0])) {
263 $obj->{$path_components[0]} = $value;
266 if (property_exists($obj, $path_components[0])) {
267 $this->
setValue($obj->{array_shift($path_components)}, implode(
'.', $path_components), $value);
setValue(object &$obj, string $path, string $value)
◆ setXapiProxyRequest()
Definition at line 114 of file XapiProxy.php.
XapiProxyRequest $xapiProxyRequest
◆ setXapiProxyResponse()
Definition at line 124 of file XapiProxy.php.
XapiProxyResponse $xapiProxyResponse
◆ specificAllowedStatements()
XapiProxy\XapiProxy::specificAllowedStatements |
( |
| ) |
|
Definition at line 61 of file XapiProxy.php.
array $specificAllowedStatements
◆ token()
XapiProxy\XapiProxy::token |
( |
| ) |
|
◆ $xapiProxyRequest
◆ $xapiProxyResponse
The documentation for this class was generated from the following file: