diff --git a/admin/config.html b/admin/config.html
index 3be946ba6a2..e4fea338526 100644
--- a/admin/config.html
+++ b/admin/config.html
@@ -134,6 +134,27 @@
print_string("configlongtimenosee") ?>
+
+ sessiontimeout: |
+
+ unset($options);
+ $options[14400] = get_string("numhours", "", 4);
+ $options[10800] = get_string("numhours", "", 3);
+ $options[7200] = get_string("numhours", "", 2);
+ $options[5400] = get_string("numhours", "", "1.5");
+ $options[3600] = get_string("numminutes", "", 60);
+ $options[2700] = get_string("numminutes", "", 45);
+ $options[1800] = get_string("numminutes", "", 30);
+ $options[900] = get_string("numminutes", "", 15);
+ $options[300] = get_string("numminutes", "", 5);
+
+ choose_from_menu ($options, "sessiontimeout", $config->sessiontimeout, "", "", "");
+ ?>
+ |
+
+ print_string("configsessiontimeout") ?>
+ |
+
zip: |
diff --git a/lang/en/moodle.php b/lang/en/moodle.php
index 91cabd1cd30..07a04f6fe43 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 0628f6df16d..40be0aa1b6d 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 0c84d01bcb9..198e866ff38 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";
|