Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
4f7857d4
Commit
4f7857d4
authored
7 years ago
by
Patrick Radtke
Browse files
Options
Downloads
Patches
Plain Diff
Use namespace for cron module; fix $summary display in www/cron.php
parent
35183510
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/cron/bin/cron.php
+1
-1
1 addition, 1 deletion
modules/cron/bin/cron.php
modules/cron/lib/Cron.php
+9
-7
9 additions, 7 deletions
modules/cron/lib/Cron.php
modules/cron/www/cron.php
+2
-1
2 additions, 1 deletion
modules/cron/www/cron.php
with
12 additions
and
9 deletions
modules/cron/bin/cron.php
+
1
−
1
View file @
4f7857d4
...
...
@@ -33,7 +33,7 @@ if (!array_key_exists('t', $options)) {
}
$tag
=
$options
[
't'
];
$cron
=
new
sspmod_
cron
_
Cron
();
$cron
=
new
SimpleSAML\Module\
cron
\
Cron
();
if
(
!
$cron
->
isValidTag
(
$tag
))
{
echo
"Invalid tag option '
$tag
'.
\n
"
;
exit
(
2
);
...
...
This diff is collapsed.
Click to expand it.
modules/cron/lib/Cron.php
+
9
−
7
View file @
4f7857d4
<?php
namespace
SimpleSAML\Module\cron
;
/**
* Handles interactions with SSP's cron system/hooks.
*/
class
sspmod_cron_
Cron
class
Cron
{
/**
* The configuration for the Cron module
* @var SimpleSAML_Configuration
* @var
\
SimpleSAML_Configuration
*/
private
$cronconfig
;
/*
* @param SimpleSAML_Configuration $cronconfig The cron configuration to use. If not specified defaults
* @param
\
SimpleSAML_Configuration $cronconfig The cron configuration to use. If not specified defaults
* to `config/module_cron.php`
*/
public
function
__construct
(
SimpleSAML_Configuration
$cronconfig
=
null
)
public
function
__construct
(
\
SimpleSAML_Configuration
$cronconfig
=
null
)
{
if
(
$cronconfig
==
null
)
{
$cronconfig
=
SimpleSAML_Configuration
::
getConfig
(
'module_cron.php'
);
$cronconfig
=
\
SimpleSAML_Configuration
::
getConfig
(
'module_cron.php'
);
}
$this
->
cronconfig
=
$cronconfig
;
}
...
...
@@ -42,10 +44,10 @@ class sspmod_cron_Cron
'tag'
=>
$tag
,
);
SimpleSAML\Module
::
callHooks
(
'cron'
,
$croninfo
);
\
SimpleSAML\Module
::
callHooks
(
'cron'
,
$croninfo
);
foreach
(
$summary
as
$s
)
{
SimpleSAML\Logger
::
debug
(
'Cron - Summary: '
.
$s
);
\
SimpleSAML\Logger
::
debug
(
'Cron - Summary: '
.
$s
);
}
return
$croninfo
;
...
...
This diff is collapsed.
Click to expand it.
modules/cron/www/cron.php
+
2
−
1
View file @
4f7857d4
...
...
@@ -10,7 +10,7 @@ if (!is_null($cronconfig->getValue('key'))) {
}
}
$cron
=
new
sspmod_
cron
_
Cron
(
$cronconfig
);
$cron
=
new
SimpleSAML\Module\
cron
\
Cron
();
if
(
!
$cron
->
isValidTag
(
$_REQUEST
[
'tag'
]))
{
SimpleSAML\Logger
::
error
(
'Cron - Illegal tag ['
.
$_REQUEST
[
'tag'
]
.
'].'
);
exit
;
...
...
@@ -21,6 +21,7 @@ $url = \SimpleSAML\Utils\HTTP::getSelfURL();
$time
=
date
(
DATE_RFC822
);
$croninfo
=
$cron
->
runTag
(
$_REQUEST
[
'tag'
]);
$summary
=
$croninfo
[
'summary'
];
if
(
$cronconfig
->
getValue
(
'sendemail'
,
TRUE
)
&&
count
(
$summary
)
>
0
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment