From 30673e478672af316c057f562a8a02babdbd3160 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 5 Feb 2012 14:00:49 +0100 Subject: [PATCH] writable not writeable --- apps/files_sharing/sharedstorage.php | 10 +++++----- apps/files_texteditor/ajax/loadfile.php | 2 +- apps/files_texteditor/ajax/savefile.php | 2 +- files/index.php | 2 +- files/templates/part.list.php | 2 +- lib/filestorage.php | 2 +- lib/filestorage/local.php | 2 +- lib/filestoragecommon.php | 2 +- lib/filesystem.php | 4 ++-- lib/filesystemview.php | 6 +++--- lib/util.php | 2 +- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php index fa6fe7913f2..4840cce4c9d 100644 --- a/apps/files_sharing/sharedstorage.php +++ b/apps/files_sharing/sharedstorage.php @@ -259,7 +259,7 @@ class OC_Filestorage_Shared extends OC_Filestorage { return true; } - public function is_writeable($path) { + public function is_writable($path) { if($path == "" || $path == "/"){ return false; }elseif (OC_Share::getPermissions($this->datadir.$path) & OC_Share::WRITE) { @@ -340,7 +340,7 @@ class OC_Filestorage_Shared extends OC_Filestorage { } public function file_put_contents($path, $data) { - if ($this->is_writeable($path)) { + if ($this->is_writable($path)) { $source = $this->getSource($path); if ($source) { $storage = OC_Filesystem::getStorage($source); @@ -384,7 +384,7 @@ class OC_Filestorage_Shared extends OC_Filestorage { if ($root1 !== $root2) { return false; // Check if both paths have write permission - } else if ($this->is_writeable($path1) && $this->is_writeable($path2)) { + } else if ($this->is_writable($path1) && $this->is_writable($path2)) { $oldSource = $this->getSource($path1); $newSource = $folders['source'].substr($newTarget, strlen($folders['target'])); if ($oldSource) { @@ -414,7 +414,7 @@ class OC_Filestorage_Shared extends OC_Filestorage { if ($path2 == "" || $path2 == "/") { // TODO Construct new shared item or should this not be allowed? } else { - if ($this->is_writeable($path2)) { + if ($this->is_writable($path2)) { $tmpFile = $this->toTmpFile($path1); $result = $this->fromTmpFile($tmpFile, $path2); if ($result) { @@ -444,7 +444,7 @@ class OC_Filestorage_Shared extends OC_Filestorage { } public function fromTmpFile($tmpFile, $path) { - if ($this->is_writeable($path)) { + if ($this->is_writable($path)) { $source = $this->getSource($path); if ($source) { $storage = OC_Filesystem::getStorage($source); diff --git a/apps/files_texteditor/ajax/loadfile.php b/apps/files_texteditor/ajax/loadfile.php index 64e016be8c2..8ece844aa29 100644 --- a/apps/files_texteditor/ajax/loadfile.php +++ b/apps/files_texteditor/ajax/loadfile.php @@ -33,7 +33,7 @@ $filename = isset($_GET['file']) ? $_GET['file'] : ''; if(!empty($filename)) { $path = $dir.'/'.$filename; - if(OC_Filesystem::is_writeable($path)) + if(OC_Filesystem::is_writable($path)) { $mtime = OC_Filesystem::filemtime($path); $filecontents = OC_Filesystem::file_get_contents($path); diff --git a/apps/files_texteditor/ajax/savefile.php b/apps/files_texteditor/ajax/savefile.php index 846159c13b7..589428d1862 100644 --- a/apps/files_texteditor/ajax/savefile.php +++ b/apps/files_texteditor/ajax/savefile.php @@ -46,7 +46,7 @@ if($path != '' && $mtime != '') { // File same as when opened // Save file - if(OC_Filesystem::is_writeable($path)) + if(OC_Filesystem::is_writable($path)) { OC_Filesystem::file_put_contents($path, $filecontents); // Clear statcache diff --git a/files/index.php b/files/index.php index fbf7a4901a1..f166790ba9c 100644 --- a/files/index.php +++ b/files/index.php @@ -94,7 +94,7 @@ $tmpl = new OC_Template( "files", "index", "user" ); $tmpl->assign( "fileList", $list->fetchPage() ); $tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() ); $tmpl->assign( 'dir', $dir); -$tmpl->assign( 'readonly', !OC_Filesystem::is_writeable($dir)); +$tmpl->assign( 'readonly', !OC_Filesystem::is_writable($dir)); $tmpl->assign( "files", $files ); $tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign( 'uploadMaxHumanFilesize', OC_Helper::humanFileSize($maxUploadFilesize)); diff --git a/files/templates/part.list.php b/files/templates/part.list.php index 92b6f37d8e7..b117d81a1a5 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -1,5 +1,5 @@ datadir.$path); } - public function is_writeable($path){ + public function is_writable($path){ return is_writable($this->datadir.$path); } public function file_exists($path){ diff --git a/lib/filestoragecommon.php b/lib/filestoragecommon.php index 35a926ecb07..f522d15c4e9 100644 --- a/lib/filestoragecommon.php +++ b/lib/filestoragecommon.php @@ -35,7 +35,7 @@ class OC_Filestorage_Common extends OC_Filestorage { return $stat['size']; } public function is_readable($path){} - public function is_writeable($path){} + public function is_writable($path){} public function file_exists($path){} public function readfile($path) { $handle = $this->fopen($path, "r"); diff --git a/lib/filesystem.php b/lib/filesystem.php index 8e55575e665..a18072ecbc2 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -333,8 +333,8 @@ class OC_Filesystem{ static public function is_readable($path){ return self::$defaultInstance->is_readable($path); } - static public function is_writeable($path){ - return self::$defaultInstance->is_writeable($path); + static public function is_writable($path){ + return self::$defaultInstance->is_writable($path); } static public function file_exists($path){ return self::$defaultInstance->file_exists($path); diff --git a/lib/filesystemview.php b/lib/filesystemview.php index 6c2ca916310..4586507a811 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -141,8 +141,8 @@ class OC_FilesystemView { public function is_readable($path){ return $this->basicOperation('is_readable',$path); } - public function is_writeable($path){ - return $this->basicOperation('is_writeable',$path); + public function is_writable($path){ + return $this->basicOperation('is_writable',$path); } public function file_exists($path){ if($path=='/'){ @@ -166,7 +166,7 @@ class OC_FilesystemView { return $this->basicOperation('unlink',$path,array('delete')); } public function rename($path1,$path2){ - if(OC_FileProxy::runPreProxies('rename',$path1,$path2) and $this->is_writeable($path1) and OC_Filesystem::isValidPath($path2)){ + if(OC_FileProxy::runPreProxies('rename',$path1,$path2) and $this->is_writable($path1) and OC_Filesystem::isValidPath($path2)){ $run=true; OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_rename, array( OC_Filesystem::signal_param_oldpath => $path1 , OC_Filesystem::signal_param_newpath=>$path2, OC_Filesystem::signal_param_run => &$run)); if($run){ diff --git a/lib/util.php b/lib/util.php index 6c19c5416a2..abd918044b5 100644 --- a/lib/util.php +++ b/lib/util.php @@ -226,7 +226,7 @@ class OC_Util { $errors[]=array('error'=>'PHP module ctype is not installed.
','hint'=>'Please ask your server administrator to install the module.'); } - if(file_exists(OC::$SERVERROOT."/config/config.php") and !is_writeable(OC::$SERVERROOT."/config/config.php")){ + if(file_exists(OC::$SERVERROOT."/config/config.php") and !is_writable(OC::$SERVERROOT."/config/config.php")){ $errors[]=array('error'=>"Can't write into config directory 'config'",'hint'=>"You can usually fix this by giving the webserver use write access to the config directory in owncloud"); } -- 2.39.5