Can't do any actions as admin

Please report bugs here!

Moderator: Thorsten

leandrorius
Posts: 12
Joined: Tue Jul 17, 2012 3:24 pm

Can't do any actions as admin

Post by leandrorius »

Hi there!
I'm having some troubles with my clean install of phpmyfaq.
Everthing looks good, but when I log as admin and access the "admin/index.php" and try to do any action, I'm redirected to index page.
For example, when I try to do any changes on the main config page (admin/index.php?action=config), I click on Save Config button and I'm redirected, and the changes are not applied.
The same thing happens when I try to create a new user (admin/?action=user&user_action=add), or when I try to create a new category (admin/?action=addcategory).

Can anybody help, please?

Tks!
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Can't do any actions as admin

Post by Thorsten »

Hi,

which version do you use, do you get any errors?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
leandrorius
Posts: 12
Joined: Tue Jul 17, 2012 3:24 pm

Re: Can't do any actions as admin

Post by leandrorius »

Hi Thorsten!

I've got no error at all, and I'm using the lastest version (2.7.7).
I enabled the Debug mode. When I try to change a config and click on "Save Config" button, I'm redirected to index page and that's what the Debug shows:

Code: Select all

DEBUG INFORMATION:
/var/www/knowledgebase/inc/Init.php:
PMF_Configuration->getAll() in line 106: SELECT config_name, config_value FROM faqconfig
/var/www/knowledgebase/inc/PMF_User/CurrentUser.php:
PMF_User->getUserById() in line 416: SELECT user_id, login, account_status FROM faquser WHERE user_id = 1
/var/www/knowledgebase/inc/PMF_User/CurrentUser.php:
PMF_User->getUserById() in line 416: SELECT pass FROM faquserlogin WHERE login = 'admin'
/var/www/knowledgebase/inc/User.php:
PMF_User_UserData->load() in line 319: SELECT last_modified, display_name, email FROM faquserdata WHERE user_id = 1
/var/www/knowledgebase/inc/PMF_User/CurrentUser.php:
PMF_User_CurrentUser->getSessionInfo() in line 423: SELECT session_id, session_timestamp, ip FROM faquser WHERE user_id = 1
/var/www/knowledgebase/index.php:
PMF_Perm_PermBasic->getAllRightsData() in line 148: SELECT right_id, name, description, for_users, for_groups FROM faqright ORDER BY right_id ASC
/var/www/knowledgebase/inc/PMF_Perm/PermBasic.php:
PMF_Perm_PermBasic->getUserRights() in line 268: SELECT fr.right_id AS right_id FROM faqright fr, faquser_right fur, faquser fu WHERE fr.right_id = fur.right_id AND fu.user_id = 1 AND fu.user_id = fur.user_id
/var/www/knowledgebase/index.php:
PMF_Session->checkSessionId() in line 223: SELECT sid FROM faqsessions WHERE sid = 6 AND ip = '==ommited==' AND time > 1342533703
/var/www/knowledgebase/index.php:
PMF_Session->checkSessionId() in line 223: UPDATE faqsessions SET time = 1342620103, user_id = 1 WHERE sid = 6 AND ip = '==ommited=='
/var/www/knowledgebase/inc/Category.php:
PMF_Category->getOrderedCategories() in line 160: SELECT fc.id AS id, fc.lang AS lang, fc.parent_id AS parent_id, fc.name AS name, fc.description AS description, fc.user_id AS user_id FROM faqcategories fc LEFT JOIN faqcategory_group fg ON fc.id = fg.category_id LEFT JOIN faqcategory_user fu ON fc.id = fu.category_id WHERE ( fg.group_id IN (-1) OR (fu.user_id = 1 AND fg.group_id IN (-1))) AND fc.lang = 'pt-br' GROUP BY fc.id, fc.lang, fc.parent_id, fc.name, fc.description, fc.user_id ORDER BY fc.id
/var/www/knowledgebase/index.php:
PMF_Tags->existTagRelations() in line 390: SELECT COUNT(record_id) AS n FROM faqdata_tags
/var/www/knowledgebase/index.php:
PMF_Session->getUsersOnline() in line 424: SELECT count(sid) AS anonymous_users FROM faqsessions WHERE user_id = -1 AND time > 1342619803
/var/www/knowledgebase/index.php:
PMF_Session->getUsersOnline() in line 424: SELECT count(session_id) AS registered_users FROM faquser WHERE session_timestamp > 1342619803
/var/www/knowledgebase/inc/Faq.php:
PMF_Faq->getStickyRecordsData() in line 2979: SELECT fd.id AS id, fd.lang AS lang, fd.thema AS thema, fcr.category_id AS category_id FROM faqdata fd LEFT JOIN faqcategoryrelations fcr ON fd.id = fcr.record_id AND fd.lang = fcr.record_lang LEFT JOIN faqdata_group AS fdg ON fd.id = fdg.record_id LEFT JOIN faqdata_user AS fdu ON fd.id = fdu.record_id WHERE fd.lang = 'pt-br' AND fd.date_start <= '20120718160143' AND fd.date_end >= '20120718160143' AND fd.active = 'yes' AND fd.sticky = 1 AND ( fdu.user_id = 1 OR fdu.user_id = -1 )
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Can't do any actions as admin

