diff --git a/files/delete.php b/files/delete.php index 1c660d97807..7d19a45a73a 100644 --- a/files/delete.php +++ b/files/delete.php @@ -25,10 +25,12 @@ require_once('../inc/lib_base.php'); $dir=$_GET['dir']; $file=$_GET['file']; if(isset($_SESSION['username']) and $_SESSION['username'] and strpos($dir,'..')===false){ - $file=$CONFIG_DATADIRECTORY.'/'.$dir.'/'.$file; - if(is_file($file)){ - unlink($file); - } + $file=$CONFIG_DATADIRECTORY.'/'.$dir.'/'.$file; + if(is_file($file)){ + unlink($file); + }elseif(is_dir($file)){ + rmdir($file); + } } ?> \ No newline at end of file diff --git a/files/get_files.php b/files/get_files.php index 29f06d289d5..287b8cd453e 100644 --- a/files/get_files.php +++ b/files/get_files.php @@ -42,21 +42,23 @@ function return_bytes($val) { header('Content-type: application/xml'); $dir=isset($_GET['dir'])?$_GET['dir']:''; -$files=OC_FILES::getdirectorycontent($CONFIG_DATADIRECTORY.'/'.$dir); -$dirname=$files[0]['directory']; +$files=OC_FILES::getdirectorycontent(realpath($CONFIG_DATADIRECTORY.'/'.$dir)); +$dirname=(isset($files[0]))?$files[0]['directory']:''; $dirname=substr($dirname,strrpos($dirname,'/')); $max_upload=min(return_bytes(ini_get('post_max_size')),return_bytes(ini_get('upload_max_filesize'))); ob_clean(); echo "\n"; echo "\n"; -foreach($files as $file){ - $attributes=''; - foreach($file as $name=>$data){ - $data=str_replace("'",''',$data); - if (is_string($name)) $attributes.=" $name='$data'"; - } - $attributes.=' date=\''.date($CONFIG_DATEFORMAT,$file['mtime']).'\''; - echo "\n"; +if(is_array($files)){ + foreach($files as $file){ + $attributes=''; + foreach($file as $name=>$data){ + $data=str_replace("'",''',$data); + if (is_string($name)) $attributes.=" $name='$data'"; + } + $attributes.=' date=\''.date($CONFIG_DATEFORMAT,$file['mtime']).'\''; + echo "\n"; + } } -echo ""; +echo "\n"; ?> \ No newline at end of file diff --git a/files/move.php b/files/move.php new file mode 100644 index 00000000000..7103662c4a2 --- /dev/null +++ b/files/move.php @@ -0,0 +1,35 @@ +. +* +*/ +require_once('../inc/lib_base.php'); + +$sourceDir=$_GET['sourcedir']; +$targetDir=$_GET['targetdir']; +$source=$_GET['source']; +$target=$_GET['target']; +if(isset($_SESSION['username']) and $_SESSION['username'] and strpos($sourceDir,'..')===false and strpos($source,'..')===false and strpos($targetDir,'..')===false and strpos($target,'..')===false){ + $target=$CONFIG_DATADIRECTORY.'/'.$targetDir.'/'.$target.'/'.$source; + $source=$CONFIG_DATADIRECTORY.'/'.$sourceDir.'/'.$source; + rename($source,$target); +} + +?> \ No newline at end of file diff --git a/files/new.php b/files/new.php new file mode 100644 index 00000000000..c5d5608a567 --- /dev/null +++ b/files/new.php @@ -0,0 +1,38 @@ +. +* +*/ +require_once('../inc/lib_base.php'); + +$dir=$_GET['dir']; +$name=$_GET['name']; +$type=$_GET['type']; +if(isset($_SESSION['username']) and $_SESSION['username'] and strpos($dir,'..')===false and strpos($name,'..')===false){ + $file=$CONFIG_DATADIRECTORY.'/'.$dir.'/'.$name; + if($type=='dir'){ + mkdir($file); + }elseif($type=='file'){ + $fileHandle=fopen($file, 'w') or die("can't open file"); + fclose($fileHandle); + } +} + +?> \ No newline at end of file diff --git a/img/arrow_down.png b/img/arrow_down.png index 0e0ab3c4c08..ecbca6ef606 100755 Binary files a/img/arrow_down.png and b/img/arrow_down.png differ diff --git a/img/arrow_up.png b/img/arrow_up.png new file mode 100644 index 00000000000..e2457c88838 Binary files /dev/null and b/img/arrow_up.png differ diff --git a/img/icons/loading.gif b/img/icons/loading.gif new file mode 100644 index 00000000000..40efb9be594 Binary files /dev/null and b/img/icons/loading.gif differ diff --git a/inc/lib_base.php b/inc/lib_base.php index 8c0c1ca606e..e4309261709 100755 --- a/inc/lib_base.php +++ b/inc/lib_base.php @@ -35,6 +35,9 @@ $SERVERROOT=substr(__FILE__,0,-17); $DOCUMENTROOT=$_SERVER['DOCUMENT_ROOT']; $count=strlen($DOCUMENTROOT); $WEBROOT=substr($SERVERROOT,$count); +if($WEBROOT{0}!=='/'){ + $WEBROOT='/'.$WEBROOT; +} // set the right include path set_include_path(get_include_path().PATH_SEPARATOR.$SERVERROOT.PATH_SEPARATOR.$SERVERROOT.'/inc'.PATH_SEPARATOR.$SERVERROOT.'/config'); @@ -42,11 +45,12 @@ set_include_path(get_include_path().PATH_SEPARATOR.$SERVERROOT.PATH_SEPARATOR.$S // define default config values $CONFIG_ADMINLOGIN=''; $CONFIG_ADMINPASSWORD=''; -$CONFIG_DATADIRECTORY=$SERVERROOT.$WEBROOT.'/data'; +$CONFIG_DATADIRECTORY=$SERVERROOT.'/data'; $CONFIG_HTTPFORCESSL=false; $CONFIG_DATEFORMAT='j M Y G:i'; $CONFIG_DBNAME='owncloud'; $CONFIG_DBTYPE='sqlite'; + // include the generated configfile @include_once('config.php'); @@ -63,7 +67,6 @@ if(isset($CONFIG_HTTPFORCESSL) and $CONFIG_HTTPFORCESSL){ require_once('lib_files.php'); require_once('lib_log.php'); require_once('lib_config.php'); -require_once('lib_ocs.php'); // load plugins $CONFIG_LOADPLUGINS='music'; @@ -247,6 +250,7 @@ class OC_DB { */ static function query($cmd) { global $DOCUMENTROOT; + global $SERVERROOT; global $DBConnection; global $CONFIG_DBNAME; global $CONFIG_DBHOST; @@ -255,9 +259,9 @@ class OC_DB { global $CONFIG_DBTYPE; if(!isset($DBConnection)) { if($CONFIG_DBTYPE=='sqlite'){ - $DBConnection = @new SQLiteDatabase($DOCUMENTROOT.'/'.$CONFIG_DBNAME); + $DBConnection = @new SQLiteDatabase($SERVERROOT.'/'.$CONFIG_DBNAME); }elseif($CONFIG_DBTYPE=='mysql'){ - $DBConnection =@new mysqli($CONFIG_DBHOST, $CONFIG_DBUSER, $CONFIG_DBPASSWORD,$CONFIG_DBNAME); + $DBConnection = @new mysqli($CONFIG_DBHOST, $CONFIG_DBUSER, $CONFIG_DBPASSWORD,$CONFIG_DBNAME); } if (!$DBConnection) { @ob_end_clean(); @@ -288,6 +292,7 @@ class OC_DB { */ static function multiquery($cmd) { global $DOCUMENTROOT; + global $SERVERROOT; global $DBConnection; global $CONFIG_DBNAME; global $CONFIG_DBTYPE; @@ -296,7 +301,7 @@ class OC_DB { global $CONFIG_DBPASSWORD; if(!isset($DBConnection)) { if($CONFIG_DBTYPE=='sqlite'){ - $DBConnection = @new SQLiteDatabase($DOCUMENTROOT.'/'.$CONFIG_DBNAME); + $DBConnection = new SQLiteDatabase($SERVERROOT.'/'.$CONFIG_DBNAME); }elseif($CONFIG_DBTYPE=='mysql'){ $DBConnection = @new mysqli($CONFIG_DBHOST, $CONFIG_DBUSER, $CONFIG_DBPASSWORD,$CONFIG_DBNAME); } diff --git a/inc/lib_config.php b/inc/lib_config.php index e3bce232f5e..a3270ab41b3 100755 --- a/inc/lib_config.php +++ b/inc/lib_config.php @@ -27,73 +27,102 @@ class OC_CONFIG{ global $CONFIG_DBUSER; global $CONFIG_DBPASSWORD; global $CONFIG_DBTYPE; + global $CONFIG_ADMINLOGIN; + global $CONFIG_ADMINPASSWORD; if(isset($_POST['set_config'])){ //checkdata - $error=''; - $FIRSTRUN=!isset($CONFIG_ADMINLOGIN); - if(!$FIRSTRUN){ - if($_POST['currentpassword']!=$CONFIG_ADMINPASSWORD){ - $error.='wrong password'; - } - } - - if(!isset($_POST['adminlogin']) or empty($_POST['adminlogin'])) $error.='admin login not set
'; - if(!isset($_POST['adminpassword']) or empty($_POST['adminpassword']) and $FIRSTRUN) $error.='admin password not set
'; - if(!isset($_POST['adminpassword2']) or empty($_POST['adminpassword2']) and $FIRSTRUN) $error.='retype admin password not set
'; - if(!isset($_POST['datadirectory']) or empty($_POST['datadirectory'])) $error.='data directory not set
'; - if(!isset($_POST['dateformat']) or empty($_POST['dateformat'])) $error.='dateformat not set
'; - if(!isset($_POST['dbname']) or empty($_POST['dbname'])) $error.='databasename not set
'; - if($_POST['adminpassword']<>$_POST['adminpassword2'] ) $error.='admin passwords are not the same
'; - - if(!isset($_POST['adminpassword']) or empty($_POST['adminpassword']) and !$FIRSTRUN){ - $_POST['adminpassword']=$CONFIG_ADMINPASSWORD; - } - $dbtype=$_POST['dbtype']; - if($dbtype=='mysql'){ - if(!isset($_POST['dbhost']) or empty($_POST['dbhost'])) $error.='database host not set
'; - if(!isset($_POST['dbuser']) or empty($_POST['dbuser'])) $error.='database user not set
'; - if($_POST['dbpassword']<>$_POST['dbpassword2'] ) $error.='database passwords are not the same
'; - - } - if(empty($error)) { - //create/fill database - $CONFIG_DBTYPE=$dbtype; - $CONFIG_DBNAME=$_POST['dbname']; - if($dbtype=='mysql'){ - $CONFIG_DBHOST=$_POST['dbhost']; - $CONFIG_DBUSER=$_POST['dbuser']; - $CONFIG_DBPASSWORD=$_POST['dbpassword']; - } - if(isset($_POST['createdatabase']) and $CONFIG_DBTYPE=='mysql'){ - self::createdatabase($_POST['dbadminuser'],$_POST['dbadminpwd']); - } - if(isset($_POST['filldb'])){ - self::filldatabase(); - } - - //storedata - $config=' '; - - $filename=$SERVERROOT.'/config/config.php'; - file_put_contents($filename,$config); - header("Location: ".$WEBROOT."/"); + $error=''; + $FIRSTRUN=empty($CONFIG_ADMINLOGIN); + if(!$FIRSTRUN){ + if($_POST['currentpassword']!=$CONFIG_ADMINPASSWORD){ + $error.='wrong password
'; + } + } + + if(!isset($_POST['adminlogin']) or empty($_POST['adminlogin'])) $error.='admin login not set
'; + if((!isset($_POST['adminpassword']) or empty($_POST['adminpassword'])) and $FIRSTRUN) $error.='admin password not set
'; + if((!isset($_POST['adminpassword2']) or empty($_POST['adminpassword2'])) and $FIRSTRUN) $error.='retype admin password not set
'; + if(!isset($_POST['datadirectory']) or empty($_POST['datadirectory'])) $error.='data directory not set
'; + if(!isset($_POST['dateformat']) or empty($_POST['dateformat'])) $error.='dateformat not set
'; + if(!isset($_POST['dbname']) or empty($_POST['dbname'])) $error.='databasename not set
'; + if($_POST['adminpassword']<>$_POST['adminpassword2'] ) $error.='admin passwords are not the same
'; + $dbtype=$_POST['dbtype']; + if($dbtype=='mysql'){ + if(!isset($_POST['dbhost']) or empty($_POST['dbhost'])) $error.='database host not set
'; + if(!isset($_POST['dbuser']) or empty($_POST['dbuser'])) $error.='database user not set
'; + if($_POST['dbpassword']<>$_POST['dbpassword2'] ) $error.='database passwords are not the same
'; + + } + if(!$FIRSTRUN){ + if(!isset($_POST['adminpassword']) or empty($_POST['adminpassword'])){ + $_POST['adminpassword']=$CONFIG_ADMINPASSWORD; + } + if(!isset($_POST['dbpassword']) or empty($_POST['dbpassword'])){ + $_POST['dbpassword']=$CONFIG_DBPASSWORD; + } + } + if(empty($error)) { + //create/fill database + $CONFIG_DBTYPE=$dbtype; + $CONFIG_DBNAME=$_POST['dbname']; + if($dbtype=='mysql'){ + $CONFIG_DBHOST=$_POST['dbhost']; + $CONFIG_DBUSER=$_POST['dbuser']; + $CONFIG_DBPASSWORD=$_POST['dbpassword']; + } + try{ + if(isset($_POST['createdatabase']) and $CONFIG_DBTYPE=='mysql'){ + self::createdatabase($_POST['dbadminuser'],$_POST['dbadminpwd']); + } + }catch(Exception $e){ + $error.='error while trying to create the database
'; + } + if($CONFIG_DBTYPE=='sqlite'){ + $f=@fopen($SERVERROOT.'/'.$CONFIG_DBNAME,'a+'); + if(!$f){ + $error.='path of sqlite database not writable by server
'; + } + } + try{ + if(isset($_POST['filldb'])){ + self::filldatabase(); + } + }catch(Exception $e){ + $error.='error while trying to fill the database
'; + } + + //storedata + $config=' '; - } - return($error); + $filename=$SERVERROOT.'/config/config.php'; + if(empty($error)){ + header("Location: ".$WEBROOT."/"); + try{ + file_put_contents($filename,$config); + }catch(Exception $e){ + $error.='error while trying to save the configuration file
'; + return $error; + } + }else{ + return $error; + } + + } + return($error); } @@ -210,3 +239,5 @@ GRANT ALL PRIVILEGES ON `{$_POST['dbname']}` . * TO '{$_POST['dbuser']}';"; } } ?> + + diff --git a/inc/lib_files.php b/inc/lib_files.php index 5ddf5a4e1f3..9c6cb25346a 100755 --- a/inc/lib_files.php +++ b/inc/lib_files.php @@ -89,6 +89,7 @@ class OC_FILES { $content=array(); $dirs=array(); $file=array(); + $files=array(); if (is_dir($directory)) { if ($dh = opendir($directory)) { while (($filename = readdir($dh)) !== false) { diff --git a/inc/templates/configform.php b/inc/templates/configform.php index 82a1efeee19..61217df2acf 100755 --- a/inc/templates/configform.php +++ b/inc/templates/configform.php @@ -1,5 +1,6 @@ -
- - - -
current password
- - "; + } + if(!$FIRSTRUN){?> + + @@ -60,14 +56,26 @@ function dbtypechange(){ - + diff --git a/inc/templates/footer.php b/inc/templates/footer.php index 16b41d3e2e3..a7e2aa62052 100755 --- a/inc/templates/footer.php +++ b/inc/templates/footer.php @@ -4,7 +4,7 @@ global $WEBROOT;

