-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Isaac,

I've just committed this in our stable branch. Fixes the problem on my
system with a non-packaged moodle, and still allows you to control
session configuration from /etc/apache/conf.d/moodle or just fall back
to the session GC being done by the PHP package.

aporo:~/Sites/moodle_14_STABLE martin$ cvs diff config-dist.php
lib/setup.php
Index: config-dist.php
===================================================================
RCS file: /cvsroot/moodle/moodle/config-dist.php,v
retrieving revision 1.62.2.2
diff -u -r1.62.2.2 config-dist.php
- --- config-dist.php     7 Sep 2004 02:50:01 -0000       1.62.2.2
+++ config-dist.php     13 Feb 2005 22:39:58 -0000
@@ -177,6 +177,11 @@
~ // then all addresses are ALLOWED EXCEPT those listed.
~ //      $CFG->allowemailaddresses = "myschool.edu.au hotmail.com";
~ //      $CFG->denyemailaddresses = "hotmail.com yahoo.com";
+//
+// The following setting will tell Moodle to respect your PHP session
+// settings. Use this if you want to control session configuration
+// from php.ini, httpd.conf or .htaccess files.
+//     $CFG->respectsessionsettings = true;

~
//=========================================================================
~ // ALL DONE!  To continue installation, visit your main page with a
browser
Index: lib/setup.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/setup.php,v
retrieving revision 1.75.2.8
diff -u -r1.75.2.8 setup.php
- --- lib/setup.php       18 Jan 2005 22:10:24 -0000      1.75.2.8
+++ lib/setup.php       13 Feb 2005 22:39:58 -0000
@@ -114,17 +114,28 @@
~     }
~     $smarty->compile_dir = "$CFG->dataroot/cache";

- -/// Set session timeouts
- -    if (!empty($CFG->sessiontimeout)) {
- -        ini_set('session.gc_maxlifetime', $CFG->sessiontimeout);
- -    }
- -
- -/// Set custom session path
- -    if (!file_exists("$CFG->dataroot/sessions")) {
- -        make_upload_directory('sessions');
- -    }
- -    ini_set('session.save_path', "$CFG->dataroot/sessions");
+    if(empty($CFG->respectsessionsettings)) {
+
+       // Some distros disable GC by setting probability to 0
+       // overriding the PHP default of 1
+       // (gc_probability is divided by gc_divisor, which defaults to 1000)
+        if (ini_get('session.gc_probability') == 0) {
+               ini_set('session.gc_probability', 1);
+        }
+
+               /// Set session timeouts
+           if (!empty($CFG->sessiontimeout)) {
+           ini_set('session.gc_maxlifetime', $CFG->sessiontimeout);
+       }
+
+               /// Set custom session path
+       if (!file_exists("$CFG->dataroot/sessions")) {
+               make_upload_directory('sessions');
+       }
+       ini_set('session.save_path', "$CFG->dataroot/sessions");

+       } // end of PHP session settings override
+
~ /// Set sessioncookie variable if it isn't already
~     if (!isset($CFG->sessioncookie)) {
~         $CFG->sessioncookie = '';
- --
- -----------------------------------------------------------------------
Martin @ Catalyst .Net .NZ  Ltd, PO Box 11-053, Manners St,  Wellington
WEB: http://catalyst.net.nz/           PHYS: Level 2, 150-154 Willis St
OFFICE: +64(4)916-7224                              MOB: +64(21)364-017
~      Make things as simple as possible, but no simpler - Einstein
- -----------------------------------------------------------------------

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFCD9xMs0Mfg5CJuKkRAmQiAJ441KzMl45EAH865ULoqrfCjDAIIgCg03U9
MIeAE9gMdL2lzJcq85naPuU=
=2ypw
-----END PGP SIGNATURE-----


-- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Reply via email to