Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2bcfd8e
make it possible to update shipped apps via the appstore
georgehrke May 21, 2014
c8636ca
Merge branch 'master' into update_shipped_apps_from_appstore
georgehrke May 31, 2014
020255b
add button for properly uninstalling apps
georgehrke May 31, 2014
c6dc9ae
Merge branch 'master' into update_shipped_apps_from_appstore
georgehrke May 31, 2014
c8a8c7e
read ocsid from shipped apps on install
georgehrke May 31, 2014
eea501b
various fixes as requested by pr reviewers
georgehrke Jun 2, 2014
19129b3
use isset() instead of array_key_exists()
georgehrke Jun 3, 2014
56a8010
remove console.log in apps.js
georgehrke Jun 4, 2014
2c00ab1
update autoloader
georgehrke Jun 4, 2014
724d027
add unit test
georgehrke Jun 4, 2014
00b7f36
remove not needed unlink in installer test
georgehrke Jun 4, 2014
6aab50f
fix unit tests
DeepDiver1975 Jun 5, 2014
fad3bd7
reenable checkCode()
DeepDiver1975 Jun 5, 2014
0fe8f77
Merge branch 'master' into update_shipped_apps_from_appstore
georgehrke Jun 5, 2014
498aa66
add additional type check
georgehrke Jun 6, 2014
a110973
some additional type checks
georgehrke Jun 6, 2014
1ab9bdc
remove unnecessary @return
georgehrke Jun 10, 2014
5d4f3ba
fix php doc block
georgehrke Jun 10, 2014
6bf0689
always return a bool in OC_App::updateApp
georgehrke Jun 10, 2014
602404c
fix php doc block
georgehrke Jun 10, 2014
5e9fa64
don't show update button when appstore is disabled or no writable dir…
georgehrke Jun 10, 2014
0890ce4
Update preseed-config.php
georgehrke Jun 12, 2014
c378e76
skip certain tests for shipped apps
georgehrke Jun 13, 2014
65028c4
don't skip code check for skipped apps
georgehrke Jun 13, 2014
86f546f
disable code check for shipped apps
georgehrke Jun 16, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
various fixes as requested by pr reviewers
  • Loading branch information
georgehrke committed Jun 2, 2014
commit eea501b847f2a4b6a8b29d4d2ded7ef86a841f42
36 changes: 16 additions & 20 deletions lib/private/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,10 @@ protected static function findAppInDirectories($appId) {
}
}

