first commit

This commit is contained in:
2025-07-18 16:20:14 +07:00
commit 98af45c018
16382 changed files with 3148096 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
use SimpleSAML\Locale\Translate;
use SimpleSAML\Module;
use SimpleSAML\XHTML\Template;
/**
* Hook to add the cron module to the config page.
*
* @param \SimpleSAML\XHTML\Template &$template The template that we should alter in this hook.
*/
function cron_hook_configpage(Template &$template): void
{
$template->data['links'][] = [
'href' => Module::getModuleURL('cron/info'),
'text' => Translate::noop('Cron module information page'),
];
$template->getLocalization()->addModuleDomain('cron');
}

View File

@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
use SimpleSAML\Assert\Assert;
use SimpleSAML\Configuration;
/**
* Hook to run a cron job.
*
* @param array &$croninfo Output
*/
function cron_hook_cron(array &$croninfo): void
{
Assert::keyExists($croninfo, 'summary');
Assert::keyExists($croninfo, 'tag');
$cronconfig = Configuration::getConfig('module_cron.php');
if ($cronconfig->getOptionalBoolean('debug_message', true)) {
$croninfo['summary'][] = 'Cron did run tag [' . $croninfo['tag'] . '] at ' . date(DATE_RFC822);
}
}