User tests: Successful: Unsuccessful:
While user is not authorized the com_user router builds the incorrect URL for user profile because JMenu::getItems() returns items available for only public access level.
$app = JFactory::getApplication();
$router = $app->getRouter();
$segments = $router->build('index.php?option=com_users&view=profile');
print_r($segments);
$vars = $router->parse($segments);
print_r($vars);
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Title |
|
Category | ⇒ | ACL Router / SEF |
This code changes only the profile URL and haven't other unwanted impacts.
Since the lack of clear test instructions i just made the dump suggested in protostar index.php before and after patch.
The results are:
Before patch
JUri Object
(
[uri:protected] => index.php?option=com_users&view=profile
[scheme:protected] =>
[host:protected] =>
[port:protected] =>
[user:protected] =>
[pass:protected] =>
[path:protected] => /index.php/en/component/users/profile
[query:protected] =>
[fragment:protected] =>
[vars:protected] => Array
(
[Itemid] =>
)
)
Array
(
[option] => com_users
[view] => profile
[Itemid] =>
[lang] => en-GB
)
After patch
JUri Object
(
[uri:protected] => index.php?option=com_users&view=profile
[scheme:protected] =>
[host:protected] =>
[port:protected] =>
[user:protected] =>
[pass:protected] =>
[path:protected] => /index.php/en/component/users/
[query:protected] =>
[fragment:protected] =>
[vars:protected] => Array
(
[view] => profile
[Itemid] =>
)
)
Array
(
[option] => com_content
[view] => featured
[Itemid] =>
[lang] => en-GB
)
I have also applied this PR and got below result.
Before PR output:
JUri Object
(
[uri:protected] => index.php?option=com_users&view=profile
[scheme:protected] =>
[host:protected] =>
[port:protected] =>
[user:protected] =>
[pass:protected] =>
[path:protected] => /joomlacmsstaging/index.php/component/users/profile
[query:protected] =>
[fragment:protected] =>
[vars:protected] => Array
(
[Itemid] =>
)
)
Array
(
[option] => com_users
[view] => profile
[id] => 1
[Itemid] =>
)
After PR output:
JUri Object
(
[uri:protected] => index.php?option=com_users&view=profile
[scheme:protected] =>
[host:protected] =>
[port:protected] =>
[user:protected] =>
[pass:protected] =>
[path:protected] => /joomlacmsstaging/index.php/your-profile
[query:protected] =>
[fragment:protected] =>
[vars:protected] => Array
(
)
)
Array
(
[option] => com_users
[view] => profile
[id] => 1
[Itemid] => 102
[layout] => edit
)
Is it correct output as the PR? Let me know So I can give test vote for this PR.
This lacks clear instructions.
Please explain in details what to do and what we get before and after patch.
Also it is anyway conflicting with present staging.
@alexva24 Any updates? Please provide Before and After patch code. so we can test it properly.
Any update?
Closing PR as abandoned due to lack of response from the submitter.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-21 22:07:12 |
Closed_By | ⇒ | mbabker |
Category | ACL Router / SEF | ⇒ | Front End com_users ACL Router / SEF |
I'm not very well familiarized with this part of the code.
Need more clear test instructions to understand if this will have other impacts.