if (Config::get_config('ca_mode') != CA_COMODO) { $errorTag = PW::create(); Logger::logEvent(LOG_NOTICE, "Accountant", "process()", "User " . stripslashes($this->person->getX509ValidCN()) . "tried to access the accountant, " . "even though Confusa is not using the Comodo CA.", __LINE__, $errorTag); $this->tpl->assign('reason', "[{$errorTag}] Confusa is not using Comodo CA"); $this->tpl->assign('content', $this->tpl->fetch('restricted_access.tpl')); return; } } /* set fields in template */ if (!$this->account->getLoginName()) { $this->tpl->assign('login_name', $this->translateTag('l10n_fieldval_undefined', 'accountant')); } else { $this->tpl->assign('login_name', $this->account->getLoginName()); } if (!$this->account->getPassword()) { $this->tpl->assign('password', $this->translateTag('l10n_fieldval_undefined', 'accountant')); } else { $this->tpl->assign('password', $this->translateTag('l10n_label_passwhidden', 'accountant')); } if (!$this->account->getAPName()) { $this->tpl->assign('ap_name', $this->translateTag('l10n_fieldval_undefined', 'accountant')); } else { $this->tpl->assign('ap_name', $this->account->getAPName()); } $this->tpl->assign('verify_ca', 'yes'); $this->tpl->assign('content', $this->tpl->fetch('accountant.tpl')); } } $fw = new Framework(new CP_Accountant()); $fw->start();
* @author Joe Stump <*****@*****.**> * @global string FRAMEWORK_BASE_PATH Absolute path to our framework */ define('FRAMEWORK_BASE_PATH', dirname(__FILE__)); try { require_once 'Framework.php'; // Load the Framework_Site_Example class and initialize modules, run // events, etc. You could create an array based on $_SERVER['SERVER_NAME'] // that loads up different site drivers depending on the server name. For // instance, www.foo.com and foo.com load up Framework_Site_Foo, while // www.bar.com, www.baz.com, baz.com, and bar.com load up Bar // (Framework_Site_Bar). // // The second argument is the controller. Not all modules will support all // controllers. If that's the case an appropriate error will be output. $result = Framework::start('Example', 'CLI'); if (PEAR::isError($result)) { switch ($result->getCode()) { case FRAMEWORK_ERROR_AUTH: // Redirect to your login page here? // $pg = urlencode($_SERVER['REQUEST_URI']); // header("Location: /Web/Login?pg=$pg"); // break; // Redirect to your login page here? // $pg = urlencode($_SERVER['REQUEST_URI']); // header("Location: /Web/Login?pg=$pg"); // break; default: // If a PEAR error is returned usually something catastrophic // happend like an event returning a PEAR_Error or throwing an // exception of some sort.
if (!isset($_GET['module'])) { header("Location: ./?module=Login"); exit; } define('FRAMEWORK_BASE_PATH', dirname(__FILE__) . '/..'); $ta_include_path = FRAMEWORK_BASE_PATH; // Local copy of PEAR $ta_include_path .= PATH_SEPARATOR . FRAMEWORK_BASE_PATH . '/PEAR'; ini_set('include_path', $ta_include_path . PATH_SEPARATOR . ini_get('include_path')); try { require_once 'Framework.php'; $controller = 'ToasterAdmin'; if (isset($_GET['Controller'])) { $controller = $_GET['Controller']; } try { Framework::start('Default', $controller); } catch (Framework_Exception $e) { switch ($e->getCode()) { case FRAMEWORK_ERROR_AUTH: header('Location: ./?module=Login'); break; default: die($e->getMessage()); } } // Run shutdown functions and stop the Framework Framework::stop(); } catch (Exception $error) { echo $error->getMessage(); }
* @author Joe Stump <*****@*****.**> * @global string FRAMEWORK_BASE_PATH Absolute path to our framework */ define('FRAMEWORK_BASE_PATH', dirname(__FILE__)); try { require_once 'Framework.php'; // Load the Framework_Site_Example class and initialize modules, run // events, etc. You could create an array based on $_SERVER['SERVER_NAME'] // that loads up different site drivers depending on the server name. For // instance, www.foo.com and foo.com load up Framework_Site_Foo, while // www.bar.com, www.baz.com, baz.com, and bar.com load up Bar // (Framework_Site_Bar). // // The second argument is the controller. Not all modules will support all // controllers. If that's the case an appropriate error will be output. $result = Framework::start('Example', $_GET['controller']); if (PEAR::isError($result)) { switch ($result->getCode()) { case FRAMEWORK_ERROR_AUTH: // Redirect to your login page here? // $pg = urlencode($_SERVER['REQUEST_URI']); // header("Location: /Web/Login?pg=$pg"); // break; // Redirect to your login page here? // $pg = urlencode($_SERVER['REQUEST_URI']); // header("Location: /Web/Login?pg=$pg"); // break; default: // If a PEAR error is returned usually something catastrophic // happend like an event returning a PEAR_Error or throwing an // exception of some sort.