diff --git a/lib/installer.php b/lib/installer.php index 02b71027cd..91b7ea7da6 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -108,7 +108,7 @@ class OC_INSTALLER{ $basedir=$SERVERROOT.'/apps/'.$info['id']; //check if an app with the same id is already installed - if(self::isInstalled( $info['id'] ))){ + if(self::isInstalled( $info['id'] )){ error_log("App already installed"); OC_HELPER::rmdirr($extractDir); if($data['source']=='http'){ @@ -118,14 +118,14 @@ class OC_INSTALLER{ } //check if the destination directory already exists -+ if(is_dir($basedir)){ -+ error_log("App's directory already exists"); -+ OC_HELPER::rmdirr($extractDir); -+ if($data['source']=='http'){ -+ unlink($path); -+ } -+ return false; -+ } + if(is_dir($basedir)){ + error_log("App's directory already exists"); + OC_HELPER::rmdirr($extractDir); + if($data['source']=='http'){ + unlink($path); + } + return false; + } if(isset($data['pretent']) and $data['pretent']==true){ return false; diff --git a/lib/setup.php b/lib/setup.php index 43ead7b96a..0e324b741a 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -1,5 +1,7 @@