possible fix for bombarding the server with the htaccess test during setup
This commit is contained in:
parent
c6177d2629
commit
46e9bf5678
37
lib/util.php
37
lib/util.php
|
@ -64,23 +64,23 @@ class OC_Util {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function loadUserMountPoints($user) {
|
public static function loadUserMountPoints($user) {
|
||||||
$user_dir = '/'.$user.'/files';
|
$user_dir = '/'.$user.'/files';
|
||||||
$user_root = OC_User::getHome($user);
|
$user_root = OC_User::getHome($user);
|
||||||
$userdirectory = $user_root . '/files';
|
$userdirectory = $user_root . '/files';
|
||||||
if (is_file($user_root.'/mount.php')) {
|
if (is_file($user_root.'/mount.php')) {
|
||||||
$mountConfig = include($user_root.'/mount.php');
|
$mountConfig = include($user_root.'/mount.php');
|
||||||
if (isset($mountConfig['user'][$user])) {
|
if (isset($mountConfig['user'][$user])) {
|
||||||
foreach ($mountConfig['user'][$user] as $mountPoint => $options) {
|
foreach ($mountConfig['user'][$user] as $mountPoint => $options) {
|
||||||
OC_Filesystem::mount($options['class'], $options['options'], $mountPoint);
|
OC_Filesystem::mount($options['class'], $options['options'], $mountPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mtime=filemtime($user_root.'/mount.php');
|
$mtime=filemtime($user_root.'/mount.php');
|
||||||
$previousMTime=OC_Preferences::getValue($user,'files','mountconfigmtime',0);
|
$previousMTime=OC_Preferences::getValue($user,'files','mountconfigmtime',0);
|
||||||
if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated
|
if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated
|
||||||
OC_FileCache::triggerUpdate($user);
|
OC_FileCache::triggerUpdate($user);
|
||||||
OC_Preferences::setValue($user,'files','mountconfigmtime',$mtime);
|
OC_Preferences::setValue($user,'files','mountconfigmtime',$mtime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,6 +544,11 @@ class OC_Util {
|
||||||
|
|
||||||
// creating a test file
|
// creating a test file
|
||||||
$testfile = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ).'/'.$filename;
|
$testfile = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ).'/'.$filename;
|
||||||
|
|
||||||
|
if(file_exists($testfile)){// already running this test, possible recursive call
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$fp = @fopen($testfile, 'w');
|
$fp = @fopen($testfile, 'w');
|
||||||
@fwrite($fp, $testcontent);
|
@fwrite($fp, $testcontent);
|
||||||
@fclose($fp);
|
@fclose($fp);
|
||||||
|
|
Loading…
Reference in New Issue