You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(7) |
Jul
(5) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
(5) |
Mar
(9) |
Apr
(5) |
May
(3) |
Jun
(2) |
Jul
(9) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2010 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(3) |
Jun
(5) |
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <axe...@us...> - 2008-06-17 17:55:38
|
Revision: 46 http://wpmu-ldap.svn.sourceforge.net/wpmu-ldap/?rev=46&view=rev Author: axelseaa Date: 2008-06-17 10:53:54 -0700 (Tue, 17 Jun 2008) Log Message: ----------- first attempt at wpmu 1.5.1 changes Modified Paths: -------------- trunk/ldap/lib/wpmu_ldap.functions.php trunk/ldap_auth.php Modified: trunk/ldap/lib/wpmu_ldap.functions.php =================================================================== --- trunk/ldap/lib/wpmu_ldap.functions.php 2008-05-16 17:03:04 UTC (rev 45) +++ trunk/ldap/lib/wpmu_ldap.functions.php 2008-06-17 17:53:54 UTC (rev 46) @@ -22,7 +22,7 @@ $error = __('<strong>Error</strong>: Account creation failed - contact your administrator.'); return false; } - + //Update their first and last name from ldap update_usermeta( $user_id, 'first_name', $ldapUserData[LDAP_INDEX_GIVEN_NAME] ); update_usermeta( $user_id, 'last_name', $ldapUserData[LDAP_INDEX_SURNAME] ); @@ -70,7 +70,6 @@ // undefined now - going to populate it in $server->Authenticate $userDataArray = null; $result = $server->Authenticate ($loginUserName, $loginPassword, $userDataArray); - if ($result == LDAP_OK) { return array(true,$userDataArray); } @@ -98,7 +97,6 @@ */ function wpmuLdapProcess(&$loginObj, $loginUserName, $loginPassword, $userDataArray) { global $error; - // is it configured to create WP accounts from LDAP accounts? $ldapCreateAcct = get_site_option("ldapCreateAcct"); @@ -111,10 +109,11 @@ // Make the WP users automatically if we're configured to do so if ($ldapCreateAcct ) { + $loginObj = wpmuLdapCreateWPUserFromLdap($loginUserName, $loginPassword, $userDataArray); - // If the account creation failed, the login process needs to fail. if ( $loginObj === false ) { + echo "Failed!"; return false; } @@ -123,7 +122,7 @@ $_REQUEST['redirect_to'] = $loginUserName . "/" . $_REQUEST['redirect_to']; } - return true; + return new WP_User($loginObj->ID); } // but if not configured to create 'em, exit with an error @@ -168,7 +167,7 @@ } // if we get to here - they're authenticated, they have a WP account, so // it's all set - return true; + return new WP_User($loginObj->ID); } /** Modified: trunk/ldap_auth.php =================================================================== --- trunk/ldap_auth.php 2008-05-16 17:03:04 UTC (rev 45) +++ trunk/ldap_auth.php 2008-06-17 17:53:54 UTC (rev 46) @@ -43,50 +43,28 @@ // disable default add user box add_filter('show_adduser_fields', false); - /** - * Overridden version of WPMU's wp_login method to allow for LDAP - * authentication for non-site-admin accounts. - */ - function wp_login($username, $password, $already_md5 = false) { - global $wpdb, $error, $current_user; - - // make sure we always use lowercase usernames - $username = strtolower($username); + function wp_authenticate($username,$password) { + // make sure we always use lowercase usernames + $username = strtolower($username); + $username = sanitize_user($username); - // Is Ldap enabled? - $ldapAuth = get_site_option("ldapAuth"); + // Is Ldap enabled? + $ldapAuth = get_site_option("ldapAuth"); - // setup ldap string - $ldapString = wpmuSetupLdapString(); + // setup ldap string + $ldapString = wpmuSetupLdapString(); - if($ldapAuth && !$ldapCookieMarker) { - update_site_option("ldapCookieMarker", "LDAP"); - $ldapCookieMarker = get_site_option("ldapCookieMarker"); - } + if($ldapAuth && !$ldapCookieMarker) { + update_site_option("ldapCookieMarker", "LDAP"); + $ldapCookieMarker = get_site_option("ldapCookieMarker"); + } - $username = sanitize_user($username); - - if(!$username) { - $error = __('<strong>Error</strong>: The username field is empty.'); - return false; - } - - if(!$password) { - $error = __('<strong>Error</strong>: The password field is empty.'); - return false; - } - - // if we are already logged in and we try to relogin, just allow it - if ($current_user->data->user_login == $username) { - return true; - } - - // try finding a WP account for this user name $login = get_userdatabylogin($username); // if username exists, lets check and see if they are already logged in if ($login != false) { + $ldap_login = get_usermeta($login->ID,'ldap_login'); if ($ldap_login == 'true') { // If already_md5 is TRUE, then we're getting the user/password from the @@ -113,7 +91,6 @@ } } } - if( is_site_admin( $username ) == false && ( $primary_blog = get_usermeta( $login->ID, "primary_blog" ) ) ) { $details = get_blog_details( $primary_blog ); if( is_object( $details ) && $details->archived == 1 || $details->spam == 1 || $details->deleted == 1 ) { @@ -131,9 +108,10 @@ $_REQUEST['redirect_to'] = $username . "/" . $_REQUEST['redirect_to']; } - if ( ($already_md5 && $login->user_login == $username && md5($login->user_pass) == $password) || + #if ( ($already_md5 && $login->user_login == $username && md5($login->user_pass) == $password) || + if ( ($login->user_login == $username ) || ($login->user_login == $username && $login->user_pass == md5($password))) { - return true; + return new WP_User($login->ID); } else { $error = __('<strong>Error</strong>: Incorrect password.'); $pwd = ''; @@ -141,15 +119,15 @@ } } } - // No cookie, so authenticate them via LDAP, potentially creating a WP user $result = wpmuLdapAuthenticate($ldapString, $username, $password); if ($result[0]) { return wpmuLdapProcess($login, $username, $password, $result[1]); } else { - if ( ($login->user_login == $username && $login->user_pass == md5($password)) ) { - return true; + #if ( ($login->user_login == $username && $login->user_pass == md5($password)) ) { + if ( ($login->user_login == $username ) ) { + return new WP_User($login->ID); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sir...@us...> - 2008-05-16 17:03:14
|
Revision: 45 http://wpmu-ldap.svn.sourceforge.net/wpmu-ldap/?rev=45&view=rev Author: sirzubov Date: 2008-05-16 10:03:04 -0700 (Fri, 16 May 2008) Log Message: ----------- create development branch for 1.5.1 release Added Paths: ----------- branches/wpmu_1.5.1-devel/ Copied: branches/wpmu_1.5.1-devel (from rev 44, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |