Beispiel #1
0
/**
 * The function authorizes you and shows login screen
 *
 */
function auth()
{
	global $CFG;
	
	$ajax = false;

	/* the workaround code for Safari's bug with <select> */
	
	if(!empty($_REQUEST['version_hid']) && $_REQUEST['version_hid']!=$_REQUEST['version'] && $_REQUEST['version_hid']=='full') $_REQUEST['version'] = 'full';
	
	if(!empty($_REQUEST['JsHttpRequest']))
	{
		$ajax = true;
		ajax_start_transfer();
		if(empty($_REQUEST['version'])) $_REQUEST['version']='full';
		else if($_REQUEST['version']!='full' /*light?*/) define('VER', 'full');
	}
	
	
	
	if(@$_REQUEST['login']==$CFG['login'] && @$_REQUEST['pass']==$CFG['password'])
	{
		$_SESSION['logined']=true;
		$_SESSION['login']=$CFG['login'];
		$_SESSION['pass']=$CFG['password'];
		switch(@$_REQUEST['version'])
		{
		default:
		case 'light':
			$_SESSION['version']='light';
			break;
		case 'full':
			$_SESSION['version']='full';
			break;
		case 'uploader':
			$_SESSION['version']='uploader';
			break;
		}
		
		if(!empty($_REQUEST['DIR'])) $_SESSION['DIR'] = clean($_REQUEST['DIR']);
		
		if(!$ajax)
		{
			header('location: index.php?DIR=.&'.SID);
			die();
		}else
		{
			return; /* handle our query properly */
		}
	}
	
	if(empty($_SESSION['logined']) || $_SESSION['login']!=$CFG['login'] || $_SESSION['pass']!=$CFG['password'])
	{
		$_SESSION['savedreq'] = array($_REQUEST, $_GET, $_POST);
		
		if(!$ajax)
		{
			include(ROOT.'/system/login.html');
		}else
		{	
			echo '--error-login-required';
		}
		die();
	}
}
Beispiel #2
0
<?
// the file of actions of FULL version

// all actions are JsHttpRequest backends

if(!function_exists('dolphin_handler')) die('dolphin not found');

ajax_start_transfer();

$fz=array(); /* filez :) */
$f=false;

if(!empty($_REQUEST['file'])) $fz[]=$f=clean($_REQUEST['file']);
if(!empty($_REQUEST['fullpath'])) $fz[]=$f=clean($_REQUEST['fullpath']);
if(!empty($_REQUEST['items']))
{
	foreach($_REQUEST['items'] as $v) $fz[]=clean($v/*['fullpath']*/);
	$f=$fz[0];
}

switch(@$_REQUEST['act'])
{
case 'filelist':
	$res = read_directory();
	$first_files = explode("/", substr($res['res'], 0, 20000));
	if (count($first_files)) array_pop($first_files);
	
	$_RESULT = array(
		'res'        => $res ? $res['res'] : false,
		'count'      => $res ? $res['cnt'] : false,
		'fileinfo'   => get_files_info($first_files),