mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-17 05:48:43 +02:00
Issue #9 - Fixed code standards.
This commit is contained in:
2
auth.php
2
auth.php
@@ -53,7 +53,7 @@ class auth_plugin_outage extends auth_plugin_base
|
||||
/**
|
||||
* Login page hook.
|
||||
*/
|
||||
function loginpage_hook() {
|
||||
public function loginpage_hook() {
|
||||
\auth_outage\outagelib::initialize();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,8 +86,8 @@ class outage {
|
||||
outagelib::data2object($data, $this);
|
||||
|
||||
// FIXME types are wrong. Is this behaving as expected?
|
||||
foreach (['createdby', 'id', 'lastmodified', 'modifiedby', 'starttime', 'stoptime', 'warningduration']
|
||||
as $f) {
|
||||
$fields = ['createdby', 'id', 'lastmodified', 'modifiedby', 'starttime', 'stoptime', 'warningduration'];
|
||||
foreach ($fields as $f) {
|
||||
$this->$f = ($this->$f === null) ? null : (int)$this->$f;
|
||||
}
|
||||
|
||||
|
||||
@@ -164,8 +164,7 @@ final class outagedb {
|
||||
FROM {auth_outage}
|
||||
WHERE (starttime - warningduration <= :now1 AND stoptime >= :now2)
|
||||
ORDER BY starttime ASC, stoptime DESC, title ASC
|
||||
LIMIT 1
|
||||
',
|
||||
LIMIT 1',
|
||||
['now1' => $now, 'now2' => $now]
|
||||
);
|
||||
|
||||
|
||||
@@ -64,7 +64,9 @@ class outagelib {
|
||||
}
|
||||
self::$initialized = true;
|
||||
|
||||
if (($active = outagedb::getactive()) == null) return;
|
||||
if (($active = outagedb::getactive()) == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$CFG->additionalhtmltopofbody .= self::get_renderer()->renderbar($active);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user