<?php
class Plugg_Main_Index extends Sabai_Application_Controller
{
    protected function _doExecute(Sabai_Application_Context $context)
    {
        static $done = false;
        // Prevent recursive routing
        if (!$done) {
            if ($plugin = trim($this->config->get('defaultPlugin'), '/')) {
                $done = true;
                $this->_parent->forward('/' . strtolower($plugin), $context);
                return;
            }
        }
    }
}