}elseif(self::shouldEncrypt($path) and $meta['mode']!='r' and $meta['mode']!='rb') {
if(OC_Filesystem::file_exists($path) and OC_Filesystem::filesize($path)>0) {
//first encrypt the target file so we don't end up with a half encrypted file
- OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing', OCP\Util::DEBUG);
+ OCP\Util::writeLog('files_encryption', 'Decrypting '.$path.' before writing', OCP\Util::DEBUG);
$tmp=fopen('php://temp');
OCP\Files::streamCopy($result, $tmp);
fclose($result);
if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root;
}
- if(substr($this->root,-1, 1)!='/') {
+ if(substr($this->root, -1, 1)!='/') {
$this->root.='/';
}
if(!$this->share || $this->share[0]!='/') {
}
public function constructUrl($path) {
- if(substr($path,-1)=='/') {
+ if(substr($path, -1)=='/') {
$path=substr($path, 0, -1);
}
return 'smb://'.$this->user.':'.$this->password.'@'.$this->host.$this->share.$this->root.$path;
<p><label for="ldap_cache_ttl">Cache Time-To-Live</label><input type="text" id="ldap_cache_ttl" name="ldap_cache_ttl" value="<?php echo $_['ldap_cache_ttl']; ?>" title="<?php echo $l->t('in seconds. A change empties the cache.');?>" /></p>
<p><label for="home_folder_naming_rule">User Home Folder Naming Rule</label><input type="text" id="home_folder_naming_rule" name="home_folder_naming_rule" value="<?php echo $_['home_folder_naming_rule']; ?>" title="<?php echo $l->t('Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute.');?>" /></p>
</fieldset>
- <input type="submit" value="Save" /> <button id="ldap_action_test_connection" name="ldap_action_test_connection">Test Configuration</button> <a href="http://owncloud.org/support/ldap-backend/" target="_blank"><img src="<?php echo OCP\Util::imagePath('','actions/info.png'); ?>" style="height:1.75ex" /> <?php echo $l->t('Help');?></a>
+ <input type="submit" value="Save" /> <button id="ldap_action_test_connection" name="ldap_action_test_connection">Test Configuration</button> <a href="http://owncloud.org/support/ldap-backend/" target="_blank"><img src="<?php echo OCP\Util::imagePath('', 'actions/info.png'); ?>" style="height:1.75ex" /> <?php echo $l->t('Help');?></a>
</div>
</form>
$definition['unique'] = true;
$count = count($column_names);
for ($i=0; $i<$count; ++$i) {
- $column_name = strtok($column_names[$i]," ");
+ $column_name = strtok($column_names[$i], " ");
$collation = strtok(" ");
$definition['fields'][$column_name] = array(
'position' => $i+1
if(in_array($user, $this->userQuota)) {
return $this->userQuota[$user];
}
- $userQuota=OC_Preferences::getValue($user,'files','quota', 'default');
+ $userQuota=OC_Preferences::getValue($user, 'files', 'quota', 'default');
if($userQuota=='default') {
- $userQuota=OC_AppConfig::getValue('files','default_quota', 'none');
+ $userQuota=OC_AppConfig::getValue('files', 'default_quota', 'none');
}
if($userQuota=='none') {
$this->userQuota[$user]=0;
protected $datadir;
public function __construct($arguments) {
$this->datadir=$arguments['datadir'];
- if(substr($this->datadir,-1)!=='/') {
+ if(substr($this->datadir, -1)!=='/') {
$this->datadir.='/';
}
}
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;
}
}\r
\r
$mtime=filemtime(OC::$SERVERROOT.'/config/mount.php');\r
- $previousMTime=OC_Appconfig::getValue('files','mountconfigmtime', 0);\r
+ $previousMTime=OC_Appconfig::getValue('files', 'mountconfigmtime', 0);\r
if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated\r
OC_FileCache::triggerUpdate();\r
OC_Appconfig::setValue('files', 'mountconfigmtime', $mtime);\r
return false;
}
}else{
- OC_Log::write('core','storage backend '.$class.' not found', OC_Log::ERROR);
+ OC_Log::write('core', 'storage backend '.$class.' not found', OC_Log::ERROR);
return false;
}
}
*/
public static function installApp( $data = array()) {
if(!isset($data['source'])) {
- OC_Log::write('core','No source specified when installing app', OC_Log::ERROR);
+ OC_Log::write('core', 'No source specified when installing app', OC_Log::ERROR);
return false;
}
if($data['source']=='http') {
$path=OC_Helper::tmpFile();
if(!isset($data['href'])) {
- OC_Log::write('core','No href specified when installing app from http', OC_Log::ERROR);
+ OC_Log::write('core', 'No href specified when installing app from http', OC_Log::ERROR);
return false;
}
copy($data['href'], $path);
}else{
if(!isset($data['path'])) {
- OC_Log::write('core','No path specified when installing app from local file', OC_Log::ERROR);
+ OC_Log::write('core', 'No path specified when installing app from local file', OC_Log::ERROR);
return false;
}
$path=$data['path'];
rename($path, $path.'.tgz');
$path.='.tgz';
}else{
- OC_Log::write('core','Archives of type '.$mime.' are not supported', OC_Log::ERROR);
+ OC_Log::write('core', 'Archives of type '.$mime.' are not supported', OC_Log::ERROR);
return false;
}
if( file_exists( $db ) ) {
// Connect to the db
if(!self::connectDB( $db )) {
- OC_Log::write('migration','Failed to connect to migration.db', OC_Log::ERROR);
+ OC_Log::write('migration', 'Failed to connect to migration.db', OC_Log::ERROR);
return false;
}
} else {
}
closedir($dirhandle);
} else {
- OC_Log::write('admin_export',"Was not able to open directory: " . $dir, OC_Log::ERROR);
+ OC_Log::write('admin_export', "Was not able to open directory: " . $dir, OC_Log::ERROR);
return false;
}
return true;
$xml=OC_OCSClient::getOCSresponse($url);
if($xml==false) {
- OC_Log::write('core','Unable to parse OCS content', OC_Log::FATAL);
+ OC_Log::write('core', 'Unable to parse OCS content', OC_Log::FATAL);
return null;
}
$data=simplexml_load_string($xml);
$xml=OC_OCSClient::getOCSresponse($url);
if($xml==false) {
- OC_Log::write('core','Unable to parse OCS content', OC_Log::FATAL);
+ OC_Log::write('core', 'Unable to parse OCS content', OC_Log::FATAL);
return null;
}
$data=simplexml_load_string($xml);
$xml=OC_OCSClient::getOCSresponse($url);
if($xml==false) {
- OC_Log::write('core','Unable to parse knowledgebase content', OC_Log::FATAL);
+ OC_Log::write('core', 'Unable to parse knowledgebase content', OC_Log::FATAL);
return null;
}
$data=simplexml_load_string($xml);
$mode='tablet';
}elseif(stripos($_SERVER['HTTP_USER_AGENT'], 'iphone')>0) {
$mode='mobile';
- }elseif((stripos($_SERVER['HTTP_USER_AGENT'],'N9')>0) and (stripos($_SERVER['HTTP_USER_AGENT'], 'nokia')>0)) {
+ }elseif((stripos($_SERVER['HTTP_USER_AGENT'], 'N9')>0) and (stripos($_SERVER['HTTP_USER_AGENT'], 'nokia')>0)) {
$mode='mobile';
}else{
$mode='default';
self::useBackend($backend);
$_setupedBackends[]=$i;
}else{
- OC_Log::write('core','User backend '.$class.' not found.', OC_Log::ERROR);
+ OC_Log::write('core', 'User backend '.$class.' not found.', OC_Log::ERROR);
}
}
}
$groups[] = array( "name" => $i );
}
$quotaPreset=OC_Appconfig::getValue('files', 'quota_preset', 'default,none,1 GB, 5 GB, 10 GB');
-$quotaPreset=explode(',',$quotaPreset);
+$quotaPreset=explode(',', $quotaPreset);
foreach($quotaPreset as &$preset) {
$preset=trim($preset);
}