Skip to content

Commit b622433

Browse files
Limekillerkeevan
authored andcommitted
Make tempdir a config setting
1 parent 7500f9d commit b622433

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

classes/auth.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ class auth extends \auth_plugin_base {
109109
'nameidasattrib' => 0,
110110
'flagresponsetype' => saml2_settings::OPTION_FLAGGED_LOGIN_MESSAGE,
111111
'flagredirecturl' => '',
112-
'flagmessage' => '' // Set in constructor.
112+
'flagmessage' => '', // Set in constructor.
113+
'tempdir' => '/tmp/simplesaml'
113114
];
114115

115116
/**

config/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
'debug' => ['saml' => $saml2auth->is_debugging()],
5050
'logging.level' => $saml2auth->is_debugging() ? SimpleSAML\Logger::DEBUG : SimpleSAML\Logger::ERR,
5151
'logging.handler' => $saml2auth->config->logtofile ? 'file' : 'errorlog',
52-
'tempdir' => '/tmp/simplesaml',
52+
'tempdir' => $saml2auth->config->tempdir,
5353

5454
// SSP has a %srcip token, but instead use $remoteip so Moodle handle's which header to use.
5555
'logging.format' => '%date{%b %d %H:%M:%S} ' . $remoteip . ' %process %level %stat[%trackid] %msg',

lang/en/auth_saml2.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@
178178
$string['spmetadatasign_help'] = 'Sign the SP Metadata.';
179179
$string['spmetadatasign'] = 'SP Metadata signature';
180180
$string['spmetadata'] = 'SP Metadata';
181+
$string['tempdirdefault'] = '/tmp/simplesaml';
182+
$string['tempdir_help'] = 'A directory where SimpleSAMLphp can save temporary files';
183+
$string['tempdir'] = 'SimpleSAMLphp temporary directory';
181184
$string['sspversion'] = 'SimpleSAMLphp version';
182185
$string['stateorprovincename'] = 'State or Province';
183186
$string['status'] = 'Status';

settings.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,16 @@
367367
1,
368368
$yesno));
369369

370+
// SAMLPHP tempdir
371+
$settings->add(new admin_setting_configtext(
372+
'auth_saml2/tempdir',
373+
get_string('tempdir', 'auth_saml2'),
374+
get_string('tempdir_help', 'auth_saml2'),
375+
get_string('tempdirdefault', 'auth_saml2'),
376+
PARAM_TEXT,
377+
50,
378+
3));
379+
370380
// SAMLPHP version.
371381
$authplugin = get_auth_plugin('saml2');
372382
$settings->add(new setting_textonly(

0 commit comments

Comments
 (0)