Location: PHPKode > projects > Kshema > www/index.php
<?php
session_start();

include_once("config.php");

//error_reporting ($config['base']['error_reporting']);
error_reporting (E_ALL & ~E_NOTICE);


if ("yes" == $config['performance']['use'])
{
	include_once ($mods_dir."/performance/index.php");
    startTimer();
}

include_once ($mods_dir."/base/index.php");
include_once ($mods_dir."/users/index.php");
include_once ($mods_dir."/auth/index.php");
include_once ($mods_dir."/templater/index.php");

include_once ($mods_dir."/db/index.php");
connect_2db ($db_user, $db_password, $db_host, $db_name);


debug ("authenticating...");
if (auth_enticate())
{
        debug("successful");
        debug ("user id: ".$user['id']);
        debug ("user role: ".$user['role']);
}
else debug("unsuccessful!");

        if (isset($_GET['module']))
        {
            debug ("have module name in GET");
            include_once ("modules/modules/index.php");
            if (module_exists($_GET['module']))
            {
            	$config['modules']['current_module'] = $_GET['module'];
                debug ("current module: ".$config['modules']['current_module']);
                include_once ($mods_dir."/".$_GET['module']."/index.php");
                        $mod_action = $_GET['module']."_default_action";
                        debug ("calling: ".$mod_action);
                $content = $mod_action();
        	}
            else
            	$content = "<p>Èçâèíèòå, òàêîãî ìîäóëÿ íåò.</p>";
        }
        else
        {
			debug ("don't have module name in GET");
			include_once ("modules/modules/index.php");
            if (module_exists($config['modules']['default_module']))
            {
				$config['modules']['current_module'] = $config['modules']['default_module'];
                include_once ($mods_dir."/".$config['modules']['default_module']."/index.php");
                        $mod_action = $config['modules']['default_module']."_default_action";
                        debug ("calling: ".$mod_action);
                $content = $mod_action();
        	}
            else
            	$content = "<p>Èçâèíèòå, íàçíà÷åííîãî ïî óìîë÷àíèþ ìîäóëÿ <b>".$config['modules']['default_module']."</b> íå ñóùåñòâóåò.</p>";
        }

output ($content);

if ("yes" == $config['performance']['use']) debug ("page created approximately in [".endTimer()."] seconds");
?>

Return current item: Kshema