-Hint: Mount it via webdav like this: ">webdav:///webdav/owncloud.php +Hint: Mount it via webdav like this: ">webdav:///webdav/owncloud.php

+ diff --git a/inc/templates/header.php b/inc/templates/header.php index 1b318575b7e..c082ea8b3da 100755 --- a/inc/templates/header.php +++ b/inc/templates/header.php @@ -4,13 +4,14 @@ ownCloud - + +
'); // check if already configured. otherwise start configuration wizard $error=OC_CONFIG::writeconfiglisener(); - echo $error; + $CONFIG_ERROR=$error; if(empty($CONFIG_ADMINLOGIN)) { global $FIRSTRUN; $FIRSTRUN=true; diff --git a/index.php b/index.php index 6b0bcf63a4d..e755ab86237 100755 --- a/index.php +++ b/index.php @@ -28,7 +28,9 @@ if(isset($_GET['dir'])) $dir=$_GET['dir']; else $dir=''; if(isset($_GET['file'])) { OC_FILES::get($dir,$_GET['file']); - +OC_FILES::get($dir,$_GET['file']); +OC_FILES::get($dir,$_GET['file']); +echo('heya'); }else{ OC_UTIL::addscript('js/ajax.js'); diff --git a/js/filebrowser.js b/js/filebrowser.js index dac81327b69..f12cec44143 100644 --- a/js/filebrowser.js +++ b/js/filebrowser.js @@ -27,188 +27,367 @@ OC_FILES.browser.showInitial=function(){ if(loc.indexOf('#')!=-1){ dir=loc.substring(loc.indexOf('#')+1); } - OC_FILES.dir=dir; - OC_FILES.getdirectorycontent(dir,OC_FILES.browser.show_callback); + OC_FILES.getdirectorycontent(dir,OC_FILES.browser.show_callback,true); } OC_FILES.browser.show=function(dir){ - if(!dir){ + if(!dir || !dir.split){ dir=''; } - OC_FILES.dir=dir; OC_FILES.getdirectorycontent(dir,OC_FILES.browser.show_callback); } -OC_FILES.browser.show_callback=function(content){ - var dir=OC_FILES.dir - var dirs=dir.split('/'); - var tr=null; - var td=null; - var img=null; - - body=document.getElementsByTagName('body').item(0); - body.addEvent('onclick',OC_FILES.browser.hideallactions); - - //remove current content; - var contentNode=document.getElementById('content'); - contentNode.className='center'; - if(contentNode.hasChildNodes()){ - while(contentNode.childNodes.length >=1){ - contentNode.removeChild(contentNode.firstChild); - } - } - var table=document.createElement('table'); - table.className='browser'; - var tbody=document.createElement('tbody'); - var thead=document.createElement('thead'); - var tfoot=document.createElement('tfoot'); - table.appendChild(thead); - table.appendChild(tbody); - table.appendChild(tfoot); -// table.setAttribute('cellpadding',6); - - // breadcrumb - if(dirs.length>0) { - tr=document.createElement('tr'); - thead.appendChild(tr); - tr.className='breadcrumb'; - td=document.createElement('td'); - tr.appendChild(td); - td.className='fileSelector' - input=document.createElement('input'); - input.setAttribute('type','checkbox'); - input.setAttribute('name','fileSelector'); - input.setAttribute('value','select_all'); - input.setAttribute('id','select_all'); - input.addEvent('onclick',OC_FILES.selectAll); - td.appendChild(input); - td=document.createElement('td'); - tr.appendChild(td); - td.className='breadcrumb'; - var a=document.createElement('a'); - td.appendChild(a); - a.setAttribute('href','#'); - a.addEvent('onclick',OC_FILES.browser.show); - a.appendChild(document.createTextNode('Home')); - var currentdir=''; - for(var index=0;index0){ + for(var i=0;i=1){ + contentNode.removeChild(contentNode.firstChild); + } + } + var table=document.createElement('table'); + OC_FILES.browser.table=table; + table.className='browser'; + var tbody=document.createElement('tbody'); + var thead=document.createElement('thead'); + var tfoot=document.createElement('tfoot'); + table.appendChild(thead); + table.appendChild(tbody); + table.appendChild(tfoot); + OC_FILES.files=Array(); + table.setAttribute('cellpadding',6); + + tr=document.createElement('tr'); + thead.appendChild(tr); + tr.className='breadcrumb'; + td=document.createElement('td'); + tr.appendChild(td); + input=document.createElement('input'); + input.className='fileSelector' + input.setAttribute('type','checkbox'); + input.setAttribute('name','fileSelector'); + input.setAttribute('value','select_all'); + input.setAttribute('id','select_all'); + input.addEvent('onclick',OC_FILES.selectAll); + td.appendChild(input); + td.className='breadcrumb'; + OC_FILES.browser.breadcrumb.show(td,dir); + // files and directories tr=document.createElement('tr'); tbody.appendChild(tr); td=document.createElement('td'); - td.setAttribute('colspan','6'); tr.appendChild(td); div=document.createElement('div'); - td.appendChild(div); div.className='fileList'; - div.setAttribute('style','max-height:'+(parseInt(document.body.clientHeight)-300)+'px;'); - table2=document.createElement('table'); - div.appendChild(table2); - tbody2=document.createElement('tbody'); - table2.appendChild(tbody2); - table2.setAttribute('cellpadding',6); - table2.setAttribute('cellspacing',0); - for(index in content){ - var file=content[index]; - if(file.name){ - file.name=file.name.replace('\'',''); - OC_FILES.files[file['name']]=new OC_FILES.file(dir,file['name'],file['type']); - tr=document.createElement('tr'); - tbody2.appendChild(tr); - tr.className='browserline'; - td=document.createElement('td'); - tr.appendChild(td); - td.className='fileSelector'; - input=document.createElement('input'); - input.setAttribute('type','checkbox'); - input.setAttribute('name','fileSelector'); - input.setAttribute('value',file['name']); - td.appendChild(input); - tr.appendChild(OC_FILES.browser.showicon(file['type'])); - td=document.createElement('td'); - tr.appendChild(td); - td.className='nametext'; - td.setAttribute('name',file['name']); - td.setAttribute('id',file['name']); - a=document.createElement('a'); - td.appendChild(a); - a.appendChild(document.createTextNode(file['name'])); - var fileObject=OC_FILES.files[file['name']]; - a.addEvent('onclick',new callBack(fileObject.actions['default'],fileObject)); - if(file['type']=='dir'){ - td.setAttribute('colspan',2); - a.setAttribute('href','#'+dir+'/'+file['name']); - }else{ - a.setAttribute('href','#'+dir); - sizeTd=document.createElement('td'); - tr.appendChild(sizeTd); - sizeTd.className='sizetext'; - sizeTd.appendChild(document.createTextNode(sizeFormat(file['size']))); - } - a=document.createElement('a'); - var img=document.createElement('img'); - td.appendChild(img); - img.className='file_actions'; - img.alt='' - img.title='actions'; - img.src=WEBROOT+'/img/arrow_down.png'; - var name=file['name']; - img.addEvent('onclick',OC_FILES.browser.showactions,name); - td=document.createElement('td'); - tr.appendChild(td); - td.className='sizetext'; - td.appendChild(document.createTextNode(file['date'])); - } - } - } - tr=document.createElement('tr'); - tfoot.appendChild(tr); - tr.className='utilityline'; - td=document.createElement('td'); - tr.appendChild(td); - td.setAttribute('colspan','4'); - span=document.createElement('span'); - td.appendChild(span); - dropdown=document.createElement('select'); - span.appendChild(dropdown); - dropdown.setAttribute('id','selected_action'); - for(index in this.actions_selected){ - if(this.actions_selected[index].call){ + td.appendChild(div); + OC_FILES.browser.files.show(div,content); + tr=document.createElement('tr'); + tfoot.appendChild(tr); + tr.className='utilityline'; + td=document.createElement('td'); + tr.appendChild(td); + td.className='actionsSelected'; + dropdown=document.createElement('select'); + td.appendChild(dropdown); + dropdown.setAttribute('id','selected_action'); + for(index in OC_FILES.actions_selected){ + if(OC_FILES.actions_selected[index].call){ + option=document.createElement('option'); + dropdown.appendChild(option); + option.setAttribute('value',index); + option.appendChild(document.createTextNode(capitaliseFirstLetter(index))); + } + } + td.appendChild(document.createTextNode(' Selected ')); + button=document.createElement('button'); + td.appendChild(button); + button.appendChild(document.createTextNode('Go')); + button.addEvent('onclick',OC_FILES.action_selected); + div=document.createElement('div'); + td.appendChild(div); + div.className='moreActionsButton'; + OC_FILES.maxUpload=content['max_upload']; + var p=document.createElement('p'); + div.appendChild(p); + p.appendChild(document.createTextNode('More Actions')); + div.setAttribute('id','moreActionsButton'); + OC_FILES.browser.moreActionsShown=false; + p.addEvent('onclick',OC_FILES.browser.showMoreActions); + contentNode.appendChild(table); + }else{ + OC_FILES.browser.breadcrumb.show(null,dir); + OC_FILES.browser.files.show(null,content); + } +} + +OC_FILES.browser.handleDropOn=function(event,node){ + var dropTargetFile=this.file; + var dropFile=node.parentNode.file; + if(dropTargetFile!=dropFile){ + if(dropTargetFile.actions.dropOn && dropTargetFile.actions.dropOn.call){ + dropTargetFile.actions.dropOn.call(dropTargetFile,dropFile); + } + return false; + } +} + +OC_FILES.browser.handleDrop=function(event,node){ + var dropTargetFile=node.file; + var dropFile=this.parentNode.file; + if(dropFile.actions.drop && dropFile.actions.drop.call){ + dropFile.actions.drop.call(dropFile,dropTargetFile); + } + return false; +} + +OC_FILES.browser.showMoreActions=function(){ + if(!OC_FILES.browser.moreActionsList){ + var div=document.createElement('div'); + div.className='moreActionsList'; + var table=document.createElement('table'); + div.appendChild(table); + var tbody=document.createElement('tbody'); + table.appendChild(tbody); + var tr=document.createElement('tr'); + tbody.appendChild(tr); + var td=document.createElement('td'); + tr.appendChild(td); + OC_FILES.browser.showuploader(OC_FILES.dir,td,OC_FILES.maxUpload); + tr=document.createElement('tr'); + tbody.appendChild(tr); + td=document.createElement('td'); + tr.appendChild(td); + var form=document.createElement('form'); + td.appendChild(form); + form.appendChild(document.createTextNode('New ')); + var dropdown=document.createElement('select'); + form.appendChild(dropdown); + dropdown.setAttribute('id','newFileType'); + var option=document.createElement('option'); + dropdown.appendChild(option); + option.setAttribute('value','dir'); + option.appendChild(document.createTextNode('Folder')); option=document.createElement('option'); dropdown.appendChild(option); - option.setAttribute('value',index); - option.appendChild(document.createTextNode(capitaliseFirstLetter(index))); + option.setAttribute('value','file'); + option.appendChild(document.createTextNode('File')); + form.appendChild(document.createTextNode(' ')); + var input=document.createElement('input'); + form.appendChild(input); + input.setAttribute('id','newFileName'); + form.addEvent('onsubmit',OC_FILES.browser.newFile); + var submit=document.createElement('input'); + form.appendChild(submit); + submit.type='submit'; + submit.value='Create'; + OC_FILES.browser.moreActionsList=div; + }else{ + var div=OC_FILES.browser.moreActionsList; } + var button=document.getElementById('moreActionsButton'); + if(!OC_FILES.browser.moreActionsShown){ + button.appendChild(div); + OC_FILES.browser.moreActionsShown=true; + button.className='moreActionsButton moreActionsButtonClicked'; + }else{ + OC_FILES.browser.moreActionsShown=false; + button.removeChild(div); + button.className='moreActionsButton'; } - span.appendChild(document.createTextNode(' Selected ')); - button=document.createElement('button'); - span.appendChild(button); - button.appendChild(document.createTextNode('Go')); - button.addEvent('onclick',OC_FILES.action_selected); - span=document.createElement('span'); - span.className='upload'; - td.appendChild(span); - OC_FILES.browser.showuploader(dir,span,content['max_upload']); - contentNode.appendChild(table); +} + +OC_FILES.browser.newFile=function(event){ + if(event.preventDefault){ + event.preventDefault(); + }; + var typeSelect=document.getElementById('newFileType'); + var type=typeSelect.options[typeSelect.selectedIndex].value; + var name=document.getElementById('newFileName').value; + OC_FILES.newFile(type,name,OC_FILES.dir); + return false; } OC_FILES.browser.showicon=function(filetype){ @@ -220,36 +399,42 @@ OC_FILES.browser.showicon=function(filetype){ img.setAttribute('height',16); if(filetype=='dir'){ img.src=WEBROOT+'/img/icons/folder.png'; + }else if(filetype=='incomplete'){ + img.src=WEBROOT+'/img/icons/loading.gif'; }else{ img.src=WEBROOT+'/img/icons/other.png'; } return td; } +OC_FILES.uploadIFrames=Array(); OC_FILES.browser.showuploader=function(dir,parent,max_upload){ - OC_FILES.uploadForm=document.createElement('form'); - OC_FILES.uploadForm.setAttribute('target','uploadIFrame'); - OC_FILES.uploadForm.setAttribute('action','files/upload.php?dir='+dir); - OC_FILES.uploadForm.method='post'; - OC_FILES.uploadForm.setAttribute('enctype','multipart/form-data'); - OC_FILES.uploadIFrame=document.createElement('iframe'); - OC_FILES.uploadIFrame.className='hidden'; - OC_FILES.uploadIFrame.name='uploadIFrame'; - var input=document.createElement('input'); - input.setAttribute('type','hidden'); - input.setAttribute('name','MAX_FILE_SIZE'); - input.setAttribute('value',max_upload); - input.setAttribute('id','max_upload'); - OC_FILES.uploadForm.appendChild(input); - var file=document.createElement('input'); - file.name='file'; - file.setAttribute('id','fileSelector'); - file.setAttribute('type','file'); - file.addEvent('onchange',OC_FILES.upload,[dir]); - OC_FILES.uploadForm.appendChild(document.createTextNode('Upload file: ')); - OC_FILES.uploadForm.appendChild(file); - parent.appendChild(OC_FILES.uploadForm); - parent.appendChild(OC_FILES.uploadIFrame); + var iframeId=OC_FILES.uploadIFrames.length + OC_FILES.uploadForm=document.createElement('form'); + OC_FILES.uploadForm.setAttribute('target','uploadIFrame'+iframeId); + OC_FILES.uploadForm.setAttribute('action','files/upload.php?dir='+dir); + OC_FILES.uploadForm.method='post'; + OC_FILES.uploadForm.setAttribute('enctype','multipart/form-data'); + OC_FILES.uploadIFrames[iframeId]=document.createElement('iframe'); + OC_FILES.uploadIFrames[iframeId].uploadParent=parent; + OC_FILES.uploadIFrames[iframeId].className='hidden'; + OC_FILES.uploadIFrames[iframeId].name='uploadIFrame'+iframeId; + var input=document.createElement('input'); + input.setAttribute('type','hidden'); + input.setAttribute('name','MAX_FILE_SIZE'); + input.setAttribute('value',max_upload); + input.setAttribute('id','max_upload'); + OC_FILES.uploadForm.appendChild(input); + var file=document.createElement('input'); + file.name='file'; + file.setAttribute('id','fileSelector'); + file.setAttribute('type','file'); + file.addEvent('onchange',OC_FILES.upload,[dir,iframeId]); + OC_FILES.uploadForm.appendChild(document.createTextNode('Upload file: ')); + OC_FILES.uploadForm.appendChild(file); + parent.appendChild(OC_FILES.uploadForm); + var body=document.getElementsByTagName('body').item(0); + body.appendChild(OC_FILES.uploadIFrames[iframeId]); } OC_FILES.browser.show_rename=function(dir,file){ @@ -290,7 +475,7 @@ OC_FILES.browser.rename_cancel=function(file){ OC_FILES.browser.showactions=function(file,hide){ node=document.getElementById(file); - if(node &&(node.actionsshown || hide)){ + if(node &&(node.actionsshown || hide===true)){ if(node.actionsdiv){ node.removeChild(node.actionsdiv); } @@ -308,7 +493,7 @@ OC_FILES.browser.showactions=function(file,hide){ var file=OC_FILES.files[file] var actions=file.actions; for(name in actions){ - if(actions[name].call && name!='default'){ + if(actions[name].call && name!='default' && name!='dropOn' && name!='drop'){ tr=document.createElement('tr'); tbody.appendChild(tr); td=document.createElement('td'); @@ -341,17 +526,20 @@ OC_FILES.browser.hideallactions=function(){ OC_FILES.hideallenabled=true; //used to prevent browsers from hiding actionslists right after they are displayed; sizeFormat=function(size){ - var orig=size; - var steps=Array('B','KiB','MiB','GiB','TiB'); - var step=0; - while(size>(1024*2)){ - step++; - size=size/1024; - } - if(size.toFixed){ - size=size.toFixed(2); - } - return ''+size+' '+steps[step]; + if(isNaN(size)){ + return false; + } + var orig=size; + var steps=Array('B','KiB','MiB','GiB','TiB'); + var step=0; + while(size>(1024*2)){ + step++; + size=size/1024; + } + if(size.toFixed){ + size=size.toFixed(2); + } + return ''+size+' '+steps[step]; } OC_FILES.browser.showImage=function(dir,file){ diff --git a/js/lib_ajax.js b/js/lib_ajax.js index 319875d40e7..6a2ae53ee32 100644 --- a/js/lib_ajax.js +++ b/js/lib_ajax.js @@ -75,7 +75,7 @@ OC_onload.run=function(){ //implement Node.prototype under IE if(typeof Node=='undefined'){ - Node=new Object(); + Node=function(){}; Node.prototype=new Object(); tmpObj=new Object(); @@ -86,8 +86,9 @@ if(typeof Node=='undefined'){ document.createElement=function(tagName){ // alert(tagName); node=document.createElementNative(tagName); - for(name in Node.prototype){ - node[name]=Node.prototype[name]; + var proto=new Node() + for(name in proto){ + node[name]=proto[name]; } return node; } @@ -98,10 +99,10 @@ if(typeof Node=='undefined'){ node=node.item(0) } if(node.nodeType==1){ - for(name in Node.prototype){ -// node[name]=Node.prototype[name]; - eval('node.'+name+'=Node.prototype.'+name+';'); - } + var proto=new Node() + for(name in proto){ + node[name]=proto[name]; + } if(node.hasChildNodes){ var childs=node.childNodes; for(var i=0;i= 1){ + this.removeChild(this.firstChild); + } + } +} + +setDebug=function(text){ + node=document.getElementById('debug'); + if(node){ + node.clearNode(); + node.appendChild(document.createTextNode(text)); + } +} + +arrayMerge=function(array1,array2){ + var array=Array(); + for(i in array1){ + array[i]=array1[i]; + } + for(i in array2){ + array[i]=array2[i]; + } + return array; +} + +if(!Math.sign){ + Math.sign=function(x){ + return x/Math.abs(x); + } +} + +if(!Node.prototype.clearNode){ + Node.prototype.clearNode=function(){ + if(this.hasChildNodes()){ + while(this.childNodes.length >=1){ + this.removeChild(this.firstChild); + } + } + } +} + +getTimeString=function(){ + var date=new Date(); + var months=new Array(12); + months[0]="Jan"; + months[1]="Feb"; + months[2]="Mar"; + months[3]="Apr"; + months[4]="May"; + months[5]="Jun"; + months[6]="Jul"; + months[7]="Aug"; + months[8]="Sep"; + months[9]="Oct"; + months[10]="Nov"; + months[11]="Dec"; + return date.getDate()+' '+months[date.getMonth()]+' '+date.getFullYear()+' '+date.getHours()+':'+date.getMinutes(); } \ No newline at end of file diff --git a/js/lib_drag.js b/js/lib_drag.js new file mode 100644 index 00000000000..bc6a8610500 --- /dev/null +++ b/js/lib_drag.js @@ -0,0 +1,350 @@ +/** +* Javascript Drag&Drop - Modified for ownCloud +* +* @author Robin Appelman +* @copyright 2010 Robin Appelman icewind1991@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see . +* +*/ + +position=function(x,y){ + if(x)this.x=x; + if(y)this.y=y; + return this; +} +position.prototype={ + x:0, + y:0, + add:function(pos2){ + return new position(this.x+pos2.x,this.y+pos2.y); + }, + substract:function(pos2){ + return new position(this.x-pos2.x,this.y-pos2.y); + },toString:function(){ + return 'x:'+this.x+',y:'+this.y; + },inside:function(pos2){ + return Math.abs(this.x)0){ - for(index=0;index0){ + for(index=0;indexmax_upload){ - new OCNotification('File to large',10000) - return false; - } - } - OC_FILES.uploadForm.submit(); +OC_FILES.upload=function(dir,iframeId){ + var file=new Object; + var fileSelector=document.getElementById('fileSelector'); + var max_upload=document.getElementById('max_upload').value; + var name=false; + if(fileSelector.files && fileSelector.files[0].fileName){ + name=fileSelector.files[0].fileName; + } + if(fileSelector.files && fileSelector.files[0].fileSize){ + var size=fileSelector.files[0].fileSize; + if(size>max_upload){ + new OCNotification('File to large',10000) + return false; + } + } + file.dir=dir; + file.name=name; + file.type='file'; + file.size=size; + file.iframeId=iframeId; + if(!OC_FILES.cache.incomplete[dir]){ + OC_FILES.cache.incomplete[dir]=Array(); + } + OC_FILES.cache.incomplete[dir][name]=Array(); + OC_FILES.cache.incomplete[dir][name]['name']=name; + OC_FILES.cache.incomplete[dir][name]['type']='incomplete'; + OC_FILES.cache.incomplete[dir][name]['size']=size; + OC_FILES.uploadIFrames[iframeId].file=file; + OC_FILES.uploadIFrames[iframeId].addEvent('onload',new callBack(OC_FILES.upload_callback,OC_FILES.uploadIFrames[iframeId])); + OC_FILES.browser.files.add(name,'incomplete',size); + OC_FILES.uploadForm.submit(); + if(OC_FILES.uploadForm.parentElement){ + OC_FILES.uploadForm.className='hidden'; + OC_FILES.uploadForm.parentNode.removeChild(OC_FILES.uploadForm); + var body=document.getElementsByTagName('body').item(0); + body.appendChild(OC_FILES.uploadForm); + OC_FILES.uploadIFrames[iframeId].uploadForm=OC_FILES.uploadForm; + OC_FILES.browser.showuploader(OC_FILES.dir,OC_FILES.uploadIFrames[iframeId].uploadParent,OC_FILES.maxUpload) + } } -OC_FILES.upload_callback=function(dir){ - this.browser.show(dir); +OC_FILES.upload_callback=function(iframeId){ + var file=this.file; + if(OC_FILES.cache.incomplete[file.dir][file.name]){ + OC_FILES.browser.files.remove(file.name); + OC_FILES.cache.files[file.name]=OC_FILES.cache.incomplete[file.dir][file.name] + delete OC_FILES.cache.incomplete[file.dir][file.name]; + OC_FILES.cache.files[file.name]['type']=file.type; + this.uploadForm.parentNode.removeChild(this.uploadForm); + this.parentNode.removeChild(this); + delete OC_FILES.uploadIFrames[file.iframeId]; + OC_FILES.browser.show(file.dir); + } } -OC_FILES.rename=function(dir,file){ - var item=document.getElementById(file+'_newname'); - var newname=item.value; - if(newname==''){ - return false; - }else if(file==newname){ - OC_FILES.browser.show(OC_FILES.dir); - return false; - } - xmlloader=new OCXMLLoader(); - xmlloader.setCallBack(OC_FILES.rename_callback); - xmlloader.load('files/rename.php?dir='+dir+'&file='+file+'&newname='+newname); - return false; +OC_FILES.rename=function(dir,file,event){ + if(event && event.preventDefault){ + event.preventDefault(); + } + var item=document.getElementById(file+'_newname'); + var newname=item.value; + if(newname==''){ + return false; + }else if(file==newname){ + OC_FILES.browser.show(OC_FILES.dir); + return false; + } + xmlloader=new OCXMLLoader(); + xmlloader.setCallBack(OC_FILES.rename_callback); + xmlloader.arg=new Object; + xmlloader.arg.oldname=file; + xmlloader.arg.newname=newname; + xmlloader.arg.dir=dir; + xmlloader.arg.type=OC_FILES.cache.files[file]['type']; + xmlloader.load('files/rename.php?dir='+dir+'&file='+file+'&newname='+newname); + if(!OC_FILES.cache.incomplete[dir]){ + OC_FILES.cache.incomplete[dir]=Array(); + } + OC_FILES.cache.files[file]['type']='incomplete'; + OC_FILES.cache.incomplete[dir][newname]=OC_FILES.cache.files[file]; + OC_FILES.cache.incomplete[dir][newname]['name']=newname; + OC_FILES.browser.files.remove(file); + OC_FILES.browser.files.add(newname,'incomplete'); + return false; } -OC_FILES.rename_callback=function(req){ - OC_FILES.browser.show(OC_FILES.dir); +OC_FILES.rename_callback=function(req,file){ + delete OC_FILES.cache.files[file.oldname] + OC_FILES.cache.files[file.newname]=OC_FILES.cache.incomplete[file.dir][file.newname]; + delete OC_FILES.cache.incomplete[file.dir][file.newname]; + OC_FILES.browser.files.remove(file.newname); + OC_FILES.cache.files[file.newname]['type']=file.type; + OC_FILES.browser.show(OC_FILES.dir); } OC_FILES.remove=function(dir,file){ - remove=confirm('remove file \''+file+'\'?'); - if(remove){ - xmlloader=new OCXMLLoader(); - xmlloader.setCallBack(OC_FILES.remove_callback); - xmlloader.load('files/delete.php?dir='+dir+'&file='+file); - } + remove=confirm('remove file \''+file+'\'?'); + if(remove){ + xmlloader=new OCXMLLoader(); + xmlloader.setCallBack(OC_FILES.remove_callback); + xmlloader.arg=file; + xmlloader.load('files/delete.php?dir='+dir+'&file='+file); + OC_FILES.browser.files.remove(file); + delete OC_FILES.cache.files[file]; + } } -OC_FILES.remove_callback=function(req){ - OC_FILES.browser.show(OC_FILES.dir); +OC_FILES.remove_callback=function(req,name){ +// OC_FILES.browser.files.remove(name); +// OC_FILES.browser.show(OC_FILES.dir); } OC_FILES.getSelected=function(){ @@ -119,6 +211,63 @@ OC_FILES.getSelected=function(){ return files; } +OC_FILES.newFile=function(type,name,dir){ + xmlloader=new OCXMLLoader(); + xmlloader.arg=new Object; + xmlloader.arg.name=name; + xmlloader.arg.dir=dir; + xmlloader.arg.type=type; + xmlloader.setCallBack(OC_FILES.new_callback); + xmlloader.load('files/new.php?type='+type+'&dir='+dir+'&name='+name); + if(!OC_FILES.cache.incomplete[dir]){ + OC_FILES.cache.incomplete[dir]=Array(); + } + OC_FILES.cache.incomplete[dir][name]=Array(); + OC_FILES.cache.incomplete[dir][name]['name']=name; + OC_FILES.cache.incomplete[dir][name]['type']='incomplete'; + OC_FILES.cache.incomplete[dir][name]['size']=0; + OC_FILES.browser.files.add(name,'incomplete'); +} + +OC_FILES.new_callback=function(req,file){ + OC_FILES.cache.files[file.name]=OC_FILES.cache.incomplete[file.dir][file.name]; + delete OC_FILES.cache.incomplete[file.dir][file.name]; + OC_FILES.cache.files[file.name]['type']=file.type; + OC_FILES.browser.files.remove(name); + OC_FILES.browser.show(OC_FILES.dir); +} + +OC_FILES.move=function(source,target,sourceDir,targetDir){ + if(sourceDir!=targetDir || source!=target){ + if(!OC_FILES.cache.incomplete[sourceDir]){ + OC_FILES.cache.incomplete[sourceDir]=Array(); + } + if(!OC_FILES.cache.incomplete[targetDir]){ + OC_FILES.cache.incomplete[targetDir]=Array(); + } + if(!OC_FILES.cache.incomplete[targetDir+'/'+target]){ + OC_FILES.cache.incomplete[targetDir+'/'+target]=Array(); + } + xmlloader=new OCXMLLoader(); + xmlloader.arg=new Object; + xmlloader.arg.source=source; + xmlloader.arg.target=target; + xmlloader.arg.sourceDir=sourceDir; + xmlloader.arg.targetDir=targetDir; + xmlloader.arg.type=OC_FILES.cache.files[source]['type']; + OC_FILES.cache.files[source]['type']='incomplete'; + OC_FILES.cache.incomplete[targetDir+'/'+target][source]=OC_FILES.cache.files[source] + xmlloader.setCallBack(OC_FILES.move_callback); + xmlloader.load('files/move.php?sourcedir='+sourceDir+'&targetdir='+targetDir+'&source='+source+'&target='+target); + } +} + +OC_FILES.move_callback=function(req,file){ + OC_FILES.cache.incomplete[file.targetDir+'/'+file.target][file.source]['type']=file.type; + delete OC_FILES.cache.files[file.source]; + OC_FILES.browser.show(OC_FILES.dir); +} + OC_FILES.selectAll=function(){ var value=document.getElementById('select_all').checked; var nodes=document.getElementsByName('fileSelector'); @@ -161,31 +310,33 @@ OC_FILES.actions_selected['delete']=function(){ OC_FILES.files=Array(); OC_FILES.file=function(dir,file,type){ - this.type=type; - this.file=file; - this.dir=dir; - this.actions=new Object(); - if(file.lastIndexOf('.')){ - this.extention=file.substr(file.lastIndexOf('.')+1); - }else{ - this.extention; - } - for(index in OC_FILES.fileActions.all){ - if(OC_FILES.fileActions.all[index].call){ - this.actions[index]=OC_FILES.fileActions.all[index]; - } - } - if(OC_FILES.fileActions[this.type]){ - for(index in OC_FILES.fileActions[this.type]){ - if(OC_FILES.fileActions[this.type][index].call){ - this.actions[index]=OC_FILES.fileActions[this.type][index]; + if(file){ + this.type=type; + this.file=file; + this.dir=dir; + this.actions=new Object(); + if(file.lastIndexOf('.')){ + this.extention=file.substr(file.lastIndexOf('.')+1); + }else{ + this.extention; + } + for(index in OC_FILES.fileActions.all){ + if(OC_FILES.fileActions.all[index].call){ + this.actions[index]=OC_FILES.fileActions.all[index]; } } - } - if(OC_FILES.fileActions[this.extention]){ - for(index in OC_FILES.fileActions[this.extention]){ - if(OC_FILES.fileActions[this.extention][index].call){ - this.actions[index]=OC_FILES.fileActions[this.extention][index]; + if(OC_FILES.fileActions[this.type]){ + for(index in OC_FILES.fileActions[this.type]){ + if(OC_FILES.fileActions[this.type][index].call){ + this.actions[index]=OC_FILES.fileActions[this.type][index]; + } + } + } + if(OC_FILES.fileActions[this.extention]){ + for(index in OC_FILES.fileActions[this.extention]){ + if(OC_FILES.fileActions[this.extention][index].call){ + this.actions[index]=OC_FILES.fileActions[this.extention][index]; + } } } } @@ -221,6 +372,10 @@ OC_FILES.fileActions.dir.open=function(){ } OC_FILES.fileActions.dir['default']=OC_FILES.fileActions.dir.open; +OC_FILES.fileActions.dir.dropOn=function(file){ + OC_FILES.move(file.file,this.file,file.dir,this.dir); +} + OC_FILES.fileActions.jpg=new Object() OC_FILES.fileActions.jpg.show=function(){ @@ -233,21 +388,4 @@ OC_FILES.fileActions.jpg['default']=OC_FILES.fileActions.jpg.show; OC_FILES.fileActions.jpeg=OC_FILES.fileActions.jpg OC_FILES.fileActions.png=OC_FILES.fileActions.jpg OC_FILES.fileActions.gif=OC_FILES.fileActions.jpg -OC_FILES.fileActions.bmp=OC_FILES.fileActions.jpg - -function getStyle(el,styleProp) -{ -// var x = document.getElementById(el); - var x=el; - if (x.currentStyle){ - alert(x.currentStyle); - var y = x.currentStyle[styleProp]; - }else if (window.getComputedStyle){ - var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp); - } - return y; -} - -Node.prototype.getStyle=function(styleProp){ - return getStyle(this,styleProp) -} \ No newline at end of file +OC_FILES.fileActions.bmp=OC_FILES.fileActions.jpg \ No newline at end of file diff --git a/js/lib_xmlloader.js b/js/lib_xmlloader.js index ce6fd824fc1..12ebfa474b6 100644 --- a/js/lib_xmlloader.js +++ b/js/lib_xmlloader.js @@ -38,6 +38,7 @@ OCXMLLoader.prototype={ request:'', callBack:null, async:true, + arg:null, /** * Loads an XML document @@ -85,9 +86,9 @@ OCXMLLoader.prototype={ var HttpStatus=req.status; if (HttpStatus==200 || HttpStatus==0){ //alert("response: "+this.req.responseText); - this.callBack(this.req); + this.callBack(this.req,this.arg); }else{ - this.errorCallBack(this.req); + this.errorCallBack(this.req,this.arg); } } }, diff --git a/settings/index.php b/settings/index.php index 7cdb993e45e..d5e7451d08b 100755 --- a/settings/index.php +++ b/settings/index.php @@ -21,6 +21,7 @@ * */ +$CONFIG_ERROR=''; require_once('../inc/lib_base.php');
current password
$CONFIG_ERROR
current password
admin login:
admin password:(leave empty to keep current password)
date format:
database type:
database host:
database name:
database user:
database password:
database password:(leave empty to keep current password)
retype database password:
create database and user: onchange='showDBAdmin()'>
database administrative user: