News:

Join the Facebook Fan Page.

Main Menu

406 error on logout

Started by amlucent, July 14, 2010, 03:03:32 PM

Previous topic - Next topic

amlucent

Website with problem: www.syntheticperformanceforums.net
Version: SMF 2.0 RC3
Mods: Simple Portal, Aeva Media Gallery, reCAPTCHA

I followed the links for how to add tabs to SMF 2 that is stickied in this forum and I largely ended up restructuring all the buttons and drop downs to be more like the themes at dzinerstudio.  One problem, the log out button now doesnt work and I dont see why.  I get the following error when I try to log out.  I originally assumed the syntax of my logout button was incorrect but I dont think that is it any longer I have posted a topic at Dzinerstudio and I was recommended to post here that my code looks correct.  I am starting to wonder if it is something more on the server side.


QuoteNot Acceptable

An appropriate representation of the requested resource /synthetic/index.php could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_perl/2.0.4 Perl/v5.8.8 Server at www.syntheticperformanceforums.net Port 80



Here is the code I altered and what it currently is, I see nothing wrong:
// All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.
if (($menu_buttons = cache_get_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $cacheTime)) === null || time() - $cacheTime <= $modSettings['settings_updated'])
{
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
// 'target' => '_blank',
),
'why' => array(
'title' => 'Why Amsoil?',
'href' => 'http://www.syntheticperformanceforums.net/synthetic/index.php/page,page3.html',
'show' => true,
'sub_buttons' => array(

'cost' => array(
'title' => 'Cost Comparison',
'href' => 'http://www.syntheticperformanceforums.net/synthetic/index.php/page,page3247.html',
'show' => true,
),
'ecofriendly' => array(
'title' => 'Eco-Friendly Choice',
'href' => 'http://www.syntheticperformanceforums.net/synthetic/index.php/page,page3929.html',
'show' => true,
),
'dealer' => array(
'title' => 'Become a Dealer',
'href' => 'http://www.syntheticperformanceforums.net/synthetic/index.php/page,page1919.html',
'show' => true,
'is_last' => true,
),
),
),
'forum' => array(
'title' => empty($txt['sp-forum']) ? 'Forum' : $txt['sp-forum'],
'href' => $scripturl . ($modSettings['sp_portal_mode'] == 1 && empty($context['disable_sp']) ? '?action=forum' : ''),
'show' => in_array($modSettings['sp_portal_mode'], array(1, 3)) && empty($context['disable_sp']),
'sub_buttons' => array(

'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
),
'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => $context['allow_search'],
),
'profile' => array(
'title' => $txt['profile'],
'href' => $scripturl . '?action=profile',
'show' => $context['allow_edit_profile'],
),
'pm' => array(
'title' => $txt['pm_short'],
'href' => $scripturl . '?action=pm',
'show' => $context['allow_pm'],
),
'calendar' => array(
'title' => $txt['calendar'],
'href' => $scripturl . '?action=calendar',
'show' => $context['allow_calendar'],
'is_last' => true,
),
'mlist' => array(
'title' => $txt['members_title'],
'href' => $scripturl . '?action=mlist',
'show' => $context['allow_memberlist'],
),
'moderate' => array(
'title' => $txt['moderate'],
'href' => $scripturl . '?action=moderate',
'show' => $context['allow_moderation_center'],
),
'login' => array(
'title' => $txt['login'],
'href' => $scripturl . '?action=login',
'show' => $user_info['is_guest'],
),
'register' => array(
'title' => $txt['register'],
'href' => $scripturl . '?action=register',
'show' => $user_info['is_guest'],
'is_last' => !$context['right_to_left'],
),
'logout' => array(
'title' => $txt['logout'],
'href' => $scripturl . '?action=logout;%1$s=%2$s',
'show' => !$user_info['is_guest'],
'is_last' => !$context['right_to_left'],
),
),
),
'admin' => array(
'title' => $txt['admin'],
'href' => $scripturl . '?action=admin',
'show' => $context['allow_admin'],
'sub_buttons' => array(
'featuresettings' => array(
'title' => $txt['modSettings_title'],
'href' => $scripturl . '?action=admin;area=featuresettings',
'show' => allowedTo('admin_forum'),
),
'packages' => array(
'title' => $txt['package'],
'href' => $scripturl . '?action=admin;area=packages',
'show' => allowedTo('admin_forum'),
),
'errorlog' => array(
'title' => $txt['errlog'],
'href' => $scripturl . '?action=admin;area=logs;sa=errorlog;desc',
'show' => allowedTo('admin_forum') && !empty($modSettings['enableErrorLogging']),
),
'permissions' => array(
'title' => $txt['edit_permissions'],
'href' => $scripturl . '?action=admin;area=permissions',
'show' => allowedTo('manage_permissions'),
),
'portal' => array(
'title' => $txt['sp-adminCatTitle'],
'href' => $scripturl . '?action=admin;area=portalconfig',
'show' => allowedTo(array('sp_admin', 'sp_manage_settings')),
'is_last' => true,
),
),
),
// Aeva Media changes
'media' => array(
'title' => (isset($txt['aeva_gallery']) ? $txt['aeva_gallery'] : 'Media') . (!allowedTo('aeva_access_unseen') || empty($user_info['aeva_unseen']) || $user_info['aeva_unseen'] == -1 ? '' : ' [<b>' . $user_info['aeva_unseen'] . '</b>]'),
'href' => $scripturl . '?action=media',
'show' => allowedTo('aeva_access'),
'sub_buttons' => !allowedTo('aeva_access_unseen') || empty($user_info['aeva_unseen']) || $user_info['aeva_unseen'] == -1 ? array() : array(
'aeva_home' => array(
'title' => $txt['aeva_home'],
'href' => $scripturl . '?action=media',
'show' => true,
),
'aeva_unseen' => array(
'title' => $txt['aeva_unseen'],
'href' => $scripturl . '?action=media;sa=unseen',
'show' => true,
'is_last' => true,
),
),
),
// End Aeva Media changes

