aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2014-05-31 17:50:39 +0200
committerGeorg Ehrke <developer@georgehrke.com>2014-05-31 17:50:39 +0200
commit020255b4e545413fd724fbd397662f6c4265caa3 (patch)
treeb2b552307d14c571f2e800760c892e1ea3d17c53 /lib
parentc8636ca4d9528faf42b1cd877bb73e56d26244cf (diff)
downloadnextcloud-server-020255b4e545413fd724fbd397662f6c4265caa3.tar.gz
nextcloud-server-020255b4e545413fd724fbd397662f6c4265caa3.zip
add button for properly uninstalling apps
Diffstat (limited to 'lib')
-rw-r--r--lib/private/app.php10
-rw-r--r--lib/private/installer.php18
2 files changed, 17 insertions, 11 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index fe1fa6a0d1a..0e2c023a9de 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -248,11 +248,6 @@ class OC_App{
return false;
}
- $disable = self::disable($app);
- if (!$disable) {
- return false;
- }
-
return OC_Installer::removeApp($app);
}
@@ -784,10 +779,12 @@ class OC_App{
$info['internal']=true;
$info['internallabel']='Internal App';
$info['internalclass']='';
+ $info['removable'] = false;
} else {
$info['internal']=false;
$info['internallabel']='3rd Party';
$info['internalclass']='externalapp';
+ $info['removable'] = true;
}
$info['update'] = OC_Installer::isUpdateAvailable($app);
@@ -797,7 +794,7 @@ class OC_App{
$appList[] = $info;
}
}
- $remoteApps = OC_App::getAppstoreApps();
+ $remoteApps = self::getAppstoreApps();
if ( $remoteApps ) {
// Remove duplicates
foreach ( $appList as $app ) {
@@ -876,6 +873,7 @@ class OC_App{
$app1[$i]['ocs_id'] = $app['id'];
$app1[$i]['internal'] = $app1[$i]['active'] = 0;
$app1[$i]['update'] = false;
+ $app1[$i]['removable'] = false;
if($app['label']=='recommended') {
$app1[$i]['internallabel'] = 'Recommended';
$app1[$i]['internalclass'] = 'recommendedapp';
diff --git a/lib/private/installer.php b/lib/private/installer.php
index 6940a1dc78d..c82e19b7351 100644
--- a/lib/private/installer.php
+++ b/lib/private/installer.php
@@ -366,19 +366,25 @@ class OC_Installer{
* The function will check if the app is already downloaded in the apps repository
*/
public static function isDownloaded( $name ) {
-
- $downloaded=false;
foreach(OC::$APPSROOTS as $dir) {
- if(is_dir($dir['path'].'/'.$name)) $downloaded=true;
+ $dirToTest = $dir['path'];
+ $dirToTest .= '/';
+ $dirToTest .= $name;
+ $dirToTest .= '/';
+
+ if (is_dir($dirToTest)) {
+ return true;
+ }
}
- return($downloaded);
+
+ return false;
}
/**
* Removes an app
* @param string $name name of the application to remove
* @param array $options options
- * @return boolean|null
+ * @return boolean
*
* This function removes an app. $options is an associative array. The
* following keys are optional:ja
@@ -420,9 +426,11 @@ class OC_Installer{
$appdir=OC_App::getInstallPath().'/'.$name;
OC_Helper::rmdirr($appdir);
+ return true;
}else{
OC_Log::write('core', 'can\'t remove app '.$name.'. It is not installed.', OC_Log::ERROR);
+ return false;
}
}