Project

General

Profile

Revision 201

View differences:

trunk/webdav_authenticate.php
52 52

  
53 53
function AuthenticationBasicHTTP($realm, $users, $phpcgi=0) {
54 54

  
55
	if (empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['REDIRECT_REMOTE_USER'])) {
55
	if ((empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['REDIRECT_REMOTE_USER'])) || empty($_SERVER['PHP_AUTH_PW'])) {
56 56
		header('WWW-Authenticate: Basic realm="'.$realm.'"');
57 57
		header('HTTP/1.0 401 Unauthorized');
58 58
		die('401 Unauthorized');
......
66 66
		$_SERVER['PHP_AUTH_PW']    = strip_tags($password);
67 67
	}
68 68

  
69
	if (array_key_exists($user, $users) && $users[$user] == extEncodePassword($_SERVER['PHP_AUTH_PW']) ){
70
		if( !empty($GLOBALS['webdav_authentication_method']) && file_exists(_EXT_PATH.'/include/authentication/'.$GLOBALS['webdav_authentication_method'].'.php') ) {
71
			require_once( _EXT_PATH.'/include/authentication/'.$GLOBALS['webdav_authentication_method'].'.php');
72
			$classname = 'ext_'.$GLOBALS['webdav_authentication_method'].'_authentication';
73
			$auth = new $classname();
74
			
75
		} else {
76
			require_once( _EXT_PATH.'/include/authentication/extplorer.php');
77
			$auth = new ext_extplorer_authentication();
78
		}
79
		$auth->onAuthenticate(array('user' => $user, 'password' => $_SERVER['PHP_AUTH_PW'] ));
69
	if( !empty($GLOBALS['webdav_authentication_method']) && file_exists(_EXT_PATH.'/include/authentication/'.$GLOBALS['webdav_authentication_method'].'.php') ) {
70
		require_once( _EXT_PATH.'/include/authentication/'.$GLOBALS['webdav_authentication_method'].'.php');
71
		$classname = 'ext_'.$GLOBALS['webdav_authentication_method'].'_authentication';
72
		$auth = new $classname();
73
		
74
	} else {
75
		require_once( _EXT_PATH.'/include/authentication/extplorer.php');
76
		$auth = new ext_extplorer_authentication();
77
	}
78
	if( $auth->onAuthenticate(array('username' => $user, 'password' => $_SERVER['PHP_AUTH_PW'] )) !== false ) {
80 79
		return TRUE;
81 80
	}
82

  
83 81
	header('WWW-Authenticate: Basic realm="'.$realm.'"');
84 82
	header('HTTP/1.0 401 Unauthorized');
85 83
	die('401 Unauthorized');
trunk/include/authentication/ftp.php
2 2
// ensure this file is being included by a parent file
3 3
if( !defined( '_JEXEC' ) && !defined( '_VALID_MOS' ) ) die( 'Restricted access' );
4 4
/**
5
 * @version $Id: ftp_authentication.php 194 2011-05-30 18:48:16Z sloarch $
5
 * @version $Id$
6 6
 * @package eXtplorer
7 7
 * @copyright soeren 2007-2011
8 8
 * @author The eXtplorer project (http://extplorer.net)
9 9

  
trunk/include/authentication/ssh2.php
2 2
// ensure this file is being included by a parent file
3 3
if( !defined( '_JEXEC' ) && !defined( '_VALID_MOS' ) ) die( 'Restricted access' );
4 4
/**
5
 * @version $Id: ftp_authentication.php 194 2011-05-30 18:48:16Z sloarch $
5
 * @version $Id$
6 6
 * @package eXtplorer
7 7
 * @copyright soeren 2007-2011
8 8
 * @author The eXtplorer project (http://extplorer.net)
9 9

  
trunk/include/authentication/extplorer.php
2 2
// ensure this file is being included by a parent file
3 3
if( !defined( '_JEXEC' ) && !defined( '_VALID_MOS' ) ) die( 'Restricted access' );
4 4
/**
5
 * @version $Id: ftp_authentication.php 143 2009-05-30 20:22:16Z sloarch $
5
 * @version $Id$
6 6
 * @package eXtplorer
7 7
 * @copyright soeren 2007-2010
8 8
 * @author The eXtplorer project (http://extplorer.net)
......
42 42
		//------------------------------------------------------------------------------
43 43

  
44 44
		$data=ext_find_user( $credentials['username'],null );
45
		// Username not existing
46
		if( $data === NULL ) return false;
47
		
45 48
		require_once( _EXT_PATH.'/libraries/PasswordHash.php');
46 49
		$hasher = new PasswordHash(8, FALSE);
47 50
		$result = $hasher->CheckPassword($credentials['password'], $data[1]);
48 51

  
trunk/include/diff.php
2 2
// ensure this file is being included by a parent file
3 3
if( !defined( '_JEXEC' ) && !defined( '_VALID_MOS' ) ) die( 'Restricted access' );
4 4
/**
5
 * @version $Id: edit.php 129 2009-01-26 16:14:53Z ryu_ms $
5
 * @version $Id$
6 6
 * @package eXtplorer
7 7
 * @copyright Geoffrey Tran 2009
8 8
 * @author The eXtplorer project (http://extplorer.net)
9 9

  

Also available in: Unified diff