12 Commits

Author SHA1 Message Date
Anupama Dharmajan
2fb8f2f186 Bump version 2022-01-13 16:49:48 +11:00
Anupama Dharmajan
907cf73e54 Update plugin name in moodle release workflow 2022-01-13 16:46:51 +11:00
Brendan Heywood
c6c0382eab Merge pull request #276 from catalyst/MOODLE_32_STABLE-reusable-workflows
Add reusable workflow for moodle release
2022-01-13 16:40:36 +11:00
Anupama Dharmajan
7bf8b9a748 Add reusable workflow for moodle release 2022-01-13 16:27:31 +11:00
Brendan Heywood
99e43b6c76 Merge pull request #198 from ledship/MOODLE_32_STABLE-time
Accept unix time for --start CLI option to MOODLE_32_STABLE branch
2020-07-23 14:17:07 +10:00
Alexander
1d1fb94142 Accept unix time for --start CLI option 2020-07-23 14:26:03 +12:00
Brendan Heywood
2366b3ea18 Merge pull request #205 from ledship/MOODLE_32_STABLE-ci
Fix MOODLE_32_STABLE travis config
2020-07-22 13:41:33 +10:00
Alexander
a252f55bdf Fix travis CI and use correct branch in README 2020-07-22 14:02:28 +12:00
Ilya Tregubov
f72a03aa5a Incease timeout to prevent settings page throwing error (from time to time) 2018-10-11 11:56:40 +11:00
Dan Marsden
a42ad4141a Fix #120 increase timeout values to prevent ci failures. 2018-10-05 10:21:28 +13:00
Dan Marsden
4ce9f05ebf Fix #124 use correct urls in redirects. 2018-10-03 15:17:21 +13:00
Dan Marsden
bdf158a677 Update travis config for 3.2 and lower branch. 2018-10-03 15:05:09 +13:00
10 changed files with 36 additions and 70 deletions

20
.github/workflows/moodle-release.yml vendored Normal file
View 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 }}

View File

@@ -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

View File

@@ -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>
![Build Status](https://github.com/catalyst/moodle-auth_outage/actions/workflows/ci.yml/badge.svg?branch=MOODLE_32_STABLE)(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.

View File

@@ -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'],

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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.';

View File

@@ -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.