{"id":488,"date":"2013-05-24T21:12:08","date_gmt":"2013-05-24T19:12:08","guid":{"rendered":"http:\/\/www.extradrm.com\/?p=488"},"modified":"2013-06-14T14:10:34","modified_gmt":"2013-06-14T12:10:34","slug":"sessions-oscommerce-login-problems","status":"publish","type":"post","link":"http:\/\/www.extradrm.com\/?p=488","title":{"rendered":"Fix Oscommerce 2.3 Admin Login troubleshoot"},"content":{"rendered":"<h2>Very annoying Error message maximum number of login attempts has been reached<\/h2>\n<p>Error: The maximum number of login attempts has been reached. Please try again in 5 minutes.<br \/>\n<span style=\"text-decoration: underline;\"><strong>In admin\/includes\/application_top.php locate and remove the following code.<\/strong><\/span><\/p>\n<pre>\/\/ try to automatically login with the HTTP Authentication values if it exists\r\nif (!tep_session_is_registered('auth_ignore')) {\r\nif (isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) &amp;&amp; !empty($HTTP_SERVER_VARS['PHP_AUTH_USER']) &amp;&amp; isset($HTTP_SERVER_VARS['PHP_AUTH_PW']) &amp;&amp; !empty($HTTP_SERVER_VARS['PHP_AUTH_PW'])) {\r\n$redirect_origin['auth_user'] = $HTTP_SERVER_VARS['PHP_AUTH_USER'];\r\n$redirect_origin['auth_pw'] = $HTTP_SERVER_VARS['PHP_AUTH_PW'];\r\n}\r\n}<\/pre>\n<p><strong>Then clear cookies\/cache of your browser and login.<\/strong> This modification removes the automatic assignment of login credentials by the core code and allows the administrator to keep and correctly use separate login information for the cpanel&#8217;s popup login and for the actual osCommerce admin login. This modification in fact strengthens security as the website owner can maintain a separate set of login credentials.<\/p>\n<p><strong><span style=\"text-decoration: underline;\">Another issue with the sessions is not common<\/span><\/strong> but may happen with the number of characters and type of characters the sessions :<\/p>\n<p>To fix this issue, open the admin\/includes\/functions\/general.php locate the following code<\/p>\n<pre>\/\/\/\/\r\n\/\/ Redirect to another page or site\r\nfunction tep_redirect($url) {\r\nglobal $logger;\r\n\r\nif ( (strstr($url, \"n\") != false) || (strstr($url, \"r\") != false) ) {\r\ntep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));\r\n}\r\n\r\nheader('Location: ' . $url);\r\n\r\nif (STORE_PAGE_PARSE_TIME == 'true') {\r\nif (!is_object($logger)) $logger = new logger;\r\n$logger-&gt;timer_stop();\r\n}\r\n\r\nexit;\r\n}<\/pre>\n<p><span style=\"text-decoration: underline;\"><strong>Replace it with the following code:<\/strong><\/span><\/p>\n<pre>\/\/\/\/\r\n\/\/ Stop from parsing any further PHP code\r\nfunction tep_exit() {\r\ntep_session_close();\r\nexit();\r\n}\r\n\r\n\/\/\/\/\r\n\/\/ Redirect to another page or site\r\nfunction tep_redirect($url) {\r\nglobal $logger;\r\n\r\nif ( (strstr($url, \"n\") != false) || (strstr($url, \"r\") != false) ) {\r\ntep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));\r\n}\r\n\r\nif (STORE_PAGE_PARSE_TIME == 'true') {\r\nif (!is_object($logger)) $logger = new logger;\r\n$logger-&gt;timer_stop();\r\n}\r\n\r\nheader('Location: ' . $url);\r\ntep_exit();\r\n}<\/pre>\n<p>This ensures sessions are closed at the end of a redirect. Also you have to ensure redirects take place after the session starts. This post was dedicated for oscommerce 2.3 and it will be followed by an SEO oscommerce 2.3 <a title=\"How to remove sessions ID in Oscommerce 2.3 URLs\" href=\"http:\/\/www.extradrm.com\/?p=762\">post here<\/a><br \/>\nCheers,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Very annoying Error message maximum number of login attempts has been reached Error: The maximum number of login attempts has been reached. Please try again in 5 minutes. In admin\/includes\/application_top.php locate and remove the&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2841,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[17,18],"tags":[81,92,109],"youtube_video":null,"_links":{"self":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/488"}],"collection":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=488"}],"version-history":[{"count":0,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/488\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/media\/2841"}],"wp:attachment":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=488"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}