Exemple #1
0
 <br><input type="submit" value="upload">
 </form>');
		}else
		{
			$nomain=false;
			
			$success = upload_files();
			
			if($success) light_message('Files were successfully uploaded to server');
			else light_message('There were some errors while uploading.');
		}
		break;
	case 'upload-new':
	case 'download-new':
		
		if( ($mess=update_dolphin('light_message')) !== NEED_UPLOAD && $mess === true)
		{
			light_message('Update completed successfully.');
		}else if( $mess === NEED_UPLOAD )
		{
			light_message('<form action="index.php?act=upload-new" method="POST" enctype="multipart/form-data">
To upload new version of '.SNAME.', you need to <a href="'.MASTER_SITE.'/files/dolphin-current.zip">download the latest version of '.SNAME.'</a> and upload it here. All required operations will be done automatically.
<br><br><input type="file" name="files[]">
<br><br><input type="checkbox" name="save-login" value="true" id="save-login" checked=checked><label for="save-login"> Save configuration and login information. </label>
<br><input type="submit" value="upload">
</form>');
		}else
		{
			light_message($mess);
		}
		
Exemple #2
0
		'end'    => $end,
		'success' => $success,
		);
	}
	break;
case 'zip':
	$_RESULT = add_to_zip($fz);
	if(!$_RESULT) echo 'Could not add to zip.'.reason();
	break;
case 'unzip':
	$_RESULT = unzip_files(array($f), $_REQUEST['mode']);
	if(!$_RESULT) echo 'Could not extract files.'.reason();
	break;
case 'update':
	$_REQUEST['act'] = 'download-new'; /* for correct work of update_dolphin() */
	$_RESULT = update_dolphin(create_function('$cmd','return true;'))===true;
	break;
case 'ping':
	$_RESULT = 'pong';
	break;
case 'handletab':
	$cmd = ltrim($_REQUEST['cmd']);
	
	$parts = explode(' ', $cmd);
	
	if(sizeof($parts) <= 1) /* autocomplete command */
	{
		list($dirs, $exts) = get_path_dirs();
		foreach($exts as $k=>$v) $exts[$k] = trim(strtolower($v));
		$tmp = strtolower($cmd);
		$l = strlen($cmd);