Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
d7f60a74
Commit
d7f60a74
authored
May 07, 2015
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify logic in qa_permit_value_error
parent
6186bc44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
42 deletions
+30
-42
users.php
qa-include/app/users.php
+30
-42
No files found.
qa-include/app/users.php
View file @
d7f60a74
...
...
@@ -872,54 +872,42 @@
elseif
(
!
isset
(
$userid
))
{
return
'login'
;
}
// $userid is set from here on
elseif
(
$permit
>=
QA_PERMIT_USERS
)
$error
=
isset
(
$userid
)
?
false
:
'login'
;
$error
=
false
;
elseif
(
$permit
>=
QA_PERMIT_CONFIRMED
)
{
if
(
isset
(
$userid
))
{
if
(
QA_FINAL_EXTERNAL_USERS
||
// not currently supported by single sign-on integration
(
$userlevel
>=
QA_PERMIT_APPROVED
)
||
// if user approved or assigned to a higher level, no need
(
$userflags
&
QA_USER_FLAGS_EMAIL_CONFIRMED
)
||
// actual confirmation
(
!
qa_opt
(
'confirm_user_emails'
))
// if this option off, we can't ask it of the user
)
$error
=
false
;
else
$error
=
'confirm'
;
}
else
$error
=
'login'
;
}
elseif
(
$permit
>=
QA_PERMIT_APPROVED
)
{
if
(
isset
(
$userid
))
{
if
(
(
$userlevel
>=
QA_USER_LEVEL_APPROVED
)
||
// user has been approved
(
!
qa_opt
(
'moderate_users'
))
// if this option off, we can't ask it of the user
)
$error
=
false
;
else
$error
=
'approve'
;
}
else
$error
=
'login'
;
}
else
{
if
(
isset
(
$userid
))
{
if
(
$permit
>=
QA_PERMIT_EXPERTS
)
$error
=
$userlevel
>=
QA_USER_LEVEL_EXPERT
?
false
:
'level'
;
elseif
(
$permit
>=
QA_PERMIT_EDITORS
)
$error
=
$userlevel
>=
QA_USER_LEVEL_EDITOR
?
false
:
'level'
;
elseif
(
$permit
>=
QA_PERMIT_MODERATORS
)
$error
=
$userlevel
>=
QA_USER_LEVEL_MODERATOR
?
false
:
'level'
;
if
(
QA_FINAL_EXTERNAL_USERS
||
// not currently supported by single sign-on integration
(
$userlevel
>=
QA_PERMIT_APPROVED
)
||
// if user approved or assigned to a higher level, no need
(
$userflags
&
QA_USER_FLAGS_EMAIL_CONFIRMED
)
||
// actual confirmation
(
!
qa_opt
(
'confirm_user_emails'
))
// if this option off, we can't ask it of the user
)
$error
=
false
;
else
$error
=
'confirm'
;
}
elseif
(
$permit
>=
QA_PERMIT_ADMINS
)
$error
=
$userlevel
>=
QA_USER_LEVEL_ADMIN
?
false
:
'level'
;
elseif
(
$permit
>=
QA_PERMIT_APPROVED
)
{
if
(
(
$userlevel
>=
QA_USER_LEVEL_APPROVED
)
||
// user has been approved
(
!
qa_opt
(
'moderate_users'
))
// if this option off, we can't ask it of the user
)
$error
=
false
;
else
$error
=
'approve'
;
}
else
$error
=
$userlevel
>=
QA_USER_LEVEL_SUPER
?
false
:
'level'
;
}
else
$error
=
'level'
;
else
{
$hasLevel
=
(
$permit
>=
QA_PERMIT_EXPERTS
&&
$userlevel
>=
QA_USER_LEVEL_EXPERT
)
||
(
$permit
>=
QA_PERMIT_EDITORS
&&
$userlevel
>=
QA_USER_LEVEL_EDITOR
)
||
(
$permit
>=
QA_PERMIT_MODERATORS
&&
$userlevel
>=
QA_USER_LEVEL_MODERATOR
)
||
(
$permit
>=
QA_PERMIT_ADMINS
&&
$userlevel
>=
QA_USER_LEVEL_ADMIN
)
||
$userlevel
>=
QA_USER_LEVEL_SUPER
;
$error
=
$hasLevel
?
false
:
'level'
;
}
if
(
isset
(
$userid
)
&&
(
$userflags
&
QA_USER_FLAGS_USER_BLOCKED
)
&&
(
$error
!=
'level'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment