|
From: Benjamin C. <bc...@us...> - 2002-04-29 06:36:50
|
Update of /cvsroot/phpbt/phpbt/inc
In directory usw-pr-cvs1:/tmp/cvs-serv10480/inc
Modified Files:
auth.php
Log Message:
Fix session problems with php 4.0.6
Index: auth.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/auth.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- auth.php 3 Apr 2002 01:01:04 -0000 1.14
+++ auth.php 29 Apr 2002 06:36:46 -0000 1.15
@@ -28,9 +28,21 @@
var $classname = 'uauth';
function uauth() {
- global $HTTP_SESSION_VARS;
+ global $HTTP_SESSION_VARS, $group_ids, $uname, $db_fields, $group, $perms,
+ $uid, $exp;
if (!isset($HTTP_SESSION_VARS['group_ids'])) {
+ if (phpversion() <= '4.0.6') {
+ $group_ids = array(0);
+ $uname = '';
+ $db_fields = array();
+ $group = array();
+ $perms = array();
+ $uid = 0;
+ $exp = 0;
+ session_register(array('group_ids', 'uname', 'db_fields', 'group',
+ 'perms', 'uid', 'exp'));
+ }
$HTTP_SESSION_VARS['group_ids'] = array(0);
}
@@ -53,7 +65,8 @@
}
function auth_validatelogin() {
- global $_pv, $db, $select, $emailpass, $emailsuccess, $STRING, $HTTP_SESSION_VARS;
+ global $_pv, $db, $select, $emailpass, $emailsuccess, $STRING,
+ $HTTP_SESSION_VARS, $uid;
extract($_pv);
if (!$username) return 0;
@@ -81,7 +94,7 @@
foreach ($perms as $perm) {
$HTTP_SESSION_VARS['perms'][$perm] = true;
}
- $HTTP_SESSION_VARS['uid'] = $u['user_id'];
+ $HTTP_SESSION_VARS['uid'] = $u['user_id'];
return $u['user_id'];
}
|