[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /** 3 * FileManger - WebDAV access 4 * 5 * Using the PEAR HTTP/WebDAV/Server class (which need to be installed!) 6 * 7 * @link http://www.egroupware.org 8 * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License 9 * @package filemanger 10 * @author Ralf Becker <RalfBecker-AT-outdoor-training.de> 11 * @copyright (c) 2006 by Ralf Becker <RalfBecker-AT-outdoor-training.de> 12 * @version $Id: class.boetemplate.inc.php 21437 2006-04-24 20:42:42Z ralfbecker $ 13 */ 14 15 /** 16 * check if the given user has access 17 * 18 * Create a session or if the user has no account return authenticate header and 401 Unauthorized 19 * 20 * @param array &$account 21 * @return int session-id 22 */ 23 function check_access(&$account) 24 { 25 $account = array( 26 'login' => $_SERVER['PHP_AUTH_USER'], 27 'passwd' => $_SERVER['PHP_AUTH_PW'], 28 'passwd_type' => 'text', 29 ); 30 if (!($sessionid = $GLOBALS['egw']->session->create($account))) 31 { 32 header('WWW-Authenticate: Basic realm="eGroupWare WebDAV"'); 33 header("HTTP/1.1 401 Unauthorized"); 34 header("X-WebDAV-Status: 401 Unauthorized", true); 35 exit; 36 } 37 return $sessionid; 38 } 39 40 $GLOBALS['egw_info']['flags'] = array( 41 'disable_Template_class' => True, 42 'noheader' => True, 43 'currentapp' => 'filemanager', 44 'autocreate_session_callback' => 'check_access', 45 ); 46 // if you move this file somewhere else, you need to adapt the path to the header! 47 include('../header.inc.php'); 48 49 ExecMethod('phpgwapi.vfs_webdav_server.ServeRequest');
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |