0

I need to show a page with out having the admin user log in. They need to move from

http://local.mage.dev/index.php/admin/

http://local.mage.dev/index.php/admin/wsu/requestaccess/

With out loggin in. As of right now, I just see the login page when I go to the requestaccess action URL. I need to be able to show a form. I have not yet found a way to say it's ok show this stuff yet. This is what I have in my controller, and althou I get to the url as I needed to, the page should be showing the login form.

app\code\local\Wsu\Adminldap\controllers\Adminhtml\WsuController.php

<?php
class Wsu_Adminldap_Adminhtml_WsuController extends Mage_Adminhtml_Controller_Action {

    /**
     * Forgot administrator password action
     * Request Access 
     */
    public function requestaccessAction() {
        echo "test";
        die();
    }

    /**
     * Check if user has permissions to access this controller
     *
     * @return boolean
     */
    protected function _isAllowed(){
        return true;
    }
}
3

Don't extend from Mage_Adminhtml_Controller_Action extend from Mage_Core_Controller_Front_Action then there is no check for login.

Alternative:

Extend from Mage_Adminhtml_Controller_Action and overwrite \Mage_Adminhtml_Controller_Action::preDispatch() remove the

if (Mage::getSingleton('admin/session')->isLoggedIn()) {
        if ($this->getRequest()->isPost()) {
            $_isValidFormKey = $this->_validateFormKey();
            $_keyErrorMsg = Mage::helper('adminhtml')->__('Invalid Form Key. Please refresh the page.');
        } elseif (Mage::getSingleton('adminhtml/url')->useSecretKey()) {
            $_isValidSecretKey = $this->_validateSecretKey();
            $_keyErrorMsg = Mage::helper('adminhtml')->__('Invalid Secret Key. Please refresh the page.');
        }
    }
  • Point. Everything said :-) – Anna Völkl Nov 5 '13 at 21:24
  • That has not been proving as duh as I would wish. This is the login form, and it comes from the Mage_Adminhtml_Controller_Action and working with this from the front has proven to be just as much of a pain. I agree it's seemingly duh choice, and what I did first before I even came here, but I need to come in the same way the forgot password form comes in. I need theme and layout. as of yet I have not be able to just pull the admin theme to the front. still working on it, but this has not proven to bypass, and the original question still stands. I have to imagine there is a way to do it. – jeremy.bass Nov 6 '13 at 2:18
  • added alternative – Fabian Blechschmidt Nov 6 '13 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.