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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
5810e7ab
Commit
5810e7ab
authored
10 years ago
by
Lukas Reschke
Browse files
Options
Downloads
Plain Diff
Merge pull request #17050 from owncloud/request-status-from-ocs
Request approved state for disabled apps with ocsid
parents
aa595392
30145c0b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/private/ocsclient.php
+1
-0
1 addition, 0 deletions
lib/private/ocsclient.php
settings/controller/appsettingscontroller.php
+18
-0
18 additions, 0 deletions
settings/controller/appsettingscontroller.php
tests/lib/ocsclienttest.php
+2
-0
2 additions, 0 deletions
tests/lib/ocsclienttest.php
with
21 additions
and
0 deletions
lib/private/ocsclient.php
+
1
−
0
View file @
5810e7ab
...
...
@@ -284,6 +284,7 @@ class OCSClient {
$app
[
'description'
]
=
(
string
)
$tmp
->
description
;
$app
[
'detailpage'
]
=
(
string
)
$tmp
->
detailpage
;
$app
[
'score'
]
=
(
int
)
$tmp
->
score
;
$app
[
'level'
]
=
(
int
)
$tmp
->
approved
;
return
$app
;
}
...
...
This diff is collapsed.
Click to expand it.
settings/controller/appsettingscontroller.php
+
18
−
0
View file @
5810e7ab
...
...
@@ -169,6 +169,15 @@ class AppSettingsController extends Controller {
}
return
(
$a
<
$b
)
?
-
1
:
1
;
});
foreach
(
$apps
as
$key
=>
$app
)
{
if
(
!
array_key_exists
(
'level'
,
$app
)
&&
array_key_exists
(
'ocsid'
,
$app
))
{
$remoteAppEntry
=
$this
->
ocsClient
->
getApplication
(
$app
[
'ocsid'
]);
if
(
array_key_exists
(
'level'
,
$remoteAppEntry
))
{
$apps
[
$key
][
'level'
]
=
$remoteAppEntry
[
'level'
];
}
}
}
break
;
// not-installed apps
case
1
:
...
...
@@ -176,6 +185,15 @@ class AppSettingsController extends Controller {
$apps
=
array_filter
(
$apps
,
function
(
$app
)
{
return
!
$app
[
'active'
];
});
foreach
(
$apps
as
$key
=>
$app
)
{
if
(
!
array_key_exists
(
'level'
,
$app
)
&&
array_key_exists
(
'ocsid'
,
$app
))
{
$remoteAppEntry
=
$this
->
ocsClient
->
getApplication
(
$app
[
'ocsid'
]);
if
(
array_key_exists
(
'level'
,
$remoteAppEntry
))
{
$apps
[
$key
][
'level'
]
=
$remoteAppEntry
[
'level'
];
}
}
}
usort
(
$apps
,
function
(
$a
,
$b
)
{
$a
=
(
string
)
$a
[
'name'
];
$b
=
(
string
)
$b
[
'name'
];
...
...
This diff is collapsed.
Click to expand it.
tests/lib/ocsclienttest.php
+
2
−
0
View file @
5810e7ab
...
...
@@ -732,6 +732,7 @@ class OCSClientTest extends \Test\TestCase {
<downloadpackagename1></downloadpackagename1>
<downloadrepository1></downloadrepository1>
<downloadsize1>1</downloadsize1>
<approved>200</approved>
</content>
</data>
</ocs>
...
...
@@ -770,6 +771,7 @@ class OCSClientTest extends \Test\TestCase {
'changed'
=>
1404743680
,
'description'
=>
'Placeholder for future updates'
,
'score'
=>
50
,
'level'
=>
200
,
];
$this
->
assertSame
(
$expected
,
$this
->
ocsClient
->
getApplication
(
'MyId'
));
}
...
...
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