Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
c378e764
Commit
c378e764
authored
10 years ago
by
Georg Ehrke
Browse files
Options
Downloads
Patches
Plain Diff
skip certain tests for shipped apps
parent
0890ce4f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/installer.php
+10
-6
10 additions, 6 deletions
lib/private/installer.php
settings/ajax/updateapp.php
+4
-1
4 additions, 1 deletion
settings/ajax/updateapp.php
with
14 additions
and
7 deletions
lib/private/installer.php
+
10
−
6
View file @
c378e764
...
...
@@ -140,6 +140,8 @@ class OC_Installer{
/**
* @brief Update an application
* @param array $info
* @param bool $isShipped
*
* This function installs an app. All information needed are passed in the
* associative array $data.
...
...
@@ -164,9 +166,9 @@ class OC_Installer{
* upgrade.php can determine the current installed version of the app using
* "OC_Appconfig::getValue($appid, 'installed_version')"
*/
public
static
function
updateApp
(
$info
=
array
()
)
{
public
static
function
updateApp
(
$info
=
array
()
,
$isShipped
=
false
)
{
list
(
$extractDir
,
$path
)
=
self
::
downloadApp
(
$info
);
$info
=
self
::
checkAppsIntegrity
(
$info
,
$extractDir
,
$path
);
$info
=
self
::
checkAppsIntegrity
(
$info
,
$extractDir
,
$path
,
$isShipped
);
$currentDir
=
OC_App
::
getAppPath
(
$info
[
'id'
]);
$basedir
=
OC_App
::
getInstallPath
();
...
...
@@ -195,10 +197,11 @@ class OC_Installer{
/**
* update an app by it's id
* @param integer $ocsid
* @param bool $isShipped
* @return bool
* @throws Exception
*/
public
static
function
updateAppByOCSId
(
$ocsid
)
{
public
static
function
updateAppByOCSId
(
$ocsid
,
$isShipped
=
false
)
{
$appdata
=
OC_OCSClient
::
getApplication
(
$ocsid
);
$download
=
OC_OCSClient
::
getApplicationDownload
(
$ocsid
,
1
);
...
...
@@ -278,10 +281,11 @@ class OC_Installer{
* check an app's integrity
* @param array $data
* @param string $extractDir
* @param bool $isShipped
* @return array
* @throws \Exception
*/
public
static
function
checkAppsIntegrity
(
$data
=
array
(),
$extractDir
,
$path
)
{
public
static
function
checkAppsIntegrity
(
$data
=
array
(),
$extractDir
,
$path
,
$isShipped
=
false
)
{
$l
=
\OC_L10N
::
get
(
'lib'
);
//load the info.xml file of the app
if
(
!
is_file
(
$extractDir
.
'/appinfo/info.xml'
))
{
...
...
@@ -306,7 +310,7 @@ class OC_Installer{
}
$info
=
OC_App
::
getAppInfo
(
$extractDir
.
'/appinfo/info.xml'
,
true
);
// check the code for not allowed calls
if
(
!
OC_Installer
::
checkCode
(
$info
[
'id'
],
$extractDir
))
{
if
(
!
$isShipped
&&
!
OC_Installer
::
checkCode
(
$info
[
'id'
],
$extractDir
))
{
OC_Helper
::
rmdirr
(
$extractDir
);
throw
new
\Exception
(
$l
->
t
(
"App can't be installed because of not allowed code in the App"
));
}
...
...
@@ -318,7 +322,7 @@ class OC_Installer{
}
// check if shipped tag is set which is only allowed for apps that are shipped with ownCloud
if
(
isset
(
$info
[
'shipped'
])
and
(
$info
[
'shipped'
]
==
'true'
))
{
if
(
!
$isShipped
&&
isset
(
$info
[
'shipped'
])
&&
(
$info
[
'shipped'
]
==
'true'
))
{
OC_Helper
::
rmdirr
(
$extractDir
);
throw
new
\Exception
(
$l
->
t
(
"App can't be installed because it contains the <shipped>true</shipped> tag which is not allowed for non shipped apps"
));
}
...
...
This diff is collapsed.
Click to expand it.
settings/ajax/updateapp.php
+
4
−
1
View file @
c378e764
...
...
@@ -19,6 +19,7 @@ $appId = $_POST['appid'];
if
(
!
is_numeric
(
$appId
))
{
$appId
=
OC_Appconfig
::
getValue
(
$appId
,
'ocsid'
,
null
);
$isShipped
=
OC_App
::
isShipped
(
$appId
);
if
(
$appId
===
null
)
{
OCP\JSON
::
error
(
array
(
...
...
@@ -26,11 +27,13 @@ if (!is_numeric($appId)) {
));
exit
;
}
}
else
{
$isShipped
=
false
;
}
$appId
=
OC_App
::
cleanAppId
(
$appId
);
$result
=
OC_Installer
::
updateAppByOCSId
(
$appId
);
$result
=
OC_Installer
::
updateAppByOCSId
(
$appId
,
$isShipped
);
if
(
$result
!==
false
)
{
OC_JSON
::
success
(
array
(
'data'
=>
array
(
'appid'
=>
$appId
)));
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment