Skip to content

Commit

Permalink
token.php code style
Browse files Browse the repository at this point in the history
  • Loading branch information
prowebat committed May 16, 2017
1 parent 61a156b commit 603f194
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/services.htm
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@
],
"version": "float null (mooodle version number in YYYYMMDDXX format)",
"release": "text null (plugin release x.x.x format)"
}</pre><h2>block_exacomp_login</h2><div>webservice called through token.php</div><div>type: read</div>Params: <table><tr><td>app<td>int<td>null<td>required<td><td>app accessing this service (eg. dakora)<tr><td>app_version<td>int<td>null<td>required<td><td>version of the app (eg. 4.6.0)<tr><td>services<td>int<td>null<td>required<td><td>wanted webservice tokens (eg. exacomp,exaport)</table>Returns:<pre>{
}</pre><h2>block_exacomp_login</h2><div>webservice called through token.php</div><div>type: read</div>Params: <table><tr><td>app<td>int<td>null<td>required<td><td>app accessing this service (eg. dakora)<tr><td>app_version<td>int<td>null<td>required<td><td>version of the app (eg. 4.6.0)<tr><td>services<td>int<td>null<td><td>default: moodle_mobile_app,exacompservices<td>wanted webservice tokens (eg. exacomp,exaport)</table>Returns:<pre>{
"user": {
"id": "int null (ID of the user)",
"username": "raw null (The username)",
Expand Down
2 changes: 1 addition & 1 deletion externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -5951,7 +5951,7 @@ public static function login_parameters() {
return new external_function_parameters(array(
'app' => new external_value (PARAM_INT, 'app accessing this service (eg. dakora)'),
'app_version' => new external_value (PARAM_INT, 'version of the app (eg. 4.6.0)'),
'services' => new external_value (PARAM_INT, 'wanted webservice tokens (eg. exacomp,exaport)', VALUE_OPTIONAL),
'services' => new external_value (PARAM_INT, 'wanted webservice tokens (eg. exacomp,exaport)', VALUE_DEFAULT, 'moodle_mobile_app,exacompservices'),
));
}

Expand Down
8 changes: 4 additions & 4 deletions token.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function block_exacomp_load_service($service) {
exit;
}

$block_exacomp_tokens = [];
$exa_tokens = [];

$services = optional_param('services', '', PARAM_TEXT);
$services = array_keys(
Expand All @@ -62,18 +62,18 @@ function block_exacomp_load_service($service) {

foreach ($services as $service) {
$token = block_exacomp_load_service($service);
$block_exacomp_tokens[] = [
$exa_tokens[] = [
'service' => $service,
'token' => $token,
];
}

require __DIR__.'/externallib.php';
require_once __DIR__.'/externallib.php';

// get login data
$data = block_exacomp_external::login();
// add tokens
$data['tokens'] = $block_exacomp_tokens;
$data['tokens'] = $exa_tokens;

// clean output
$data = external_api::clean_returnvalue(block_exacomp_external::login_returns(), $data);
Expand Down

0 comments on commit 603f194

Please sign in to comment.