<?php if(count($_["breadcrumb"])):?>
<div class="crumb">
<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>
</div>
<?php endif;?>
// User-related hooks
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
OCP\Util::connectHook( 'OCP\Share', 'post_shared', 'OCA\Encryption\Hooks', 'postShared' );
\r
}\r
\r
-}
\ No newline at end of file
+}
foreach ($data[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
$content .= "\t\t'".$group."' => array (\n";
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";
foreach ($data[self::MOUNT_TYPE_USER] as $user => $mounts) {
$content .= "\t\t'".$user."' => array (\n";
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";
}
case 'ab':
//these are supported by the wrapper
$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 'w+':
case 'wb+':
$this->getFile($path, $tmpFile);
}
self::$tempFiles[$tmpFile]=$path;
- return fopen('close://'.$tmpFile,$mode);
+ return fopen('close://'.$tmpFile, $mode);
}
return false;
}
$this->share='/'.$this->share;
}
if(substr($this->share, -1, 1)=='/') {
- $this->share = substr($this->share,0,-1);
+ $this->share = substr($this->share, 0, -1);
}
}
return $succes;
}
- public function fopen($path,$mode) {
+ public function fopen($path, $mode) {
$this->init();
- return fopen($this->constructUrl($path),$mode);
+ return fopen($this->constructUrl($path), $mode);
}
public function free_space($path) {
return 0;
}
- public function touch($path,$mtime=null) {
+ public function touch($path, $mtime=null) {
$this->init();
if(is_null($mtime)) {
- $fh = $this->fopen($path,'a');
- fwrite($fh,'');
+ $fh = $this->fopen($path, 'a');
+ fwrite($fh, '');
fclose($fh);
} else {
return false;//not supported
}
}
- public function getFile($path,$target) {
+ public function getFile($path, $target) {
$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();
- return copy($path,$this->constructUrl($target));
+ return copy($path, $this->constructUrl($target));
}
- public function rename($path1,$path2) {
+ public function rename($path1, $path2) {
$this->init();
- return rename($this->constructUrl($path1),$this->constructUrl($path2));
+ return rename($this->constructUrl($path1), $this->constructUrl($path2));
}
public function stat($path) {
return false;
} else {
$fh=fopen($tmpFile, 'a');
- fwrite($fh,$name . "\n");
+ fwrite($fh, $name . "\n");
}
} catch(\Exception $e) {
file_put_contents($tmpFile, $name . "\n");
public function unlink($path) {
$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();
$path=$this->cleanPath($path);
switch($mode) {
$this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
}
- public function getFile($path,$target) {
+ public function getFile($path, $target) {
$this->init();
- $source=$this->fopen($path,'r');
- file_put_contents($target,$source);
+ $source=$this->fopen($path, 'r');
+ file_put_contents($target, $source);
}
- public function uploadFile($path,$target) {
+ public function uploadFile($path, $target) {
$this->init();
$source=fopen($path, 'r');
curl_close ($curl);
}
- public function rename($path1,$path2) {
+ public function rename($path1, $path2) {
$this->init();
$path1=$this->cleanPath($path1);
$path2=$this->root.$this->cleanPath($path2);
}
}
- public function copy($path1,$path2) {
+ public function copy($path1, $path2) {
$this->init();
$path1=$this->cleanPath($path1);
$path2=$this->root.$this->cleanPath($path2);
}
}
- private function simpleResponse($method,$path,$body,$expected) {
+ private function simpleResponse($method, $path, $body, $expected) {
$path=$this->cleanPath($path);
try {
$response=$this->client->request($method, $path, $body);
$filelist .= $e.', ';
}
$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,
"success" => $success, "error" => $error)));
} else {
$pos = strpos($dir.'/', '/', 1);
$tmp = substr($dir, 0, $pos);
$pos = strrpos($tmp, '.d');
- $timestamp = substr($tmp,$pos+2);
+ $timestamp = substr($tmp, $pos+2);
$result[] = array(
'id' => $entryName,
'timestamp' => $timestamp,
}\r
}
} 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\r
\OCP\Config::setAppValue('files_trashbin', 'size', $trashbinSize);
return true;
} 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;
$this->config['turnOffCertCheck']
= $this->$v('ldap_turn_off_cert_check');
$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->$v('ldap_userlist_filter');
$this->config['ldapGroupFilter'] = $this->$v('ldap_group_filter');
*/
public function get() {
- return \OC\Files\Filesystem::fopen($this->path,'rb');
+ return \OC\Files\Filesystem::fopen($this->path, 'rb');
}
$newPath = $parentPath . '/' . $newName;
$oldPath = $this->path;
- \OC\Files\Filesystem::rename($this->path,$newPath);
+ \OC\Files\Filesystem::rename($this->path, $newPath);
$this->path = $newPath;
$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 ));
}
private function stripLast($path) {
if (substr($path, -1) == '/') {
- $path = substr_replace($path ,'',-1);
+ $path = substr_replace($path, '', -1);
}
return $path;
}
}
return fread($handle, $size);
}
- public function file_put_contents($path,$data) {
+ public function file_put_contents($path, $data) {
$handle = $this->fopen($path, "w");
return fwrite($handle, $data);
}
- public function rename($path1,$path2) {
- if($this->copy($path1,$path2)) {
+ public function rename($path1, $path2) {
+ if($this->copy($path1, $path2)) {
return $this->unlink($path1);
}else{
return false;
}
}
- public function copy($path1,$path2) {
- $source=$this->fopen($path1,'r');
- $target=$this->fopen($path2,'w');
- $count=\OC_Helper::streamCopy($source,$target);
+ public function copy($path1, $path2) {
+ $source=$this->fopen($path1, 'r');
+ $target=$this->fopen($path2, 'w');
+ $count=\OC_Helper::streamCopy($source, $target);
return $count>0;
}
* deleted together with its contents. To avoid this set $empty to true
*/
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 ) ) {
return false;
if($this->is_dir($path)) {
return 'httpd/unix-directory';
}
- $source=$this->fopen($path,'r');
+ $source=$this->fopen($path, 'r');
if(!$source) {
return false;
}
- $head=fread($source,8192);//8kb should suffice to determine a mimetype
- if($pos=strrpos($path,'.')) {
- $extension=substr($path,$pos);
+ $head=fread($source, 8192);//8kb should suffice to determine a mimetype
+ if($pos=strrpos($path, '.')) {
+ $extension=substr($path, $pos);
}else{
$extension='';
}
$tmpFile=\OC_Helper::tmpFile($extension);
- file_put_contents($tmpFile,$head);
+ file_put_contents($tmpFile, $head);
$mime=\OC_Helper::getMimeType($tmpFile);
unlink($tmpFile);
return $mime;
}
- public function hash($type,$path,$raw = false) {
+ public function hash($type, $path, $raw = false) {
$tmpFile=$this->getLocalFile($path);
- $hash=hash($type,$tmpFile,$raw);
+ $hash=hash($type, $tmpFile, $raw);
unlink($tmpFile);
return $hash;
}
return $this->toTmpFile($path);
}
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) {
return false;
}
- if($pos=strrpos($path,'.')) {
- $extension=substr($path,$pos);
+ if($pos=strrpos($path, '.')) {
+ $extension=substr($path, $pos);
}else{
$extension='';
}
$tmpFile=\OC_Helper::tmpFile($extension);
- $target=fopen($tmpFile,'w');
- \OC_Helper::streamCopy($source,$target);
+ $target=fopen($tmpFile, 'w');
+ \OC_Helper::streamCopy($source, $target);
return $tmpFile;
}
public function getLocalFolder($path) {
$baseDir=\OC_Helper::tmpFolder();
- $this->addLocalFolder($path,$baseDir);
+ $this->addLocalFolder($path, $baseDir);
return $baseDir;
}
- private function addLocalFolder($path,$target) {
+ private function addLocalFolder($path, $target) {
if($dh=$this->opendir($path)) {
while($file=readdir($dh)) {
if($file!=='.' and $file!=='..') {
if($this->is_dir($path.'/'.$file)) {
mkdir($target.'/'.$file);
- $this->addLocalFolder($path.'/'.$file,$target.'/'.$file);
+ $this->addLocalFolder($path.'/'.$file, $target.'/'.$file);
}else{
$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();
$dh=$this->opendir($dir);
if($dh) {
$files[]=$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));
}
}
}
* @param int $time
* @return bool
*/
- public function hasUpdated($path,$time) {
+ public function hasUpdated($path, $time) {
return $this->filemtime($path)>$time;
}
return opendir($this->datadir.$path);
}
public function is_dir($path) {
- if(substr($path,-1)=='/') {
+ if(substr($path, -1)=='/') {
$path=substr($path, 0, -1);
}
return is_dir($this->datadir.$path);
}
public function rename($path1, $path2) {
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;
}
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 opendir('fakedir://local-win32'.$path);
}
public function is_dir($path) {
- if(substr($path,-1)=='/') {
+ if(substr($path, -1)=='/') {
$path=substr($path, 0, -1);
}
return is_dir($this->buildPath($path));
}
public function rename($path1, $path2) {
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;
}
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;
}
$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.=OC_OCS::getDebugOutput();
- echo(OC_OCS::generateXml($format,'failed',999,$txt));
+ echo(OC_OCS::generateXml($format, 'failed', 999, $txt));
}
foreach($apps as $app) {
$info = OC_App::getAppInfo($app);
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;
}
}
$user = OC_User::getUser();
$app = addslashes(strip_tags($parameters['app']));
$key = addslashes(strip_tags($parameters['key']));
- $result = OC_OCS::getData($user,$app,$key);
+ $result = OC_OCS::getData($user, $app, $key);
$xml = array();
foreach($result as $i=>$log) {
$xml[$i]['key']=$log['key'];
* @return Item
*/
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));
if (\OC_DB::isError($result)) {
\OC_Log::write('OCP\Share', \OC_DB::getErrorMessage($result) . ', token=' . $token, \OC_Log::ERROR);
*/
public static function userExists($uid, $excludingBackend=null) {
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);
continue;
}
curl_setopt($curl, CURLOPT_MAXREDIRS, 10);
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'));
}
- if(OC_Config::getValue('proxyuserpwd','')<>'') {
+ if(OC_Config::getValue('proxyuserpwd', '')<>'') {
curl_setopt($curl, CURLOPT_PROXYUSERPWD, OC_Config::getValue('proxyuserpwd'));
}
$data = curl_exec($curl);
} else {
$contextArray = null;
- if(OC_Config::getValue('proxy','')<>'') {
+ if(OC_Config::getValue('proxy', '')<>'') {
$contextArray = array(
'http' => array(
'timeout' => 10,