if (count($possibleApps) === 0) {
if (empty($possibleApps)) {
return false;
} elseif(count($possibleApps) === 1) {
reset($possibleApps);
$dir = current($possibleApps);
$dir = array_shift($possibleApps);
$app_dir[$appId] = $dir;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line, $app_dir is never used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return $dir;
} else {
Expand All @@ -486,7 +485,6 @@ protected static function findAppInDirectories($appId) {
}
}


/**
* Get the directory for the given app.
* If the app is defined in multiple directories, the first one is taken. (false if not found)
Expand All @@ -511,7 +509,6 @@ public static function isAppDirWritable($appid) {
return is_writable($path);
}


/**
* Get the path for the given app on the access
* If the app is defined in multiple directories, the first one is taken. (false if not found)
Expand All @@ -535,7 +532,6 @@ public static function getAppVersion($appid) {
return self::getAppVersionByPath($file);
}


/**
* get app's version based on it's path
* @param string $path
Expand All @@ -544,8 +540,8 @@ public static function getAppVersion($appid) {
public static function getAppVersionByPath($path) {
$versionFile = $path . '/appinfo/version';
$infoFile = $path . '/appinfo/info.xml';
if(is_file($versionFile) && $version = trim(file_get_contents($versionFile))) {
return $version;
if(is_file($versionFile)) {
return trim(file_get_contents($versionFile));
}else{
$appData=self::getAppInfo($infoFile, true);
return isset($appData['version'])? $appData['version'] : '';
Expand Down Expand Up @@ -884,27 +880,27 @@ public static function getAppstoreApps( $filter = 'approved' ) {


// rating img
if ($app['score'] >= 0 && $app['score'] < 5) {
if ($app['score'] < 5) {
$img = OC_Helper::imagePath( "core", "rating/s1.png" );
} elseif ($app['score'] >= 5 && $app['score'] < 15) {
} elseif ($app['score'] < 15) {
$img = OC_Helper::imagePath( "core", "rating/s2.png" );
} elseif($app['score'] >= 15 && $app['score'] < 25) {
} elseif($app['score'] < 25) {
$img = OC_Helper::imagePath( "core", "rating/s3.png" );
} elseif($app['score'] >= 25 && $app['score'] < 35) {
} elseif($app['score'] < 35) {
$img = OC_Helper::imagePath( "core", "rating/s4.png" );
} elseif($app['score'] >= 35 && $app['score'] < 45) {
} elseif($app['score'] < 45) {
$img = OC_Helper::imagePath( "core", "rating/s5.png" );
} elseif($app['score'] >= 45 && $app['score'] < 55) {
} elseif($app['score'] < 55) {
$img = OC_Helper::imagePath( "core", "rating/s6.png" );
} elseif($app['score'] >= 55 && $app['score'] < 65) {
} elseif($app['score'] < 65) {
$img = OC_Helper::imagePath( "core", "rating/s7.png" );
} elseif($app['score'] >= 65 && $app['score'] < 75) {
} elseif($app['score'] < 75) {
$img = OC_Helper::imagePath( "core", "rating/s8.png" );
} elseif($app['score'] >= 75 && $app['score'] < 85) {
} elseif($app['score'] < 85) {
$img = OC_Helper::imagePath( "core", "rating/s9.png" );
} elseif($app['score'] >= 85 && $app['score'] < 95) {
} elseif($app['score'] < 95) {
$img = OC_Helper::imagePath( "core", "rating/s10.png" );
} elseif($app['score'] >= 95 && $app['score'] < 100) {
} elseif($app['score'] < 100) {
$img = OC_Helper::imagePath( "core", "rating/s11.png" );
}

Expand Down Expand Up @@ -1102,7 +1098,7 @@ public static function installApp($app) {
$version=OC_Util::getVersion();
if(!self::isAppCompatible($version, $info)) {
throw new \Exception(
$l->t("App \"%s\" can't be installed because it is not compatible with this version of ownCloud.",
$l->t('App \"%s\" can\'t be installed because it is not compatible with this version of ownCloud.',
array($info['name'])
)
);
Expand Down
4 changes: 2 additions & 2 deletions lib/private/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static function installApp( $data = array()) {
throw new \Exception($l->t("App directory already exists"));
}

if(isset($data['pretent']) and $data['pretent']==true) {
if(!empty($data['pretent'])) {
return false;
}

Expand Down Expand Up @@ -176,7 +176,7 @@ public static function updateApp( $app ) {
'appdata' => $appdata
);
} else {
throw new \Exception('Could fetch app info!');
throw new \Exception('Could not fetch app info!');
}

list($extractDir, $path) = self::downloadApp($info);
Expand Down
4 changes: 2 additions & 2 deletions settings/ajax/disableapp.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
OC_JSON::checkAdminUser();
OCP\JSON::checkAdminUser();
OCP\JSON::callCheck();

if (!array_key_exists('appid', $_POST)) {
Expand All @@ -11,4 +11,4 @@
$appId = OC_App::cleanAppId($appId);

OC_App::disable($appId);
OC_JSON::success();
OC_JSON::success();
3 changes: 1 addition & 2 deletions settings/ajax/installapp.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

OC_JSON::checkAdminUser();
OCP\JSON::checkAdminUser();
OCP\JSON::callCheck();

if (!array_key_exists('appid', $_POST)) {
Expand Down
3 changes: 1 addition & 2 deletions settings/ajax/uninstallapp.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

OC_JSON::checkAdminUser();
OCP\JSON::checkAdminUser();
OCP\JSON::callCheck();

if (!array_key_exists('appid', $_POST)) {
Expand Down