]> git.mjollnir.org Git - moodle.git/commitdiff
New sessiontimeout config variable to set the timeout for sessions
authormoodler <moodler>
Fri, 24 Jan 2003 04:31:58 +0000 (04:31 +0000)
committermoodler <moodler>
Fri, 24 Jan 2003 04:31:58 +0000 (04:31 +0000)
admin/config.html
lang/en/moodle.php
lib/defaults.php
lib/setup.php

index 3be946ba6a27248ff4c3872aaf6f3c866f9e373b..e4fea33852667ff70fb77304be2e70f0fbbc6816 100644 (file)
     <? print_string("configlongtimenosee") ?>
     </TD>
 </TR>
+<TR VALIGN=TOP>
+       <TD ALIGN=RIGHT><P>sessiontimeout:</TD>
+       <TD>
+    <? 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, "", "", "");
+    ?>
+    </TD>
+    <TD>
+    <? print_string("configsessiontimeout") ?>
+    </TD>
+</TR>
 <TR VALIGN=TOP>
        <TD ALIGN=RIGHT><P>zip:</TD>
        <TD>
index 91cabd1cd307a3dd49a8dcabdfe96d70f4e678b7..07a04f6fe43e4148f46c8547ae254c31660e17a1 100644 (file)
@@ -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 <B>server</B> 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";
index 0628f6df16dd63b3725b24e9cd136a31ab9e8521..40be0aa1b6d9617bf7736918ed9e0ed07ae6d929 100644 (file)
@@ -25,6 +25,7 @@
        "country"          => "",
        "prefix"           => "",
        "guestloginbutton" =>  1,
+       "sessiontimeout"   =>  7200,
        "debug"            =>  7
     );
 
index 0c84d01bcb9aa73ea99a7aa1f48554993f430aa9..198e866ff38e1a0935fc6be916d50c3bed842a42 100644 (file)
     }
 
 
+/// Set session timeouts
+    if (!empty($CFG->sessiontimeout)) {
+        ini_set("session.gc_maxlifetime", $CFG->sessiontimeout);
+    }
+
+
 /// Location of standard files
 
     $CFG->wordlist    = "$CFG->libdir/wordlist.txt";