Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
544 views
in Q2A Core by
edited by

Hi, 

i find a little problem on the Top menu. When i go to the

admin => Pages, i desactivate the users (navigation links). than is already hide and we can not acces to see the user on the Top Menu.. 

But if i go to the navigator Firefox, Chrome and i add this " ?qa=users " after the link, everyone with a account can see the user. 

Ex: localhost/Q&A/?qa=users (user menu is desactivate but can see if you are connected)

an idea ? 

Thank you very much all

by
Check my edited answer may helps you...

1 Answer

+2 votes
by
edited by

This is default Q2A behavior, which should not be. The url should only be available if menu item.

Hopping fix in next releases.

Edit:

I quickly done core hack.. in file qa-include/qa-page-users.php 

Find on line #50

$qa_content=qa_content_prepare();

Below that place this code

if(!array_key_exists('user', $qa_content['navigation']['main'])){
    
    header('HTTP/1.0 404 Not Found');

    qa_set_template('not-found');

    $qa_content=qa_content_prepare();
    $qa_content['error']=qa_lang_html('main/page_not_found');
    $qa_content['suggest_next']=qa_html_suggest_qs_tags(qa_using_tags());       
    
    return $qa_content;
}

Added code on Gist https://gist.github.com/q2amarket/8406457

by
HI jatin,

Thank you again for you help. Just a little question more.

If i want to give some privileges on the Navigation menu, do you think is possible ?

Ex: i activate the users link on the Top-Menu, and this link can be access only for administrator or modearator.

Actually i use a plugin "permission2categories", but the privileges is available only for the page, not for the navigation link.

Thank you
Claude
by
I need to try but my logic is saying you can use unset. Will try later today or tomorrow.
by
Hi jatin,

for my last question, it's little confuse maybe about the permission.

I already use your code, works perfect. Now to explain more precise about this code,

i would like If i go to admin and activate the user link on the main menu, give an access only for the admin and moderator.

What do you think ?  

Thank you
by
Okay but I think I found another way to do without touching core files. But busy at the moment so if you are in hurry you can go on with this code later I will share the code once get time.. Regarding to your query.. you can check anything you want to check before redirecting users.. after all it's your choice :))
...