Update of /cvsroot/phpwiki/phpwiki/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28015
Modified Files:
IniConfig.php WikiUserNew.php
Log Message:
fixed LDAP_SET_OPTION handling, LDAP error on connection problem
Index: IniConfig.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/IniConfig.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -2 -b -p -d -r1.41 -r1.42
--- IniConfig.php 25 Jun 2004 14:29:17 -0000 1.41
+++ IniConfig.php 28 Jun 2004 15:01:07 -0000 1.42
@@ -233,21 +233,4 @@ function IniConfig($file) {
$GLOBALS['USER_AUTH_ORDER'] = array("PersonalPage");
- // LDAP bind options
- global $LDAP_SET_OPTION;
- if (defined('LDAP_SET_OPTION') and LDAP_SET_OPTION) {
- $optlist = preg_split('/\s*:\s*/', LDAP_SET_OPTION);
- foreach ($optlist as $opt) {
- $bits = preg_split('/\s*=\s*/', $opt, 2);
- if (count($bits) == 2) {
- if (is_string($bits[0]) and defined($bits[0]))
- $bits[0] = constant($bits[0]);
- $LDAP_SET_OPTION[$bits[0]] = $bits[1];
- }
- else {
- // Possibly throw some sort of error?
- }
- }
- }
-
// Now it's the external DB authentication stuff's turn
if (in_array('Db', $GLOBALS['USER_AUTH_ORDER']) &&
empty($rs['DBAUTH_AUTH_DSN'])) {
@@ -269,5 +252,7 @@ function IniConfig($file) {
);
foreach ($DBAP_MAP as $rskey => $apkey) {
- if (isset($rs[$rskey])) {
+ if (defined($rskey)) {
+ $DBAuthParams[$apkey] = constant($rskey);
+ } elseif (isset($rs[$rskey])) {
$DBAuthParams[$apkey] = $rs[$rskey];
} elseif (isset($rsdef[$rskey])) {
@@ -285,4 +270,21 @@ function IniConfig($file) {
}
+ // LDAP bind options
+ global $LDAP_SET_OPTION;
+ if (defined('LDAP_SET_OPTION') and LDAP_SET_OPTION) {
+ $optlist = preg_split('/\s*:\s*/', LDAP_SET_OPTION);
+ foreach ($optlist as $opt) {
+ $bits = preg_split('/\s*=\s*/', $opt, 2);
+ if (count($bits) == 2) {
+ if (is_string($bits[0]) and defined($bits[0]))
+ $bits[0] = constant($bits[0]);
+ $LDAP_SET_OPTION[$bits[0]] = $bits[1];
+ }
+ else {
+ // Possibly throw some sort of error?
+ }
+ }
+ }
+
// Default Wiki pages to force loading from pgsrc
global $GenericPages;
@@ -608,4 +610,7 @@ function fix_configs() {
// $Log$
+// Revision 1.42 2004/06/28 15:01:07 rurban
+// fixed LDAP_SET_OPTION handling, LDAP error on connection problem
+//
// Revision 1.41 2004/06/25 14:29:17 rurban
// WikiGroup refactoring:
Index: WikiUserNew.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiUserNew.php,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -2 -b -p -d -r1.102 -r1.103
--- WikiUserNew.php 27 Jun 2004 10:23:48 -0000 1.102
+++ WikiUserNew.php 28 Jun 2004 15:01:07 -0000 1.103
@@ -2072,5 +2072,8 @@ extends _PassUser
? LDAP_SEARCH_FIELD."=$userid"
: "uid=$userid";
- $this->_sr = ldap_search($ldap, LDAP_BASE_DN, $st_search);
+ if (!$this->_sr = ldap_search($ldap, LDAP_BASE_DN, $st_search)) {
+ $this->_free();
+ return $this->_tryNextPass($submitted_password);
+ }
$info = ldap_get_entries($ldap, $this->_sr);
if (empty($info["count"])) {
@@ -2108,5 +2111,8 @@ extends _PassUser
? LDAP_SEARCH_FIELD."=$userid"
: "uid=$userid";
- $this->_sr = ldap_search($ldap, LDAP_BASE_DN, $st_search);
+ if (!$this->_sr = ldap_search($ldap, LDAP_BASE_DN, $st_search)) {
+ $this->_free();
+ return $this->_tryNextUser();
+ }
$info = ldap_get_entries($ldap, $this->_sr);
@@ -3035,4 +3041,7 @@ extends UserPreferences
// $Log$
+// Revision 1.103 2004/06/28 15:01:07 rurban
+// fixed LDAP_SET_OPTION handling, LDAP error on connection problem
+//
// Revision 1.102 2004/06/27 10:23:48 rurban
// typo detected by Philippe Vanhaesendonck
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
|