mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-10-22 18:18:07 +02:00
Accept unix time for --start CLI option
This commit is contained in:
1 parent
2366b3ea18
commit
1d1fb94142
3 files changed
+5
-3
No files matched your search
@@ -170,7 +170,9 @@ class create extends clibase {
|
||||
$this->become_admin_user();
|
||||
|
||||
// Create the outage.
|
||||
$start = $this->time + $options['start'];
|
||||
// If time is above 1500000000 then it must be a unix time timestamp, otherwise they are trying to create
|
||||
// an outage 47 years in advance.
|
||||
$start = $options['start'] > 1500000000 ? $options['start'] : $this->time + $options['start'];
|
||||
$outage = new outage([
|
||||
'autostart' => $options['autostart'],
|
||||
'warntime' => $start - $options['warn'],
|
||||
|
||||
Reference in new issue
Block a user