EDIT:
So as @Darsstar suggested in comment, it's better to change action in before method in controller than to override execute method. So it goes like this, in your User controller:
protected $default_action = 'index';
public function before()
{
$action = 'action_'.$this->request->action();
if (!empty($this->default_action) && !method_exists($this, $action))
{
$this->request->action($this->default_action);
}
}
So if there is no current action and default action is defined it changes current request action to default. You can put this code into main Controller and define only $default_action in subcontrollers.
Old answer:
You should override execute method from Controller class. Normally it looks like this:
public function execute()
{
// Execute the "before action" method
$this->before();
// Determine the action to use
$action = 'action_'.$this->request->action();
// If the action doesn't exist, it's a 404
if ( ! method_exists($this, $action))
{
throw HTTP_Exception::factory(404,
'The requested URL :uri was not found on this server.',
array(':uri' => $this->request->uri())
)->request($this->request);
}
// Execute the action itself
$this->{$action}();
// Execute the "after action" method
$this->after();
// Return the response
return $this->response;
}
Change it to something like this:
public function execute()
{
// Execute the "before action" method
$this->before();
// Determine the action to use
$action = 'action_'.$this->request->action();
// If the action doesn't exist, check default action
if ( ! method_exists($this, $action))
{
//Can be hardcoded action_index or $this->default_action set in controller
$action = 'action_index';
// If the action doesn't exist, it's a 404
if ( ! method_exists($this, $action))
{
throw HTTP_Exception::factory(404,
'The requested URL :uri was not found on this server.',
array(':uri' => $this->request->uri())
)->request($this->request);
}
}
// Execute the action itself
$this->{$action}();
// Execute the "after action" method
$this->after();
// Return the response
return $this->response;
}
Now if action doesn't exist it checks default action and runs it, or if doesn't exist throws 404.