Too many redirects error when trying to create a plugin

Hi!
I’m trying to make a plugin that overrides the default login but I’m having an error (ERR_TOO_MANY_REDIRECTS in google chrome) as soon as I create a ‘controllers’ directory in my plugin directory.

I’m using Omeka 2.4.

Request URL is /admin/users/login
But I have a loop of redirects to /admin/users/login and do not know why.

If I’m already authenticated and then create the folder, I have access to the admin part and the route to login gives me a 404. Otherwise, I get a loop of redirects.

Here is parts of my main plugin file:
<?php
require_once dirname(FILE) . ‘/adapters/ShibbAdapter.php’;

class ShibbPlugin extends Omeka_Plugin_AbstractPlugin
{
    protected $_hooks = array(
        'define_routes'
    );

    protected $_filters = array(
        'admin_whitelist',
        'login_adapter'
    );

    public function hookDefineRoutes($args)
    {
        if (!is_admin_theme())
        {
            return;
        }

        $router->addRoute(
            'shibb_login',
            new Zend_Controller_Router_Route(
                'users/login',
                array(
                    'module' => 'shibb',
                    'controller' => 'users',
                    'action' => 'login'
                )
            )
        );
    }

    public function filterAdminWhitelist($whitelist)
    {
        $whitelist[] = array(
            'module' => 'shibb',
            'controller' => 'users',
            'action' => 'login'
        );

        return $whitelist;
    }

    public function filterLoginAdapter($adapter, $args)
    {
        $adapter = new ShibbAdapter();
        return $adapter;
    }
}

So far, I’ve been able to do what I want by modifying Omeka’s Users controller loginAction method (/application/controllers/UsersController.php) but as I’d like to create a page for the plugin with form inputs, and maybe share the plugin later, I’d really like to make it work as a plugin.

Has anyone encountered that same problem? Is there something I forgot to do in order to override UsersController’s loginAction?

Thank you very much!

The usual problem people hit when doing something like this is missing the admin_whitelist part, causing us to constantly try to redirect to the login page.

However, here it looks like you have that covered… Do you know what’s issuing the redirect? The “usual problem” one that I mentioned above would be coming from Omeka_Controller_Plugin_Admin.

Unfortunately I have no idea what is issuing the redirect. I’ll keep you updated if I find a solution.