*** extra.class.php.orig	2010-09-07 20:28:34.000000000 +0200
--- extra.class.php	2010-09-07 18:14:00.000000000 +0200
***************
*** 4,9 ****
--- 4,14 ----
   *
   * @author    Chris Smith <chris@jalakai.co.uk>
   */
+  
+ define('GLOB_NODIR',256);
+ define('GLOB_PATH',512);
+ define('GLOB_NODOTS',1024);
+ define('GLOB_RECURSE',2048);
  
  if (!class_exists('setting_sepchar')) {
    class setting_sepchar extends setting_multichoice {
***************
*** 44,60 ****
  
      function initialize($default,$local,$protected) {
  
!       // populate $this->_choices with a list of available auth mechanisms
!       $authtypes = glob(DOKU_INC.'inc/auth/*.class.php');
!       $authtypes = preg_replace('#^.*/([^/]*)\.class\.php$#i','$1', $authtypes);
!       $authtypes = array_diff($authtypes, array('basic'));
!       sort($authtypes);
  
!       $this->_choices = $authtypes;
  
!       parent::initialize($default,$local,$protected);
      }
-   }
  }
  
  if (!class_exists('setting_im_convert')) {
--- 49,108 ----
  
      function initialize($default,$local,$protected) {
  
! 	    // populate $this->_choices with a list of available auth mechanisms
! 		//echo $_SERVER['safe_glob'];
! 		$authtypes = glob(DOKU_INC."inc/auth/*.class.php");
! 		$authtypes = preg_replace('#^.*/([^/]*)\.class\.php$#i','$1', $authtypes);
! 		
! 		//$authtypes = safe_glob(DOKU_INC."inc/auth/*.class.php");
! 		//$authtypes = preg_replace('#^.*/([^/]*)\.class\.php$#i','$1', $authtypes);
! 	
! 		$authtypes = array_diff($authtypes, array('basic'));
! 		sort($authtypes);
! 		$this->_choices = $authtypes;
! 	
! 		parent::initialize($default,$local,$protected);
!     }
!   }
! }
  
! function safe_glob($pattern, $flags=0) {
!     $split=explode('/',str_replace('\\','/',$pattern));
!     $mask=array_pop($split);
!     $path=implode('/',$split);
!     if (($dir=opendir($path))!==false) {
!         $glob=array();
!         while(($file=readdir($dir))!==false) {
!             // Recurse subdirectories (GLOB_RECURSE)
!             if( ($flags&GLOB_RECURSE) && is_dir($file) && (!in_array($file,array('.','..'))) )
!                 $glob = array_merge($glob, array_prepend(safe_glob($path.'/'.$file.'/'.$mask, $flags),
!                     ($flags&GLOB_PATH?'':$file.'/')));
!             // Match file mask
!             if (fnmatch($mask,$file)) {
!                 if ( ( (!($flags&GLOB_ONLYDIR)) || is_dir("$path/$file") )
!                   && ( (!($flags&GLOB_NODIR)) || (!is_dir($path.'/'.$file)) )
!                   && ( (!($flags&GLOB_NODOTS)) || (!in_array($file,array('.','..'))) ) )
!                     $glob[] = ($flags&GLOB_PATH?$path.'/':'') . $file . ($flags&GLOB_MARK?'/':'');
!             }
!         }
!         closedir($dir);
!         if (!($flags&GLOB_NOSORT)) sort($glob);
!         return $glob;
!     } else {
!         return false;
!     }    
! }
  
! /**
!  * A better "fnmatch" alternative for windows that converts a fnmatch
!  * pattern into a preg one. It should work on PHP >= 4.0.0.
!  * @author soywiz at php dot net
!  * @since 17-Jul-2006 10:12
!  */
! if (!function_exists('fnmatch')) {
!     function fnmatch($pattern, $string) {
!         return @preg_match('/^' . strtr(addcslashes($pattern, '\\.+^$(){}=!<>|'), array('*' => '.*', '?' => '.?')) . '$/i', $string);
      }
  }
  
  if (!class_exists('setting_im_convert')) {
