diff options
-rwxr-xr-x | files/api.php | 3 | ||||
-rwxr-xr-x | inc/HTTP/WebDAV/Server.php | 34 | ||||
-rwxr-xr-x | inc/HTTP/WebDAV/Server/Filesystem.php | 12 | ||||
-rwxr-xr-x | inc/lib_base.php | 3 | ||||
-rwxr-xr-x | inc/lib_files.php | 3 | ||||
-rwxr-xr-x | inc/templates/header.php | 7 | ||||
-rwxr-xr-x | js/filebrowser.js | 13 | ||||
-rwxr-xr-x | js/lib_ajax.js | 2 | ||||
-rwxr-xr-x | js/lib_files.js | 15 |
9 files changed, 35 insertions, 57 deletions
diff --git a/files/api.php b/files/api.php index 5a4c8801d4e..b27228d9676 100755 --- a/files/api.php +++ b/files/api.php @@ -23,6 +23,9 @@ require_once('../inc/lib_base.php'); $arguments=$_POST; +if(!isset($_POST['action']) and isset($_GET['action'])){ + $arguments=$_GET; +} foreach($arguments as &$argument){ $argument=stripslashes($argument); diff --git a/inc/HTTP/WebDAV/Server.php b/inc/HTTP/WebDAV/Server.php index ba57aaf48be..c81b9c90b9d 100755 --- a/inc/HTTP/WebDAV/Server.php +++ b/inc/HTTP/WebDAV/Server.php @@ -33,35 +33,10 @@ +----------------------------------------------------------------------+ */ -oc_require_once "HTTP/WebDAV/Tools/_parse_propfind.php"; -oc_require_once "HTTP/WebDAV/Tools/_parse_proppatch.php"; -oc_require_once "HTTP/WebDAV/Tools/_parse_lockinfo.php"; -======= -<?php -// -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Hartmut Holzgraefe <hholzgra@php.net> | -// | Christian Stocker <chregu@bitflux.ch> | -// +----------------------------------------------------------------------+ -// -// $Id: Server.php,v 1.46 2006/03/03 21:43:09 hholzgra Exp $ -// oc_require_once("HTTP/WebDAV/Tools/_parse_propfind.php"); oc_require_once("HTTP/WebDAV/Tools/_parse_proppatch.php"); oc_require_once("HTTP/WebDAV/Tools/_parse_lockinfo.php"); ->>>>>>> 854e0c5a9c9060e827fbbfddffeeeadfc2d27278:inc/HTTP/WebDAV/Server.php + /** * Virtual base class for implementing WebDAV servers @@ -2162,11 +2137,4 @@ class HTTP_WebDAV_Server return $func_overload & 2 ? mb_strlen($str,'ascii') : strlen($str); } } - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ ?> diff --git a/inc/HTTP/WebDAV/Server/Filesystem.php b/inc/HTTP/WebDAV/Server/Filesystem.php index e2a672ee39e..35c9f362a54 100755 --- a/inc/HTTP/WebDAV/Server/Filesystem.php +++ b/inc/HTTP/WebDAV/Server/Filesystem.php @@ -32,9 +32,9 @@ | POSSIBILITY OF SUCH DAMAGE. | +----------------------------------------------------------------------+ */ - require_once "../../../lib_base.php"; - oc_require_once "HTTP/WebDAV/Server.php"; - oc_require_once "System.php"; + require_once("../inc/lib_base.php"); + oc_require_once("HTTP/WebDAV/Server.php"); + oc_require_once("System.php"); /** * Filesystem access using WebDAV @@ -726,13 +726,13 @@ $where = "WHERE path = '$options[path]' AND token = '$options[update]'"; $query = "SELECT owner, exclusivelock FROM locks $where"; - $res = OC_DB:query($query); - $row = OC_DB:fetch_assoc($res); + $res = OC_DB::query($query); + $row = OC_DB::fetch_assoc($res); OC_DB:free_result($res); if (is_array($row)) { $query = "UPDATE locks SET expires = '$options[timeout]', modified = ".time()." $where"; - OC_DB:query($query); + OC_DB::query($query); $options['owner'] = $row['owner']; $options['scope'] = $row["exclusivelock"] ? "exclusive" : "shared"; diff --git a/inc/lib_base.php b/inc/lib_base.php index 0661f732041..c597157b439 100755 --- a/inc/lib_base.php +++ b/inc/lib_base.php @@ -33,6 +33,7 @@ session_start(); // calculate the documentroot $SERVERROOT=substr(__FILE__,0,-17); $DOCUMENTROOT=$_SERVER['DOCUMENT_ROOT']; +$SERVERROOT=str_replace("\\",'/',$SERVERROOT); $count=strlen($DOCUMENTROOT); $WEBROOT=substr($SERVERROOT,$count); if($WEBROOT{0}!=='/'){ @@ -75,7 +76,7 @@ if(!is_dir($CONFIG_DATADIRECTORY)){ } if(OC_USER::isLoggedIn()){ //jail the user in a seperate data folder - $CONFIG_DATADIRECTORY.=$_SESSION['username_clean']; + $CONFIG_DATADIRECTORY.='/'.$_SESSION['username_clean']; if(!is_dir($CONFIG_DATADIRECTORY)){ mkdir($CONFIG_DATADIRECTORY); } diff --git a/inc/lib_files.php b/inc/lib_files.php index 2e77067b4a7..9bd349bfd06 100755 --- a/inc/lib_files.php +++ b/inc/lib_files.php @@ -94,6 +94,9 @@ class OC_FILES { if(strstr($files,'..') or strstr($dir,'..')){ die(); } + if(strpos($files,';')){ + $files=explode(';',$files); + } if(is_array($files)){ $zip = new ZipArchive(); $filename = sys_get_temp_dir()."/ownCloud.zip"; diff --git a/inc/templates/header.php b/inc/templates/header.php index 51e729cb8e1..8661008d95f 100755 --- a/inc/templates/header.php +++ b/inc/templates/header.php @@ -47,6 +47,7 @@ echo('<h1><a id="owncloud-logo" href="'.$WEBROOT.'"><span>ownCloud</span></a></h if(!$CONFIG_INSTALLED) { global $FIRSTRUN; $FIRSTRUN=true; + echo('</div><div class="body">'); echo('<div class="center">'); echo('<p class="errortext">'.$error.'</p>'); echo('<p class="highlighttext">First Run Wizard</p>'); @@ -54,11 +55,7 @@ echo('<h1><a id="owncloud-logo" href="'.$WEBROOT.'"><span>ownCloud</span></a></h echo('</div>'); OC_UTIL::showfooter(); exit(); - } - - - // show the loginform if not loggedin - if(!isset($_SESSION['username']) or $_SESSION['username']=='') { + }elseif(!isset($_SESSION['username']) or $_SESSION['username']=='') { // show the loginform if not loggedin echo('<div class="center">'); OC_UTIL::showloginform(); echo('</div>'); diff --git a/js/filebrowser.js b/js/filebrowser.js index cc03fe33156..c95e1290642 100755 --- a/js/filebrowser.js +++ b/js/filebrowser.js @@ -30,11 +30,11 @@ OC_FILES.browser.showInitial=function(){ OC_FILES.getdirectorycontent(dir,OC_FILES.browser.show_callback,true); } -OC_FILES.browser.show=function(dir){ +OC_FILES.browser.show=function(dir,forceReload){ if(!dir || !dir.split){ dir=''; } - OC_FILES.getdirectorycontent(dir,OC_FILES.browser.show_callback); + OC_FILES.getdirectorycontent(dir,OC_FILES.browser.show_callback,forceReload); } OC_FILES.browser.breadcrumb=new Object(); @@ -360,8 +360,8 @@ OC_FILES.browser.showMoreActions=function(){ input.setAttribute('id','newFileName'); form.addEvent('onsubmit',OC_FILES.browser.newFile); var submit=document.createElement('input'); - form.appendChild(submit); submit.type='submit'; + form.appendChild(submit); submit.value='Create'; OC_FILES.browser.moreActionsList=div; }else{ @@ -474,10 +474,10 @@ OC_FILES.browser.rename_cancel=function(file){ } OC_FILES.browser.showactions=function(file,hide){ - node=document.getElementById(file); + var node=document.getElementById(file); if(node &&(node.actionsshown || hide===true)){ - if(node.actionsdiv){ - node.removeChild(node.actionsdiv); + if(node.actionsshown){ + node.actionsdiv.parentNode.removeChild(node.actionsdiv); } node.actionsdiv=null; node.actionsshown=false @@ -492,6 +492,7 @@ OC_FILES.browser.showactions=function(file,hide){ table.appendChild(tbody); var file=OC_FILES.files[file] var actions=file.actions; + var name; for(name in actions){ if(actions[name].call && name!='default' && name!='dropOn' && name!='drop'){ tr=document.createElement('tr'); diff --git a/js/lib_ajax.js b/js/lib_ajax.js index 6a2ae53ee32..62899a9cd06 100755 --- a/js/lib_ajax.js +++ b/js/lib_ajax.js @@ -87,6 +87,7 @@ if(typeof Node=='undefined'){ // alert(tagName); node=document.createElementNative(tagName); var proto=new Node() + var name; for(name in proto){ node[name]=proto[name]; } @@ -118,7 +119,6 @@ if(typeof Node=='undefined'){ function getStyle(x,styleProp) { if (x.currentStyle){ - alert(x.currentStyle); var y = x.currentStyle[styleProp]; }else if (window.getComputedStyle){ var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp); diff --git a/js/lib_files.js b/js/lib_files.js index d1480e36637..aa70120e5e1 100755 --- a/js/lib_files.js +++ b/js/lib_files.js @@ -88,7 +88,7 @@ OC_FILES.getdirectorycontent=function(dir,callback,refresh){ OC_FILES.dir=''; OC_FILES.get=function(dir,file){ - window.location='files/get_file.php?dir='+encodeURIComponent(dir)+'&files='+encodeURIComponent(file); + window.location='files/api.php?action=get&dir='+encodeURIComponent(dir)+'&file='+encodeURIComponent(file); } OC_FILES.upload=function(dir,iframeId){ @@ -148,7 +148,13 @@ OC_FILES.upload_callback=function(iframeId){ this.uploadForm.parentNode.removeChild(this.uploadForm); this.parentNode.removeChild(this); OC_FILES.uploadIFrames[file.iframeId]=null; - OC_FILES.browser.show(file.dir); + if(file.name){ + OC_FILES.browser.show(file.dir); + }else{ + OC_FILES.browser.show(file.dir,true);//if the data from the file isn't correct, force a reload of the cache + } + }else{ + OC_FILES.browser.show(OC_FILES.dir); } } @@ -208,7 +214,7 @@ OC_FILES.remove_callback=function(req,name){ OC_FILES.getSelected=function(){ var nodes=document.getElementsByName('fileSelector'); var files=Array(); - for(index in nodes){ + for(var index=0;index<nodes.length;index++){ if(nodes[index].checked){ files[files.length]=nodes[index].value; } @@ -273,7 +279,7 @@ OC_FILES.move_callback=function(req,file){ OC_FILES.selectAll=function(){ var value=document.getElementById('select_all').checked; var nodes=document.getElementsByName('fileSelector'); - for(index in nodes){ + for(var index=0;index<nodes.length;index++){ if(nodes[index].value){ nodes[index].checked=value; } @@ -300,7 +306,6 @@ OC_FILES.actions_selected.download=function(){ files=files[0]; } OC_FILES.get(dir,files); -// window.location=WEBROOT+'/files/get_file.php?dir='+OC_FILES.dir+'&files='+files; } OC_FILES.actions_selected['delete']=function(){ |