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
Apr 11, 2016
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix redirects for guest users, login error, already-defined constant
parent
c59dc181
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()
if
(
$user
)
{
if
(
$user
->
guest
||
$user
->
block
)
{
header
(
'location:'
.
$config_urls
[
'denied'
]);
die
;
return
null
;
}
$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
;
if
(
$access
[
'post'
])
{
$level
=
QA_USER_LEVEL_APPROVED
;}
if
(
$access
[
'edit'
])
{
$level
=
QA_USER_LEVEL_EDITOR
;}
...
...
qa-include/util/qa-joomla-helper.php
View file @
b4aa1e4c
...
...
@@ -48,7 +48,11 @@ class qa_joomla_helper {
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/framework.php'
);
// Instantiate the application.
...
...
@@ -69,7 +73,7 @@ class qa_joomla_helper {
public
function
get_userid
(
$username
)
{
JUserHelper
::
getUserId
(
$username
);
return
JUserHelper
::
getUserId
(
$username
);
}
function
trigger_access_event
(
$user
)
...
...
@@ -142,7 +146,7 @@ class qa_joomla_default_integration
list
(
$user
)
=
$args
;
return
array
(
'view'
=>
!
(
$user
->
guest
||
$user
->
block
)
,
'view'
=>
true
,
'post'
=>
!
(
$user
->
guest
||
$user
->
block
),
'edit'
=>
$user
->
authorise
(
'core.edit'
),
'mod'
=>
$user
->
authorise
(
'core.edit.state'
),
...
...
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