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
b4aa1e4c
Commit
b4aa1e4c
authored
9 years ago
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix redirects for guest users, login error, already-defined constant
parent
c59dc181
dev
…
3113-openbar-authentification
3241-delete-all-the-question
3242-password-removed
3414-no-change-mail
3414-stop-mail-send
main
v1.8.6
v1.8.5
v1.8.4
v1.8.3
v1.8.2
v1.8.1
v1.8.0
v1.8.0-beta2
v1.8.0-beta1
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
external-users-joomla.php
qa-include/util/external-users-joomla.php
+1
-6
qa-joomla-helper.php
qa-include/util/qa-joomla-helper.php
+7
-3
No files found.
qa-include/util/external-users-joomla.php
View file @
b4aa1e4c
...
@@ -51,16 +51,11 @@ function qa_get_logged_in_user()
...
@@ -51,16 +51,11 @@ function qa_get_logged_in_user()
if
(
$user
)
{
if
(
$user
)
{
if
(
$user
->
guest
||
$user
->
block
)
{
if
(
$user
->
guest
||
$user
->
block
)
{
header
(
'location:'
.
$config_urls
[
'denied'
]);
return
null
;
die
;
}
}
$access
=
$jhelper
->
trigger_access_event
(
$user
);
$access
=
$jhelper
->
trigger_access_event
(
$user
);
if
(
!
$access
[
'view'
])
{
//must be in a group that has the view level set at least.
header
(
'location:'
.
$config_urls
[
'denied'
]);
die
;
}
$level
=
QA_USER_LEVEL_BASIC
;
$level
=
QA_USER_LEVEL_BASIC
;
if
(
$access
[
'post'
])
{
$level
=
QA_USER_LEVEL_APPROVED
;}
if
(
$access
[
'post'
])
{
$level
=
QA_USER_LEVEL_APPROVED
;}
if
(
$access
[
'edit'
])
{
$level
=
QA_USER_LEVEL_EDITOR
;}
if
(
$access
[
'edit'
])
{
$level
=
QA_USER_LEVEL_EDITOR
;}
...
...
This diff is collapsed.
Click to expand it.
qa-include/util/qa-joomla-helper.php
View file @
b4aa1e4c
...
@@ -48,7 +48,11 @@ class qa_joomla_helper {
...
@@ -48,7 +48,11 @@ class qa_joomla_helper {
private
function
load_joomla_app
()
private
function
load_joomla_app
()
{
{
define
(
'_JEXEC'
,
1
);
//This will define the _JEXEC constant that will allow us to access the rest of the Joomla framework
// This will define the _JEXEC constant that will allow us to access the rest of the Joomla framework
if
(
!
defined
(
'_JEXEC'
))
{
define
(
'_JEXEC'
,
1
);
}
require_once
(
JPATH_BASE
.
'/includes/defines.php'
);
require_once
(
JPATH_BASE
.
'/includes/defines.php'
);
require_once
(
JPATH_BASE
.
'/includes/framework.php'
);
require_once
(
JPATH_BASE
.
'/includes/framework.php'
);
// Instantiate the application.
// Instantiate the application.
...
@@ -69,7 +73,7 @@ class qa_joomla_helper {
...
@@ -69,7 +73,7 @@ class qa_joomla_helper {
public
function
get_userid
(
$username
)
public
function
get_userid
(
$username
)
{
{
JUserHelper
::
getUserId
(
$username
);
return
JUserHelper
::
getUserId
(
$username
);
}
}
function
trigger_access_event
(
$user
)
function
trigger_access_event
(
$user
)
...
@@ -142,7 +146,7 @@ class qa_joomla_default_integration
...
@@ -142,7 +146,7 @@ class qa_joomla_default_integration
list
(
$user
)
=
$args
;
list
(
$user
)
=
$args
;
return
array
(
return
array
(
'view'
=>
!
(
$user
->
guest
||
$user
->
block
)
,
'view'
=>
true
,
'post'
=>
!
(
$user
->
guest
||
$user
->
block
),
'post'
=>
!
(
$user
->
guest
||
$user
->
block
),
'edit'
=>
$user
->
authorise
(
'core.edit'
),
'edit'
=>
$user
->
authorise
(
'core.edit'
),
'mod'
=>
$user
->
authorise
(
'core.edit.state'
),
'mod'
=>
$user
->
authorise
(
'core.edit.state'
),
...
...
This diff is collapsed.
Click to expand it.
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