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!