Fix NoSpaceAfterComma and SpaceBeforeComma
This commit is contained in:
parent
d3ef967993
commit
cd35d257bb
|
@ -1,7 +1,7 @@
|
||||||
<?php if(count($_["breadcrumb"])):?>
|
<?php if(count($_["breadcrumb"])):?>
|
||||||
<div class="crumb">
|
<div class="crumb">
|
||||||
<a href="<?php echo $_['baseURL']; ?>">
|
<a href="<?php echo $_['baseURL']; ?>">
|
||||||
<img src="<?php echo OCP\image_path('core','places/home.svg');?>" class="svg" />
|
<img src="<?php echo OCP\image_path('core', 'places/home.svg');?>" class="svg" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
|
|
|
@ -12,7 +12,7 @@ OC_FileProxy::register( new OCA\Encryption\Proxy() );
|
||||||
|
|
||||||
// User-related hooks
|
// User-related hooks
|
||||||
OCP\Util::connectHook( 'OC_User', 'post_login', 'OCA\Encryption\Hooks', 'login' );
|
OCP\Util::connectHook( 'OC_User', 'post_login', 'OCA\Encryption\Hooks', 'login' );
|
||||||
OCP\Util::connectHook( 'OC_User', 'pre_setPassword','OCA\Encryption\Hooks', 'setPassphrase' );
|
OCP\Util::connectHook( 'OC_User', 'pre_setPassword', 'OCA\Encryption\Hooks', 'setPassphrase' );
|
||||||
|
|
||||||
// Sharing-related hooks
|
// Sharing-related hooks
|
||||||
OCP\Util::connectHook( 'OCP\Share', 'post_shared', 'OCA\Encryption\Hooks', 'postShared' );
|
OCP\Util::connectHook( 'OCP\Share', 'post_shared', 'OCA\Encryption\Hooks', 'postShared' );
|
||||||
|
|
|
@ -692,4 +692,4 @@ class Crypt {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,7 +310,7 @@ class OC_Mount_Config {
|
||||||
foreach ($data[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
|
foreach ($data[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
|
||||||
$content .= "\t\t'".$group."' => array (\n";
|
$content .= "\t\t'".$group."' => array (\n";
|
||||||
foreach ($mounts as $mountPoint => $mount) {
|
foreach ($mounts as $mountPoint => $mount) {
|
||||||
$content .= "\t\t\t'".addcslashes($mountPoint,"'")."' => ".str_replace("\n", '', var_export($mount, true)).", \n";
|
$content .= "\t\t\t'".addcslashes($mountPoint, "'")."' => ".str_replace("\n", '', var_export($mount, true)).", \n";
|
||||||
|
|
||||||
}
|
}
|
||||||
$content .= "\t\t),\n";
|
$content .= "\t\t),\n";
|
||||||
|
@ -322,7 +322,7 @@ class OC_Mount_Config {
|
||||||
foreach ($data[self::MOUNT_TYPE_USER] as $user => $mounts) {
|
foreach ($data[self::MOUNT_TYPE_USER] as $user => $mounts) {
|
||||||
$content .= "\t\t'".$user."' => array (\n";
|
$content .= "\t\t'".$user."' => array (\n";
|
||||||
foreach ($mounts as $mountPoint => $mount) {
|
foreach ($mounts as $mountPoint => $mount) {
|
||||||
$content .= "\t\t\t'".addcslashes($mountPoint,"'")."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
|
$content .= "\t\t\t'".addcslashes($mountPoint, "'")."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
|
||||||
}
|
}
|
||||||
$content .= "\t\t),\n";
|
$content .= "\t\t),\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ class FTP extends \OC\Files\Storage\StreamWrapper{
|
||||||
case 'ab':
|
case 'ab':
|
||||||
//these are supported by the wrapper
|
//these are supported by the wrapper
|
||||||
$context = stream_context_create(array('ftp' => array('overwrite' => true)));
|
$context = stream_context_create(array('ftp' => array('overwrite' => true)));
|
||||||
return fopen($this->constructUrl($path),$mode, false,$context);
|
return fopen($this->constructUrl($path), $mode, false, $context);
|
||||||
case 'r+':
|
case 'r+':
|
||||||
case 'w+':
|
case 'w+':
|
||||||
case 'wb+':
|
case 'wb+':
|
||||||
|
@ -89,7 +89,7 @@ class FTP extends \OC\Files\Storage\StreamWrapper{
|
||||||
$this->getFile($path, $tmpFile);
|
$this->getFile($path, $tmpFile);
|
||||||
}
|
}
|
||||||
self::$tempFiles[$tmpFile]=$path;
|
self::$tempFiles[$tmpFile]=$path;
|
||||||
return fopen('close://'.$tmpFile,$mode);
|
return fopen('close://'.$tmpFile, $mode);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
|
||||||
$this->share='/'.$this->share;
|
$this->share='/'.$this->share;
|
||||||
}
|
}
|
||||||
if(substr($this->share, -1, 1)=='/') {
|
if(substr($this->share, -1, 1)=='/') {
|
||||||
$this->share = substr($this->share,0,-1);
|
$this->share = substr($this->share, 0, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,39 +71,39 @@ abstract class StreamWrapper extends \OC\Files\Storage\Common{
|
||||||
return $succes;
|
return $succes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fopen($path,$mode) {
|
public function fopen($path, $mode) {
|
||||||
$this->init();
|
$this->init();
|
||||||
return fopen($this->constructUrl($path),$mode);
|
return fopen($this->constructUrl($path), $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function free_space($path) {
|
public function free_space($path) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function touch($path,$mtime=null) {
|
public function touch($path, $mtime=null) {
|
||||||
$this->init();
|
$this->init();
|
||||||
if(is_null($mtime)) {
|
if(is_null($mtime)) {
|
||||||
$fh = $this->fopen($path,'a');
|
$fh = $this->fopen($path, 'a');
|
||||||
fwrite($fh,'');
|
fwrite($fh, '');
|
||||||
fclose($fh);
|
fclose($fh);
|
||||||
} else {
|
} else {
|
||||||
return false;//not supported
|
return false;//not supported
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFile($path,$target) {
|
public function getFile($path, $target) {
|
||||||
$this->init();
|
$this->init();
|
||||||
return copy($this->constructUrl($path),$target);
|
return copy($this->constructUrl($path), $target);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function uploadFile($path,$target) {
|
public function uploadFile($path, $target) {
|
||||||
$this->init();
|
$this->init();
|
||||||
return copy($path,$this->constructUrl($target));
|
return copy($path, $this->constructUrl($target));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rename($path1,$path2) {
|
public function rename($path1, $path2) {
|
||||||
$this->init();
|
$this->init();
|
||||||
return rename($this->constructUrl($path1),$this->constructUrl($path2));
|
return rename($this->constructUrl($path1), $this->constructUrl($path2));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function stat($path) {
|
public function stat($path) {
|
||||||
|
|
|
@ -210,7 +210,7 @@ class SWIFT extends \OC\Files\Storage\Common{
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
$fh=fopen($tmpFile, 'a');
|
$fh=fopen($tmpFile, 'a');
|
||||||
fwrite($fh,$name . "\n");
|
fwrite($fh, $name . "\n");
|
||||||
}
|
}
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
file_put_contents($tmpFile, $name . "\n");
|
file_put_contents($tmpFile, $name . "\n");
|
||||||
|
|
|
@ -153,10 +153,10 @@ class DAV extends \OC\Files\Storage\Common{
|
||||||
|
|
||||||
public function unlink($path) {
|
public function unlink($path) {
|
||||||
$this->init();
|
$this->init();
|
||||||
return $this->simpleResponse('DELETE', $path, null ,204);
|
return $this->simpleResponse('DELETE', $path, null, 204);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fopen($path,$mode) {
|
public function fopen($path, $mode) {
|
||||||
$this->init();
|
$this->init();
|
||||||
$path=$this->cleanPath($path);
|
$path=$this->cleanPath($path);
|
||||||
switch($mode) {
|
switch($mode) {
|
||||||
|
@ -235,13 +235,13 @@ class DAV extends \OC\Files\Storage\Common{
|
||||||
$this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
|
$this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFile($path,$target) {
|
public function getFile($path, $target) {
|
||||||
$this->init();
|
$this->init();
|
||||||
$source=$this->fopen($path,'r');
|
$source=$this->fopen($path, 'r');
|
||||||
file_put_contents($target,$source);
|
file_put_contents($target, $source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function uploadFile($path,$target) {
|
public function uploadFile($path, $target) {
|
||||||
$this->init();
|
$this->init();
|
||||||
$source=fopen($path, 'r');
|
$source=fopen($path, 'r');
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ class DAV extends \OC\Files\Storage\Common{
|
||||||
curl_close ($curl);
|
curl_close ($curl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rename($path1,$path2) {
|
public function rename($path1, $path2) {
|
||||||
$this->init();
|
$this->init();
|
||||||
$path1=$this->cleanPath($path1);
|
$path1=$this->cleanPath($path1);
|
||||||
$path2=$this->root.$this->cleanPath($path2);
|
$path2=$this->root.$this->cleanPath($path2);
|
||||||
|
@ -268,7 +268,7 @@ class DAV extends \OC\Files\Storage\Common{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function copy($path1,$path2) {
|
public function copy($path1, $path2) {
|
||||||
$this->init();
|
$this->init();
|
||||||
$path1=$this->cleanPath($path1);
|
$path1=$this->cleanPath($path1);
|
||||||
$path2=$this->root.$this->cleanPath($path2);
|
$path2=$this->root.$this->cleanPath($path2);
|
||||||
|
@ -321,7 +321,7 @@ class DAV extends \OC\Files\Storage\Common{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function simpleResponse($method,$path,$body,$expected) {
|
private function simpleResponse($method, $path, $body, $expected) {
|
||||||
$path=$this->cleanPath($path);
|
$path=$this->cleanPath($path);
|
||||||
try {
|
try {
|
||||||
$response=$this->client->request($method, $path, $body);
|
$response=$this->client->request($method, $path, $body);
|
||||||
|
|
|
@ -38,7 +38,7 @@ if ( $error ) {
|
||||||
$filelist .= $e.', ';
|
$filelist .= $e.', ';
|
||||||
}
|
}
|
||||||
$l = OC_L10N::get('files_trashbin');
|
$l = OC_L10N::get('files_trashbin');
|
||||||
$message = $l->t("Couldn't restore %s", array(rtrim($filelist,', ')));
|
$message = $l->t("Couldn't restore %s", array(rtrim($filelist, ', ')));
|
||||||
OCP\JSON::error(array("data" => array("message" => $message,
|
OCP\JSON::error(array("data" => array("message" => $message,
|
||||||
"success" => $success, "error" => $error)));
|
"success" => $success, "error" => $error)));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -27,7 +27,7 @@ if ($dir) {
|
||||||
$pos = strpos($dir.'/', '/', 1);
|
$pos = strpos($dir.'/', '/', 1);
|
||||||
$tmp = substr($dir, 0, $pos);
|
$tmp = substr($dir, 0, $pos);
|
||||||
$pos = strrpos($tmp, '.d');
|
$pos = strrpos($tmp, '.d');
|
||||||
$timestamp = substr($tmp,$pos+2);
|
$timestamp = substr($tmp, $pos+2);
|
||||||
$result[] = array(
|
$result[] = array(
|
||||||
'id' => $entryName,
|
'id' => $entryName,
|
||||||
'timestamp' => $timestamp,
|
'timestamp' => $timestamp,
|
||||||
|
|
|
@ -80,7 +80,7 @@ class Trashbin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
\OC_Log::write('files_trashbin', 'Couldn\'t move '.$file_path.' to the trash bin' , \OC_log::ERROR);
|
\OC_Log::write('files_trashbin', 'Couldn\'t move '.$file_path.' to the trash bin', \OC_log::ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get available disk space for user
|
// get available disk space for user
|
||||||
|
@ -188,7 +188,7 @@ class Trashbin {
|
||||||
\OCP\Config::setAppValue('files_trashbin', 'size', $trashbinSize);
|
\OCP\Config::setAppValue('files_trashbin', 'size', $trashbinSize);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
\OC_Log::write('files_trashbin', 'Couldn\'t restore file from trash bin, '.$filename , \OC_log::ERROR);
|
\OC_Log::write('files_trashbin', 'Couldn\'t restore file from trash bin, '.$filename, \OC_log::ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -235,7 +235,7 @@ class Connection {
|
||||||
$this->config['turnOffCertCheck']
|
$this->config['turnOffCertCheck']
|
||||||
= $this->$v('ldap_turn_off_cert_check');
|
= $this->$v('ldap_turn_off_cert_check');
|
||||||
$this->config['ldapUserDisplayName']
|
$this->config['ldapUserDisplayName']
|
||||||
= mb_strtolower($this->$v('ldap_display_name'),'UTF-8');
|
= mb_strtolower($this->$v('ldap_display_name'), 'UTF-8');
|
||||||
$this->config['ldapUserFilter']
|
$this->config['ldapUserFilter']
|
||||||
= $this->$v('ldap_userlist_filter');
|
= $this->$v('ldap_userlist_filter');
|
||||||
$this->config['ldapGroupFilter'] = $this->$v('ldap_group_filter');
|
$this->config['ldapGroupFilter'] = $this->$v('ldap_group_filter');
|
||||||
|
|
|
@ -84,7 +84,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
|
||||||
*/
|
*/
|
||||||
public function get() {
|
public function get() {
|
||||||
|
|
||||||
return \OC\Files\Filesystem::fopen($this->path,'rb');
|
return \OC\Files\Filesystem::fopen($this->path, 'rb');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,12 +84,12 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
|
||||||
$newPath = $parentPath . '/' . $newName;
|
$newPath = $parentPath . '/' . $newName;
|
||||||
$oldPath = $this->path;
|
$oldPath = $this->path;
|
||||||
|
|
||||||
\OC\Files\Filesystem::rename($this->path,$newPath);
|
\OC\Files\Filesystem::rename($this->path, $newPath);
|
||||||
|
|
||||||
$this->path = $newPath;
|
$this->path = $newPath;
|
||||||
|
|
||||||
$query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertypath` = ? WHERE `userid` = ? AND `propertypath` = ?' );
|
$query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertypath` = ? WHERE `userid` = ? AND `propertypath` = ?' );
|
||||||
$query->execute( array( $newPath,OC_User::getUser(), $oldPath ));
|
$query->execute( array( $newPath, OC_User::getUser(), $oldPath ));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ class Mapper
|
||||||
|
|
||||||
private function stripLast($path) {
|
private function stripLast($path) {
|
||||||
if (substr($path, -1) == '/') {
|
if (substr($path, -1) == '/') {
|
||||||
$path = substr_replace($path ,'',-1);
|
$path = substr_replace($path, '', -1);
|
||||||
}
|
}
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,21 +83,21 @@ abstract class Common implements \OC\Files\Storage\Storage {
|
||||||
}
|
}
|
||||||
return fread($handle, $size);
|
return fread($handle, $size);
|
||||||
}
|
}
|
||||||
public function file_put_contents($path,$data) {
|
public function file_put_contents($path, $data) {
|
||||||
$handle = $this->fopen($path, "w");
|
$handle = $this->fopen($path, "w");
|
||||||
return fwrite($handle, $data);
|
return fwrite($handle, $data);
|
||||||
}
|
}
|
||||||
public function rename($path1,$path2) {
|
public function rename($path1, $path2) {
|
||||||
if($this->copy($path1,$path2)) {
|
if($this->copy($path1, $path2)) {
|
||||||
return $this->unlink($path1);
|
return $this->unlink($path1);
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function copy($path1,$path2) {
|
public function copy($path1, $path2) {
|
||||||
$source=$this->fopen($path1,'r');
|
$source=$this->fopen($path1, 'r');
|
||||||
$target=$this->fopen($path2,'w');
|
$target=$this->fopen($path2, 'w');
|
||||||
$count=\OC_Helper::streamCopy($source,$target);
|
$count=\OC_Helper::streamCopy($source, $target);
|
||||||
return $count>0;
|
return $count>0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
|
||||||
* deleted together with its contents. To avoid this set $empty to true
|
* deleted together with its contents. To avoid this set $empty to true
|
||||||
*/
|
*/
|
||||||
public function deleteAll( $directory, $empty = false ) {
|
public function deleteAll( $directory, $empty = false ) {
|
||||||
$directory = trim($directory,'/');
|
$directory = trim($directory, '/');
|
||||||
|
|
||||||
if ( !$this->file_exists( \OCP\USER::getUser() . '/' . $directory ) || !$this->is_dir( \OCP\USER::getUser() . '/' . $directory ) ) {
|
if ( !$this->file_exists( \OCP\USER::getUser() . '/' . $directory ) || !$this->is_dir( \OCP\USER::getUser() . '/' . $directory ) ) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -146,25 +146,25 @@ abstract class Common implements \OC\Files\Storage\Storage {
|
||||||
if($this->is_dir($path)) {
|
if($this->is_dir($path)) {
|
||||||
return 'httpd/unix-directory';
|
return 'httpd/unix-directory';
|
||||||
}
|
}
|
||||||
$source=$this->fopen($path,'r');
|
$source=$this->fopen($path, 'r');
|
||||||
if(!$source) {
|
if(!$source) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$head=fread($source,8192);//8kb should suffice to determine a mimetype
|
$head=fread($source, 8192);//8kb should suffice to determine a mimetype
|
||||||
if($pos=strrpos($path,'.')) {
|
if($pos=strrpos($path, '.')) {
|
||||||
$extension=substr($path,$pos);
|
$extension=substr($path, $pos);
|
||||||
}else{
|
}else{
|
||||||
$extension='';
|
$extension='';
|
||||||
}
|
}
|
||||||
$tmpFile=\OC_Helper::tmpFile($extension);
|
$tmpFile=\OC_Helper::tmpFile($extension);
|
||||||
file_put_contents($tmpFile,$head);
|
file_put_contents($tmpFile, $head);
|
||||||
$mime=\OC_Helper::getMimeType($tmpFile);
|
$mime=\OC_Helper::getMimeType($tmpFile);
|
||||||
unlink($tmpFile);
|
unlink($tmpFile);
|
||||||
return $mime;
|
return $mime;
|
||||||
}
|
}
|
||||||
public function hash($type,$path,$raw = false) {
|
public function hash($type, $path, $raw = false) {
|
||||||
$tmpFile=$this->getLocalFile($path);
|
$tmpFile=$this->getLocalFile($path);
|
||||||
$hash=hash($type,$tmpFile,$raw);
|
$hash=hash($type, $tmpFile, $raw);
|
||||||
unlink($tmpFile);
|
unlink($tmpFile);
|
||||||
return $hash;
|
return $hash;
|
||||||
}
|
}
|
||||||
|
@ -175,42 +175,42 @@ abstract class Common implements \OC\Files\Storage\Storage {
|
||||||
return $this->toTmpFile($path);
|
return $this->toTmpFile($path);
|
||||||
}
|
}
|
||||||
private function toTmpFile($path) {//no longer in the storage api, still useful here
|
private function toTmpFile($path) {//no longer in the storage api, still useful here
|
||||||
$source=$this->fopen($path,'r');
|
$source=$this->fopen($path, 'r');
|
||||||
if(!$source) {
|
if(!$source) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if($pos=strrpos($path,'.')) {
|
if($pos=strrpos($path, '.')) {
|
||||||
$extension=substr($path,$pos);
|
$extension=substr($path, $pos);
|
||||||
}else{
|
}else{
|
||||||
$extension='';
|
$extension='';
|
||||||
}
|
}
|
||||||
$tmpFile=\OC_Helper::tmpFile($extension);
|
$tmpFile=\OC_Helper::tmpFile($extension);
|
||||||
$target=fopen($tmpFile,'w');
|
$target=fopen($tmpFile, 'w');
|
||||||
\OC_Helper::streamCopy($source,$target);
|
\OC_Helper::streamCopy($source, $target);
|
||||||
return $tmpFile;
|
return $tmpFile;
|
||||||
}
|
}
|
||||||
public function getLocalFolder($path) {
|
public function getLocalFolder($path) {
|
||||||
$baseDir=\OC_Helper::tmpFolder();
|
$baseDir=\OC_Helper::tmpFolder();
|
||||||
$this->addLocalFolder($path,$baseDir);
|
$this->addLocalFolder($path, $baseDir);
|
||||||
return $baseDir;
|
return $baseDir;
|
||||||
}
|
}
|
||||||
private function addLocalFolder($path,$target) {
|
private function addLocalFolder($path, $target) {
|
||||||
if($dh=$this->opendir($path)) {
|
if($dh=$this->opendir($path)) {
|
||||||
while($file=readdir($dh)) {
|
while($file=readdir($dh)) {
|
||||||
if($file!=='.' and $file!=='..') {
|
if($file!=='.' and $file!=='..') {
|
||||||
if($this->is_dir($path.'/'.$file)) {
|
if($this->is_dir($path.'/'.$file)) {
|
||||||
mkdir($target.'/'.$file);
|
mkdir($target.'/'.$file);
|
||||||
$this->addLocalFolder($path.'/'.$file,$target.'/'.$file);
|
$this->addLocalFolder($path.'/'.$file, $target.'/'.$file);
|
||||||
}else{
|
}else{
|
||||||
$tmp=$this->toTmpFile($path.'/'.$file);
|
$tmp=$this->toTmpFile($path.'/'.$file);
|
||||||
rename($tmp,$target.'/'.$file);
|
rename($tmp, $target.'/'.$file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function searchInDir($query,$dir='') {
|
protected function searchInDir($query, $dir='') {
|
||||||
$files=array();
|
$files=array();
|
||||||
$dh=$this->opendir($dir);
|
$dh=$this->opendir($dir);
|
||||||
if($dh) {
|
if($dh) {
|
||||||
|
@ -220,7 +220,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
|
||||||
$files[]=$dir.'/'.$item;
|
$files[]=$dir.'/'.$item;
|
||||||
}
|
}
|
||||||
if($this->is_dir($dir.'/'.$item)) {
|
if($this->is_dir($dir.'/'.$item)) {
|
||||||
$files=array_merge($files,$this->searchInDir($query,$dir.'/'.$item));
|
$files=array_merge($files, $this->searchInDir($query, $dir.'/'.$item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
|
||||||
* @param int $time
|
* @param int $time
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function hasUpdated($path,$time) {
|
public function hasUpdated($path, $time) {
|
||||||
return $this->filemtime($path)>$time;
|
return $this->filemtime($path)>$time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class Local extends \OC\Files\Storage\Common{
|
||||||
return opendir($this->datadir.$path);
|
return opendir($this->datadir.$path);
|
||||||
}
|
}
|
||||||
public function is_dir($path) {
|
public function is_dir($path) {
|
||||||
if(substr($path,-1)=='/') {
|
if(substr($path, -1)=='/') {
|
||||||
$path=substr($path, 0, -1);
|
$path=substr($path, 0, -1);
|
||||||
}
|
}
|
||||||
return is_dir($this->datadir.$path);
|
return is_dir($this->datadir.$path);
|
||||||
|
@ -117,11 +117,11 @@ class Local extends \OC\Files\Storage\Common{
|
||||||
}
|
}
|
||||||
public function rename($path1, $path2) {
|
public function rename($path1, $path2) {
|
||||||
if (!$this->isUpdatable($path1)) {
|
if (!$this->isUpdatable($path1)) {
|
||||||
\OC_Log::write('core','unable to rename, file is not writable : '.$path1,\OC_Log::ERROR);
|
\OC_Log::write('core', 'unable to rename, file is not writable : '.$path1, \OC_Log::ERROR);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(! $this->file_exists($path1)) {
|
if(! $this->file_exists($path1)) {
|
||||||
\OC_Log::write('core','unable to rename, file does not exists : '.$path1,\OC_Log::ERROR);
|
\OC_Log::write('core', 'unable to rename, file does not exists : '.$path1, \OC_Log::ERROR);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ class MappedLocal extends \OC\Files\Storage\Common{
|
||||||
return opendir('fakedir://local-win32'.$path);
|
return opendir('fakedir://local-win32'.$path);
|
||||||
}
|
}
|
||||||
public function is_dir($path) {
|
public function is_dir($path) {
|
||||||
if(substr($path,-1)=='/') {
|
if(substr($path, -1)=='/') {
|
||||||
$path=substr($path, 0, -1);
|
$path=substr($path, 0, -1);
|
||||||
}
|
}
|
||||||
return is_dir($this->buildPath($path));
|
return is_dir($this->buildPath($path));
|
||||||
|
@ -138,11 +138,11 @@ class MappedLocal extends \OC\Files\Storage\Common{
|
||||||
}
|
}
|
||||||
public function rename($path1, $path2) {
|
public function rename($path1, $path2) {
|
||||||
if (!$this->isUpdatable($path1)) {
|
if (!$this->isUpdatable($path1)) {
|
||||||
\OC_Log::write('core','unable to rename, file is not writable : '.$path1,\OC_Log::ERROR);
|
\OC_Log::write('core', 'unable to rename, file is not writable : '.$path1, \OC_Log::ERROR);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(! $this->file_exists($path1)) {
|
if(! $this->file_exists($path1)) {
|
||||||
\OC_Log::write('core','unable to rename, file does not exists : '.$path1,\OC_Log::ERROR);
|
\OC_Log::write('core', 'unable to rename, file does not exists : '.$path1, \OC_Log::ERROR);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ class OC_OCS {
|
||||||
$format = self::readData($method, 'format', 'text', '');
|
$format = self::readData($method, 'format', 'text', '');
|
||||||
$txt='Invalid query, please check the syntax. API specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services. DEBUG OUTPUT:'."\n";
|
$txt='Invalid query, please check the syntax. API specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services. DEBUG OUTPUT:'."\n";
|
||||||
$txt.=OC_OCS::getDebugOutput();
|
$txt.=OC_OCS::getDebugOutput();
|
||||||
echo(OC_OCS::generateXml($format,'failed',999,$txt));
|
echo(OC_OCS::generateXml($format, 'failed', 999, $txt));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ class OC_OCS_Cloud {
|
||||||
foreach($apps as $app) {
|
foreach($apps as $app) {
|
||||||
$info = OC_App::getAppInfo($app);
|
$info = OC_App::getAppInfo($app);
|
||||||
if(isset($info['standalone'])) {
|
if(isset($info['standalone'])) {
|
||||||
$newValue = array('name'=>$info['name'],'url'=>OC_Helper::linkToAbsolute($app,''),'icon'=>'');
|
$newValue = array('name'=>$info['name'], 'url'=>OC_Helper::linkToAbsolute($app, ''), 'icon'=>'');
|
||||||
$values[] = $newValue;
|
$values[] = $newValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ class OC_OCS_Privatedata {
|
||||||
$user = OC_User::getUser();
|
$user = OC_User::getUser();
|
||||||
$app = addslashes(strip_tags($parameters['app']));
|
$app = addslashes(strip_tags($parameters['app']));
|
||||||
$key = addslashes(strip_tags($parameters['key']));
|
$key = addslashes(strip_tags($parameters['key']));
|
||||||
$result = OC_OCS::getData($user,$app,$key);
|
$result = OC_OCS::getData($user, $app, $key);
|
||||||
$xml = array();
|
$xml = array();
|
||||||
foreach($result as $i=>$log) {
|
foreach($result as $i=>$log) {
|
||||||
$xml[$i]['key']=$log['key'];
|
$xml[$i]['key']=$log['key'];
|
||||||
|
|
|
@ -142,7 +142,7 @@ class Share {
|
||||||
* @return Item
|
* @return Item
|
||||||
*/
|
*/
|
||||||
public static function getShareByToken($token) {
|
public static function getShareByToken($token) {
|
||||||
$query = \OC_DB::prepare('SELECT * FROM `*PREFIX*share` WHERE `token` = ?',1);
|
$query = \OC_DB::prepare('SELECT * FROM `*PREFIX*share` WHERE `token` = ?', 1);
|
||||||
$result = $query->execute(array($token));
|
$result = $query->execute(array($token));
|
||||||
if (\OC_DB::isError($result)) {
|
if (\OC_DB::isError($result)) {
|
||||||
\OC_Log::write('OCP\Share', \OC_DB::getErrorMessage($result) . ', token=' . $token, \OC_Log::ERROR);
|
\OC_Log::write('OCP\Share', \OC_DB::getErrorMessage($result) . ', token=' . $token, \OC_Log::ERROR);
|
||||||
|
|
|
@ -541,7 +541,7 @@ class OC_User {
|
||||||
*/
|
*/
|
||||||
public static function userExists($uid, $excludingBackend=null) {
|
public static function userExists($uid, $excludingBackend=null) {
|
||||||
foreach(self::$_usedBackends as $backend) {
|
foreach(self::$_usedBackends as $backend) {
|
||||||
if (!is_null($excludingBackend) && !strcmp(get_class($backend),$excludingBackend)) {
|
if (!is_null($excludingBackend) && !strcmp(get_class($backend), $excludingBackend)) {
|
||||||
OC_Log::write('OC_User', $excludingBackend . 'excluded from user existance check.', OC_Log::DEBUG);
|
OC_Log::write('OC_User', $excludingBackend . 'excluded from user existance check.', OC_Log::DEBUG);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -691,10 +691,10 @@ class OC_Util {
|
||||||
curl_setopt($curl, CURLOPT_MAXREDIRS, 10);
|
curl_setopt($curl, CURLOPT_MAXREDIRS, 10);
|
||||||
|
|
||||||
curl_setopt($curl, CURLOPT_USERAGENT, "ownCloud Server Crawler");
|
curl_setopt($curl, CURLOPT_USERAGENT, "ownCloud Server Crawler");
|
||||||
if(OC_Config::getValue('proxy','')<>'') {
|
if(OC_Config::getValue('proxy', '')<>'') {
|
||||||
curl_setopt($curl, CURLOPT_PROXY, OC_Config::getValue('proxy'));
|
curl_setopt($curl, CURLOPT_PROXY, OC_Config::getValue('proxy'));
|
||||||
}
|
}
|
||||||
if(OC_Config::getValue('proxyuserpwd','')<>'') {
|
if(OC_Config::getValue('proxyuserpwd', '')<>'') {
|
||||||
curl_setopt($curl, CURLOPT_PROXYUSERPWD, OC_Config::getValue('proxyuserpwd'));
|
curl_setopt($curl, CURLOPT_PROXYUSERPWD, OC_Config::getValue('proxyuserpwd'));
|
||||||
}
|
}
|
||||||
$data = curl_exec($curl);
|
$data = curl_exec($curl);
|
||||||
|
@ -703,7 +703,7 @@ class OC_Util {
|
||||||
} else {
|
} else {
|
||||||
$contextArray = null;
|
$contextArray = null;
|
||||||
|
|
||||||
if(OC_Config::getValue('proxy','')<>'') {
|
if(OC_Config::getValue('proxy', '')<>'') {
|
||||||
$contextArray = array(
|
$contextArray = array(
|
||||||
'http' => array(
|
'http' => array(
|
||||||
'timeout' => 10,
|
'timeout' => 10,
|
||||||
|
|
Loading…
Reference in New Issue