aboutsummaryrefslogtreecommitdiff
path: root/lib.php
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-12-03 20:09:56 +0300
committerValentin Popov <info@valentineus.link>2017-12-03 20:09:56 +0300
commite0362e42501059b332d14fc16917e7ae68cc765a (patch)
tree4865bb58dc9f630dc0e0a526e9706a340122a0ef /lib.php
parenta7e10590ebadad6c40e9543bb9f86d543ec85e27 (diff)
downloadtool_managertokens-e0362e42501059b332d14fc16917e7ae68cc765a.tar.xz
tool_managertokens-e0362e42501059b332d14fc16917e7ae68cc765a.zip
Correcting errors during automatic testingv0.2.0
Diffstat (limited to 'lib.php')
-rw-r--r--lib.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib.php b/lib.php
index 8274b11..9f42040 100644
--- a/lib.php
+++ b/lib.php
@@ -87,12 +87,12 @@ function tool_managertokens_create_record($options) {
global $DB;
$token = new stdClass();
- $token->enabled = !empty($options->enabled) ? boolval($options->enabled) : false;
- $token->limited = !empty($options->limited) ? intval($options->limited) : 0;
- $token->targetid = !empty($options->targetid) ? intval($options->targetid) : 0;
- $token->targettype = !empty($options->targettype) ? strval($options->targettype) : "null";
+ $token->enabled = !empty($options->enabled) ? boolval($options->enabled) : false;
+ $token->limited = !empty($options->limited) ? intval($options->limited) : 0;
+ $token->targetid = !empty($options->targetid) ? intval($options->targetid) : 0;
+ $token->targettype = !empty($options->targettype) ? strval($options->targettype) : "null";
$token->timelimited = !empty($options->timelimited) ? intval($options->timelimited) : 0;
- $token->token = !empty($options->token) ? strval($options->token) : generate_password(12);
+ $token->token = !empty($options->token) ? strval($options->token) : generate_password(12);
$token->timecreated = time();
$token->timemodified = time();
@@ -253,12 +253,12 @@ function tool_managertokens_update_record($options) {
}
if ($token = $DB->get_record("tool_managertokens_tokens", array("id" => $options->id), "*", IGNORE_MISSING)) {
- $token->enabled = !empty($options->enabled) ? boolval($options->enabled) : false;
- $token->limited = !empty($options->limited) ? intval($options->limited) : $token->limited;
- $token->targetid = !empty($options->targetid) ? intval($options->targetid) : $token->targetid;
- $token->targettype = !empty($options->targettype) ? strval($options->targettype) : $token->targettype;
+ $token->enabled = !empty($options->enabled) ? boolval($options->enabled) : false;
+ $token->limited = !empty($options->limited) ? intval($options->limited) : $token->limited;
+ $token->targetid = !empty($options->targetid) ? intval($options->targetid) : $token->targetid;
+ $token->targettype = !empty($options->targettype) ? strval($options->targettype) : $token->targettype;
$token->timelimited = !empty($options->timelimited) ? intval($options->timelimited) : $token->timelimited;
- $token->token = !empty($options->token) ? strval($options->token) : $token->token;
+ $token->token = !empty($options->token) ? strval($options->token) : $token->token;
$token->timemodified = time();
if (!empty($options->extendedaction) && !empty($options->extendedoptions)) {