'contact' => array(
'title' => 'Contact',
'href' => 'http://www.syntheticperformanceforums.net/synthetic/index.php/page,page4751.html',
'show' => true,
'is_last' => true,
),
                    ),
);


Any thoughts?

kat

This is likely to be due to Apache mod_security that is turned on, by default. While you can use the following to diagnose the problem, turning the filter off should resolve the issue.


SecFilterEngine off

It's important to leave the filter on as it helps prevent spam and injection attacks. What you need to do is figure out (ask your host, if you need help) which phrases are triggering the filter.

Typically, these could include phrases that include possible commands such as "ftp," "telnet," "ssh," etc. Once you know which ones are causing the error, you can modify the filter to permit the page that's not loading.

Could it, possibly, be the word "Dealer"?

amlucent

What file/where do I put this flag to disable it?

SecFilterEngine off

Quote from: K@ on July 14, 2010, 04:14:45 PM
Could it, possibly, be the word "Dealer"?

I changed it to 'become' and same result

'become' => array(
'title' => 'Become a Dealer',
'href' => 'http://www.syntheticperformanceforums.net/synthetic/index.php/page,page1919.html',
'show' => true,
'is_last' => true,
),
),

kat

Well, as far as I know, the quickest, easiest way to figure this out, is to contact your host.

If you show them that bit of code, they should see it, fairly instantly, I would imagine.

amlucent

Ok, I will contact them.  Although the thought of relying on support from my hosting company is frightening.  Thanks K!

kat


amlucent

#6
UPDATE:

Ok, so I am able to replicate the exact same results on another host and server that I am positive does not have phpmod security enabled (aeva tells me its disabled).  This problem only occurs when logout is a sub button on the drop menu. So I did some digging and looking and this is how simple portal does the log out button.. they use the "session_id":

' <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', $txt['logout'], '</a>';

knowing this, how could I do this in the nav bar?

would it be like this?

'logout' => array(
'title' => $txt['logout'],
'href' =>  $scripturl, '?action=logout;sesc=', $context['session_id'], '">', $txt['logout'],
'show' => !$user_info['is_guest'],
'is_last' => !$context['right_to_left'],
),


amlucent

I dont know how correct this syntax is but after a lot of trial and error I have found this to work as a subbutton.

'logout' => array(
'title' => $txt['logout'],
'href' =>  $scripturl . '?action=logout;sesc=' . $context['session_id'],
'show' => !$user_info['is_guest'],
'is_last' => !$context['right_to_left'],
),

kat

WooHoo!

Sorry, I've not been about. We've had a small meet-up, in Manchester.

Thanks for telling us how you did it, coz that might well be useful for someone else!

Advertisement: