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
1c865f70
Commit
1c865f70
authored
12 years ago
by
Lukas Reschke
Committed by
Daniel Molkentin
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Change verifyUser so that external json files can call it
parent
842d6dad
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/json.php
+6
-4
6 additions, 4 deletions
lib/json.php
with
6 additions
and
4 deletions
lib/json.php
+
6
−
4
View file @
1c865f70
...
...
@@ -58,7 +58,8 @@ class OC_JSON{
*/
public
static
function
checkAdminUser
()
{
self
::
checkLoggedIn
();
if
(
!
OC_Group
::
inGroup
(
OC_User
::
getUser
(),
'admin'
)
||
self
::
verifyUser
()
===
false
)
{
self
::
verifyUser
();
if
(
!
OC_Group
::
inGroup
(
OC_User
::
getUser
(),
'admin'
))
{
$l
=
OC_L10N
::
get
(
'lib'
);
self
::
error
(
array
(
'data'
=>
array
(
'message'
=>
$l
->
t
(
'Authentication error'
)
)));
exit
();
...
...
@@ -70,7 +71,8 @@ class OC_JSON{
*/
public
static
function
checkSubAdminUser
()
{
self
::
checkLoggedIn
();
if
(
!
OC_Group
::
inGroup
(
OC_User
::
getUser
(),
'admin'
)
&&
!
OC_SubAdmin
::
isSubAdmin
(
OC_User
::
getUser
())
||
self
::
verifyUser
()
===
false
)
{
self
::
verifyUser
();
if
(
!
OC_Group
::
inGroup
(
OC_User
::
getUser
(),
'admin'
)
&&
!
OC_SubAdmin
::
isSubAdmin
(
OC_User
::
getUser
()))
{
$l
=
OC_L10N
::
get
(
'lib'
);
self
::
error
(
array
(
'data'
=>
array
(
'message'
=>
$l
->
t
(
'Authentication error'
)
)));
exit
();
...
...
@@ -84,9 +86,9 @@ class OC_JSON{
public
static
function
verifyUser
()
{
// Check if the user verified his password in the last 15 minutes
if
(
$_SESSION
[
'verifiedLogin'
]
<
time
()
OR
!
isset
(
$_SESSION
[
'verifiedLogin'
]))
{
return
false
;
self
::
error
(
array
(
'data'
=>
array
(
'message'
=>
$l
->
t
(
'Authentication error'
)
)));
exit
();
}
return
true
;
}
/**
...
...
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