Skip to content
Snippets Groups Projects
Commit 3c38a5b7 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Fixes for modules/cron

parent ef7925f1
No related branches found
No related tags found
No related merge requests found
<?php
/**
* Hook to add the cron module to the config page.
*
* @param \SimpleSAML\XHTML\Template &$template The template that we should alter in this hook.
* @return void
*/
function cron_hook_configpage(\SimpleSAML\XHTML\Template &$template)
{
$template->data['links']['cron'] = [
......
<?php
/**
* Hook to run a cron job.
*
* @param array &$croninfo Output
* @return void
*/
function cron_hook_cron(&$croninfo)
{
assert(is_array($croninfo));
......
<?php
/**
* Hook to add the modinfo module to the frontpage.
*
* @param array &$links The links on the frontpage, split into sections.
* @return void
*/
function cron_hook_frontpage(&$links)
{
assert(is_array($links));
......
<?php
namespace SimpleSAML\Module\cron;
namespace SimpleSAML\Module\cron;
/**
* Handles interactions with SSP's cron system/hooks.
......@@ -27,13 +27,12 @@ class Cron
/**
* Invoke the cron hook for the given tag
* @param $tag string The tag to use. Must be valid in the cronConfig
* @param string $tag The tag to use. Must be valid in the cronConfig
* @return array the tag, and summary information from the run.
* @throws Exception If an invalid tag specified
*/
public function runTag($tag)
{
if (!$this->isValidTag($tag)) {
throw new \Exception("Invalid cron tag '$tag''");
}
......@@ -53,6 +52,10 @@ class Cron
return $croninfo;
}
/**
* @param string $tag
* @return bool
*/
public function isValidTag($tag)
{
if (!is_null($this->cronconfig->getValue('allowed_tags'))) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment