Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pax2003

    (@pax2003)

    here is the code:

    function wp_login($username, $password, $already_md5 = false) {
    	global $wpdb, $error;
    	if ( '' == $username )
    		return false;
    
    	if ( '' == $password ) {
    		$error = __('<strong>Error</strong>: The password field is empty.');
    		return false;
    	}
    
    	$auth = true;#ldap_auth($username, $password);
    	$login = get_userdatabylogin($username);
    	#
    	if($auth and $login){
    		#print "return true r2";
    		return true;
    	}
    	if(! $auth and $login){
    		if($login->user_pass==$password){
    			#print "return true r1";
    			return true;
    		}
    		$error = __('<strong>Error</strong>: Login error.');
    		return false;
    	}
    
    	# if auth is true but login is false, make new user
    	if($auth and ! $login){
    		if(! function_exists("wp_create_user"))print "before";
    
    		$userid = 23 ;#wp_create_user($username, $password, $username."@njit.edu");
    		#print "created new user";
    		$login = get_userdata($userid);
    		print_r($login);
    		if(! $login) {
    			#print "error getting info from new user";
    			$error = __("error getting info from new user");
    			return false;
    		}
    		else{
    			return true;
    		}
    	}
    
    	return false;
    }

    Thread Starter pax2003

    (@pax2003)

    dose any one know this

Viewing 2 replies - 1 through 2 (of 2 total)