Post by Thorsten »

Hi,

is it possible to get access to your FAQ to check some things?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
leandrorius
Posts: 12
Joined: Tue Jul 17, 2012 3:24 pm

Re: Can't do any actions as admin

Post by leandrorius »

Unfortunately not. My site is an intranet site.
Is there anything I can do to provide you more information? I really need this help...

I've already checked database and folder permissions, and everything looks fine. The buggy version is running on a Solaris machine, and I have exactly the same version in a Debian Linux lab machine working pretty fine. I really don't understand what's happening :(
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Can't do any actions as admin

Post by Thorsten »

Hi,

ah, so it's working on Linux but not on Solaris. Do both machines have the same PHP version and configuration? Any difference for file permissions?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Can't do any actions as admin

Post by Thorsten »

Hi,

could you please post your phpinfo() information of your Solaris installation here? Thanks!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
leandrorius
Posts: 12
Joined: Tue Jul 17, 2012 3:24 pm

Re: Can't do any actions as admin

Post by leandrorius »

The full phpinfo have too much lines, I couldn't post here, neither by PM, and I can't upload as attachment too.
Can I send you by other way? Do you have an email address?
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Can't do any actions as admin

Post by Thorsten »

Hi,

please send it to thorsten AT phpmyfaq DOT de

Thanks!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
leandrorius
Posts: 12
Joined: Tue Jul 17, 2012 3:24 pm

Re: Can't do any actions as admin

Post by leandrorius »

I sent you an email with the phpinfo attached.

Thanks!
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Can't do any actions as admin

Post by Thorsten »

Hi,

I received your mail, I'll check it.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Can't do any actions as admin

Post by Thorsten »

Hi,

I think there's an issue with the session and our CSRF protection based on your user session. Your session caching time is quite short, it's just 20 minutes, but I think it's not the cause why you're redirected. I'll check this issue.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
leandrorius
Posts: 12
Joined: Tue Jul 17, 2012 3:24 pm

Re: Can't do any actions as admin

Post by leandrorius »

I've compared the "Session" section of both Debian (working) and Solaris (buggy) and I found the following differences between then:

session.bug_compat_warn
session.cookie_domain
session.gc_probability

I've changed "compat_warn" and "gc_probability", but nothing happens. But when I tried to leave "cookie_domain" empty (as Debian is), I got the infamous problem of "session expiration on every click" (as I described at the end of this threat: viewtopic.php?f=2&t=14401).

Oh, and I changed the session caching time to 180 just to make sure but, as expected, had no result.
I'm trying to figure out what's the problem, but nothing so far...
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Can't do any actions as admin

Post by Thorsten »

Hi,

I started the investigation and I believe it's about the session based CSRF protection. I'm working on it to add more logging and/or solving this issue.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
leandrorius
Posts: 12
Joined: Tue Jul 17, 2012 3:24 pm

Re: Can't do any actions as admin

Post by leandrorius »

Ok buddy, I'm looking forward to it. I hope you can solve this!

Thanks!
Post Reply