mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-17 05:48:43 +02:00
Compare commits
12 Commits
t17-php81-
...
MOODLE_32_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2fb8f2f186 | ||
|
|
907cf73e54 | ||
|
|
c6c0382eab | ||
|
|
7bf8b9a748 | ||
|
|
99e43b6c76 | ||
|
|
1d1fb94142 | ||
|
|
2366b3ea18 | ||
|
|
a252f55bdf | ||
|
|
f72a03aa5a | ||
|
|
a42ad4141a | ||
|
|
4ce9f05ebf | ||
|
|
bdf158a677 |
20
.github/workflows/moodle-release.yml
vendored
Normal file
20
.github/workflows/moodle-release.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# Whenever version.php is changed, add the latest version
|
||||
# to the Moodle Plugins directory at https://moodle.org/plugins
|
||||
#
|
||||
name: Releasing in the Plugins directory
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- MOODLE_32_STABLE
|
||||
paths:
|
||||
- 'version.php'
|
||||
|
||||
jobs:
|
||||
workflow_group_27_to_32_release:
|
||||
uses: catalyst/catalyst-moodle-workflows/.github/workflows/group-27-to-32-release.yml@main
|
||||
with:
|
||||
plugin_name: auth_outage
|
||||
secrets:
|
||||
moodle_org_token: ${{ secrets.MOODLE_ORG_TOKEN }}
|
||||
55
.travis.yml
55
.travis.yml
@@ -1,55 +0,0 @@
|
||||
language: php
|
||||
|
||||
notifications:
|
||||
email:
|
||||
recipients:
|
||||
- daniel.roperto@catalyst-au.net
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
addons:
|
||||
postgresql: "9.3"
|
||||
|
||||
php:
|
||||
- 7.0
|
||||
|
||||
env:
|
||||
- DB=pgsql MOODLE_BRANCH=MOODLE_30_STABLE
|
||||
- DB=pgsql MOODLE_BRANCH=MOODLE_31_STABLE
|
||||
- DB=pgsql MOODLE_BRANCH=MOODLE_32_STABLE
|
||||
- DB=pgsql MOODLE_BRANCH=MOODLE_33_STABLE
|
||||
- DB=pgsql MOODLE_BRANCH=master
|
||||
- DB=mysqli MOODLE_BRANCH=master
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- php: 5.5
|
||||
env: DB=pgsql MOODLE_BRANCH=MOODLE_30_STABLE
|
||||
- php: 5.5
|
||||
env: DB=mysqli MOODLE_BRANCH=MOODLE_30_STABLE
|
||||
- php: 7.1
|
||||
env: DB=pgsql MOODLE_BRANCH=master
|
||||
|
||||
|
||||
before_install:
|
||||
- phpenv config-rm xdebug.ini
|
||||
- cd ../..
|
||||
- composer selfupdate
|
||||
- composer create-project -n --no-dev moodlerooms/moodle-plugin-ci ci ^1
|
||||
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
|
||||
|
||||
install:
|
||||
- moodle-plugin-ci install -vvv
|
||||
|
||||
script:
|
||||
- moodle-plugin-ci validate
|
||||
- moodle-plugin-ci phplint
|
||||
- moodle-plugin-ci phpcpd
|
||||
- moodle-plugin-ci phpmd
|
||||
- moodle-plugin-ci codechecker
|
||||
- moodle-plugin-ci csslint
|
||||
- moodle-plugin-ci shifter
|
||||
- moodle-plugin-ci jshint
|
||||
- moodle-plugin-ci phpunit
|
||||
@@ -1,6 +1,4 @@
|
||||
<a href="https://travis-ci.org/catalyst/moodle-auth_outage">
|
||||
<img src="https://travis-ci.org/catalyst/moodle-auth_outage.svg?branch=master">
|
||||
</a>
|
||||
(https://github.com/catalyst/moodle-auth_outage/actions)
|
||||
|
||||
# Moodle Outage manager plugin
|
||||
|
||||
@@ -99,7 +97,7 @@ Creates a new outage.
|
||||
-c, --clone clone another outage except for the start time.
|
||||
-a, --autostart must be Y or N, sets if the outage automatically triggers maintenance mode.
|
||||
-w, --warn how many seconds before it starts to display a warning.
|
||||
-s, --start in how many seconds should this outage start. Required.
|
||||
-s, --start in how many seconds should this outage start or unix time to start outage. Required.
|
||||
-d, --duration how many seconds should the outage last.
|
||||
-t, --title the title of the outage.
|
||||
-e, --description the description of the outage.
|
||||
|
||||
@@ -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'],
|
||||
|
||||
@@ -58,8 +58,8 @@ class outagelib {
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1); // It is localhost, time to connect is enough.
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 5); // It is localhost, time to fetch index is enough.
|
||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); // It is localhost, time to connect is enough.
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 15); // It is localhost, time to fetch index is enough.
|
||||
$contents = curl_exec($curl);
|
||||
$mime = curl_getinfo($curl, CURLINFO_CONTENT_TYPE);
|
||||
curl_close($curl);
|
||||
|
||||
@@ -36,10 +36,10 @@ $PAGE->set_url(new moodle_url('/auth/outage/manage.php'));
|
||||
|
||||
$mform = new delete();
|
||||
if ($mform->is_cancelled()) {
|
||||
redirect('/auth/outage/manage.php');
|
||||
redirect(new moodle_url('/auth/outage/manage.php'));
|
||||
} else if ($fromform = $mform->get_data()) {
|
||||
outagedb::delete($fromform->id);
|
||||
redirect('/auth/outage/manage.php');
|
||||
redirect(new moodle_url('/auth/outage/manage.php'));
|
||||
}
|
||||
|
||||
$id = required_param('id', PARAM_INT);
|
||||
|
||||
4
edit.php
4
edit.php
@@ -39,10 +39,10 @@ $PAGE->set_url(new moodle_url('/auth/outage/manage.php'));
|
||||
$mform = new edit();
|
||||
|
||||
if ($mform->is_cancelled()) {
|
||||
redirect('/auth/outage/manage.php');
|
||||
redirect(new moodle_url('/auth/outage/manage.php'));
|
||||
} else if ($outage = $mform->get_data()) {
|
||||
$id = outagedb::save($outage);
|
||||
redirect('/auth/outage/manage.php#auth_outage_id_'.$id);
|
||||
redirect($CFG->wwwroot. '/auth/outage/manage.php#auth_outage_id_'.$id);
|
||||
}
|
||||
|
||||
$clone = optional_param('clone', 0, PARAM_INT);
|
||||
|
||||
@@ -36,10 +36,10 @@ $PAGE->set_url(new moodle_url('/auth/outage/manage.php'));
|
||||
|
||||
$mform = new finish();
|
||||
if ($mform->is_cancelled()) {
|
||||
redirect('/auth/outage/manage.php');
|
||||
redirect(new moodle_url('/auth/outage/manage.php'));
|
||||
} else if ($fromform = $mform->get_data()) {
|
||||
outagedb::finish($fromform->id);
|
||||
redirect('/auth/outage/manage.php');
|
||||
redirect(new moodle_url('/auth/outage/manage.php'));
|
||||
}
|
||||
|
||||
$id = required_param('id', PARAM_INT);
|
||||
|
||||
@@ -34,7 +34,7 @@ $string['clicreateparamdescription'] = 'the description of the outage.';
|
||||
$string['clicreateparamduration'] = 'how many seconds should the outage last.';
|
||||
$string['clicreateparamhelp'] = 'shows parameters help.';
|
||||
$string['clicreateparamonlyid'] = 'only outputs the new outage id, useful for scripts.';
|
||||
$string['clicreateparamstart'] = 'in how many seconds should this outage start. Required.';
|
||||
$string['clicreateparamstart'] = 'in how many seconds should this outage start or unix time to start outage. Required.';
|
||||
$string['clicreateparamtitle'] = 'the title of the outage.';
|
||||
$string['clicreateparamwarn'] = 'how many seconds before it starts to display a warning.';
|
||||
$string['clifinishhelp'] = 'Finishes an ongoing outage.';
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->component = "auth_outage";
|
||||
$plugin->version = 2018062500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2018062502; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->release = '1.0.9'; // Human-readable release information.
|
||||
$plugin->requires = 2014051200; // Requires Moodle 2.7 or later. Moodle 3.0 or later recommended.
|
||||
$plugin->maturity = MATURITY_STABLE; // Suitable for PRODUCTION environments!
|
||||
$plugin->supported = [27, 32]; // A range of branch numbers of supported moodle versions.
|
||||
|
||||
Reference in New Issue
Block a user