Skip to content

Commit

Permalink
Merge pull request #80 from catalyst/enable-release
Browse files Browse the repository at this point in the history
CI cleanup and enable release
  • Loading branch information
brendanheywood authored Mar 14, 2024
2 parents 51ccdb9 + 38f398c commit fcfffd4
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ jobs:
uses: catalyst/catalyst-moodle-workflows/.github/workflows/ci.yml@main
with:
disable_behat: true
disable_release: true
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ Branches

| Moodle verion | Branch | PHP |
| ----------------- | --------------------- | -------- |
| Moodle 3.3 to 3.7 | master | 7.2 |
| Moodle 4.1+ | MOODLE_401_STABLE | 7.4 |
| Moodle 3.3 to 4.0 | master | 7.2 |
| Moodle 2.7 | MOODLE_27_STABLE | 5.5 |

Performance impact
Expand Down
6 changes: 5 additions & 1 deletion classes/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static function enable_csp_header() {
global $USER, $COURSE;

$settings = get_config('local_csp');
if (self::$bootstrapped or empty($settings->csp_header_enable)) {
if (self::$bootstrapped || empty($settings->csp_header_enable)) {
return;
}
self::$bootstrapped = true;
Expand All @@ -66,6 +66,10 @@ public static function enable_csp_header() {
}
}

/**
* Enables feature policy
* @return void
*/
public static function enable_feature_policy() {
$settings = get_config('local_csp');
if (empty($settings->feature_policy_enable)) {
Expand Down
2 changes: 1 addition & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/**
* Class provider
* @package local_csp\privacy
* @package local_csp
*/
class provider implements
\core_privacy\local\metadata\null_provider {
Expand Down
8 changes: 7 additions & 1 deletion classes/table/csp_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* - Convert unix timestamp columns to human time.
* - Adds a button to delete a record.
*
* @package local_csp\table
* @package local_csp
* @copyright Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand Down Expand Up @@ -238,6 +238,12 @@ protected function col_highestviolaters($record) {
return $return;
}

/**
* Gets the 3 highest violater courses for each blockedURI
*
* @param \stdClass $record fieldset object of db table
* @return string details of the highest violating courses
*/
protected function col_courses($record) {
global $DB;

Expand Down
2 changes: 2 additions & 0 deletions db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* Plugin capabilities
*
* @package local_csp
* @copyright 2022 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();
Expand Down
6 changes: 6 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/**
* Function to upgrade local_csp.
*
* @param int $oldversion the version we are upgrading from
* @return bool result
*/
function xmldb_local_csp_upgrade($oldversion) {
global $DB;
$dbman = $DB->get_manager();
Expand Down
12 changes: 12 additions & 0 deletions templates/notification.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,19 @@
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template local_csp/notification
Inputs for optional notification.
Example context (json):
{
"header": "Header",
"start": "Start",
"sourcesText": "Sources",
"events": []
}
}}
<h4>{{header}}</h4>
<p>{{start}}</p>
<p>{{sourcesText}}</p>
Expand Down
6 changes: 3 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

defined('MOODLE_INTERNAL') || die;

$plugin->version = 2022060300;
$plugin->release = 2020070300;
$plugin->version = 2024031400;
$plugin->release = 2024031400;
$plugin->requires = 2015051100;
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'local_csp';
$plugin->supported = [34, 401];
$plugin->supported = [401, 403];

0 comments on commit fcfffd4

Please sign in to comment.