From eb58acca4da273c097cc6af74ed495f3e9843d0d Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 24 Jan 2003 04:31:58 +0000 Subject: [PATCH] New sessiontimeout config variable to set the timeout for sessions --- admin/config.html | 21 +++++++++++++++++++++ lang/en/moodle.php | 2 ++ lib/defaults.php | 1 + lib/setup.php | 6 ++++++ 4 files changed, 30 insertions(+) diff --git a/admin/config.html b/admin/config.html index 3be946ba6a..e4fea33852 100644 --- a/admin/config.html +++ b/admin/config.html @@ -134,6 +134,27 @@ + +

sessiontimeout: + + sessiontimeout, "", "", ""); + ?> + + + + +

zip: diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 91cabd1cd3..07a04f6fe4 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -66,6 +66,7 @@ $string['configlocale'] = "Choose a sitewide locale - this will affect the forma $string['configlongtimenosee'] = "If students haven't logged in for a very long time, then they are automatically unsubscribed from courses. This parameter specifies that time limit."; $string['configmaxeditingtime'] = "This specifies the amount of time people have to re-edit forum postings, journal feedback etc. Usually 30 minutes is a good value."; $string['configproxyhost'] = "If this server needs to use a proxy computer (eg a firewall) to access the Internet, then provide the proxy hostname and port here. Otherwise leave it blank."; +$string['configsessiontimeout'] = "If people logged in to this site are idle for a long time (without loading pages) then they are automatically logged out (their session is ended). This variable specifies how long this time should be."; $string['configslasharguments'] = "Files (images, uploads etc) are provided via a script using 'slash arguments' (the second option here). This method allows files to be more easily cached in web browsers, proxy servers etc. Unfortunately, some PHP servers don't allow this method, so if you have trouble viewing uploaded files or images (eg user pictures), set this variable to the first option"; $string['configsmtphosts'] = "Give the full name of one or more local SMTP servers that Moodle should use to send mail (eg 'mail.a.com' or 'mail.a.com;mail.b.com'). If you leave it blank, Moodle will use the PHP default method of sending mail."; $string['configsmtpuser'] = "If you have specified an SMTP server above, and the server requires authentication, then enter the username and password here."; @@ -386,6 +387,7 @@ $string['nousersyet'] = "There are no users yet"; $string['now'] = "now"; $string['numberweeks'] = "Number of weeks/topics"; $string['numdays'] = "\$a days"; +$string['numhours'] = "\$a hours"; $string['numminutes'] = "\$a minutes"; $string['numviews'] = "\$a views"; $string['numweeks'] = "\$a weeks"; diff --git a/lib/defaults.php b/lib/defaults.php index 0628f6df16..40be0aa1b6 100644 --- a/lib/defaults.php +++ b/lib/defaults.php @@ -25,6 +25,7 @@ "country" => "", "prefix" => "", "guestloginbutton" => 1, + "sessiontimeout" => 7200, "debug" => 7 ); diff --git a/lib/setup.php b/lib/setup.php index 0c84d01bcb..198e866ff3 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -67,6 +67,12 @@ } +/// Set session timeouts + if (!empty($CFG->sessiontimeout)) { + ini_set("session.gc_maxlifetime", $CFG->sessiontimeout); + } + + /// Location of standard files $CFG->wordlist = "$CFG->libdir/wordlist.txt"; -- 2.39.5