Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PluginMarket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Stud.IP
Plugins
PluginMarket
Merge requests
!61
#20
let multiple plugin usages be reported
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
#20
let multiple plugin usages be reported
github/fork/derfl0/master
into
master
Overview
1
Commits
1
Pipelines
0
Changes
3
Merged
Moritz Strohm
requested to merge
github/fork/derfl0/master
into
master
9 years ago
Overview
1
Commits
1
Pipelines
0
Changes
3
Created by: derfl0
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
8622d6a7
1 commit,
1 year ago
3 files
+
50
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
controllers/update.php
+
20
−
0
View file @ 8622d6a7
Edit in single-file editor
Open in Web IDE
Show full file
@@ -27,6 +27,26 @@ class UpdateController extends MarketController
@@ -27,6 +27,26 @@ class UpdateController extends MarketController
$this
->
render_text
(
"Insecure request."
);
$this
->
render_text
(
"Insecure request."
);
}
}
}
}
public
function
usage_action
()
{
$this
->
plugins
=
MarketPlugin
::
findManyByName
(
Request
::
getArray
(
'plugins'
));
$this
->
mostlikely
=
MarketPluginUsage
::
findOneBySQL
(
'user_id = ? GROUP BY name ORDER BY count(*) DESC'
,
array
(
User
::
findCurrent
()
->
id
))
->
name
;
}
public
function
save_usage_action
()
{
// delete old usage
MarketPluginUsage
::
deleteBySQL
(
'user_id = ? AND name = ?'
,
array
(
User
::
findCurrent
()
->
id
,
Request
::
get
(
'tag'
)));
// create new usages
foreach
(
Request
::
getArray
(
'plugins'
)
as
$pluginid
)
{
MarketPluginUsage
::
create
(
array
(
'plugin_id'
=>
$pluginid
,
'user_id'
=>
User
::
findCurrent
()
->
id
,
'name'
=>
Request
::
get
(
'tag'
)
));
$this
->
done
++
;
}
}
protected
function
verify_secret
(
$secret
)
protected
function
verify_secret
(
$secret
)
{
{
Loading