Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

(solved) Error with the observer.php file. The store front works but the admin doesnt ??????? 
 
harjot
Member
 
Total Posts:  61
Joined:  2007-11-13
 

I installed everthing on magento correctly and when i went to the admin this error came up.
Fatal error: Call to undefined function apache_request_headers() in /html/shop4/app/code/core/Mage/Admin/Model/Observer.php on line 70 ......the store front works.
from observer.php
if (!$request->getParam(’forwarded’)) {
foreach (apache_request_headers() as $k=>$v) {
if (strtolower($k)===’x-requested-with’ && strtolower($v)===’xmlhttprequest’) {
header(’HTTP/1.1 403 Session Expired’);
header(’Login-Required: true’);
exit;
}
}
$request->setParam(’forwarded’, true)
->setControllerName(’index’)
->setActionName(’login’)
->setDispatched(false);

return false;

can some one help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michae1
Enthusiast
 
Total Posts:  826
Joined:  2007-08-31
 

Hi harjot,
You can replace app/code/core/Mage/Admin/Model/Observer.php with the attached one.

File Attachments
Observer.php  (File Size: 4KB - Downloads: 128)
 
Magento Community Magento Community
Magento Community
Magento Community
 
harjot
Member
 
Total Posts:  61
Joined:  2007-11-13
 

let me try......sorry it tock so long too respond but it was because i was trying this for 2 hours straight.

 
Magento Community Magento Community
Magento Community
Magento Community
 
harjot
Member
 
Total Posts:  61
Joined:  2007-11-13
 

THANK YOU........ How did you know of this workaround? thanks again. Now i can go to sleep. thanks smile

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top