if ($config->authentication->enabled == 1 and isset($auth_session->id) or $config->authentication->enabled == 0) { include_once './include/sql_patches.php'; if (getNumberOfPatches() > 0) { $view = "database_sqlpatches"; $module = "options"; if ($action == "run") { runPatches(); } else { listPatches(); } $menu = false; } else { //If no invoices in db then show home page as default - else show Manage Invoices page if ($module == null) { $invoiceobj = new invoice(); if ($invoiceobj->are_there_any() > "0") { $module = "invoices"; $view = "manage"; } else { $module = "index"; $view = "index"; } unset($invoiceobj); } } } } } /* * dont include the header if requested file is an invoice template - for print preview etc.. header is not needed */
if ($skip_db_patches == false) { if ($config->authentication->enabled == 1 and isset($auth_session->id) or $config->authentication->enabled == 0) { include_once './modules/options/database_sqlpatches.php'; if (getNumberOfPatches() > 0) { $view = "database_sqlpatches"; $module = "options"; if ($action == "run") { runPatches(); } else { listPatches(); } $menu = false; } else { //If no invoices in db then show home page as default - else show Manage Invoices page if ($module == null) { if (invoice::are_there_any() > "0") { $module = "invoices"; $view = "manage"; } else { $module = "index"; $view = "index"; } } } } } } /* * dont include the header if requested file is an invoice template - for print preview etc.. header is not needed */ if ($module == "invoices" && strstr($view, "template")) {