public function getPageTemplate($user) { if ($this->template != NULL) { return $this->template; } return StaticConfig::getDefaultTemplate($user); }
/** * Gets the requested page name */ public static function getPage() { $page = Request::getSafeGetOrPost("p"); if ($page == NULL || !ctype_alnum($page)) { $page = StaticConfig::getDefaultPage(); } return $page; }
public static function getController($page) { if (self::$CONTROLLERS[$page] != NULL) { $controller = self::$CONTROLLERS[$page]; return new $controller(); } else { return StaticConfig::getDefaultController(); } }
function performAuthentication() { $this->authError = NULL; StaticConfig::getLoginProcessor()->recordLoginAttempt(Request::getSafePost('Username'), Request::getSafePost('Password')); if (Request::getSafePost('Username') == NULL) { $this->authError = AuthenticationError::invalidUserName(); $this->authenticated = false; return false; } if (Request::getSafePost('Password') == NULL) { $this->authError = AuthenticationError::invalidPassword(); $this->authenticated = false; return false; } if (StaticConfig::isLoginEmailFormat()) { if (!filter_var(Request::getSafePost("Username"), FILTER_VALIDATE_EMAIL)) { $this->authError = AuthenticationError::invalidUserName(); $this->authenticated = false; return false; } } $user = UserIQL::select()->where(NULL, UserIQL::$USERNAME, '=', Request::getSafePost('Username'))->getFirst(); if (is_object($user)) { $this->user = $user; } if ($this->user == NULL) { $this->authError = AuthenticationError::invalidUserName(); $this->authenticated = false; StaticConfig::getLoginProcessor()->processUnsuccessfulLogin(Request::getSafePost('Username'), Request::getSafePost('Password'), NULL); return $this->authenticated; } else { if ($this->user->getEnabled() != 1) { $this->authError = AuthenticationError::accountDisabled(); $this->authenticated = false; StaticConfig::getLoginProcessor()->processUnsuccessfulLogin(Request::getSafePost('Username'), Request::getSafePost('Password'), $this->user); return $this->authenticated; } } if (md5(Request::getSafePost('Password')) == $this->user->getPassword()) { $this->authenticated = true; StaticConfig::getLoginProcessor()->processLogin($this->user); return $this->authenticated; } else { $this->authError = AuthenticationError::invalidPassword(); $this->authenticated = false; StaticConfig::getLoginProcessor()->processUnsuccessfulLogin(Request::getSafePost('Username'), Request::getSafePost('Password'), $this->user); return $this->authenticated; } return false; }
private function __construct() { $this->authenticationManager = StaticConfig::getAuthenticationClass(); }
<link rel="stylesheet" type="text/css" media="all" href="/css/reset.css" /> <link rel="stylesheet" type="text/css" media="all" href="/css/core.css" /> <link rel="icon" type="image/png" href="/images/favicon.ico"/> <title><?php echo StaticContext::getSiteName() . ' | ' . Response::getInstance()->getPageTitle(); ?> </title> </head> <body> <?php if (isset($processingContent) && $processingContent != -1 && $processingContent != NULL && $processingContent != '') { echo $processingContent; } if ($content == -1) { include 'config/includes/pages/404.php'; } else { //display the page content as extracted from the db echo $content; } ?> <?php if (StaticConfig::getGoogleAnalyticsCode() != NULL) { include 'config/includes/pages/ga.php'; } ?> </body> </html>
<?php try { require_once 'config/settings.php'; $controller = WebContext::getController(BaseController::getPage()); $controller->run(); } catch (Exception $e) { mail(StaticConfig::getAdministratorEmail(), "{$site_name} - Site error", $e); header('Location: /error'); die; }
*/ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" href="/plugins/senchatouch/css/sencha-touch.css" type="text/css"> <script type="text/javascript" src="/plugins/senchatouch/sencha-touch.js"></script> <link rel="stylesheet" href="/css/core.css" type="text/css"> <script type="text/javascript" src="/js/App.js"></script> <script type="text/javascript" src="/js/app/HomeController.js"></script> <script type="text/javascript" src="/js/app/HomeScreen.js"></script> <script type="text/javascript" src="/js/auth/LoginFormPanel.js"></script> <script type="text/javascript" src="/js/auth/LoginScreen.js"></script> <script type="text/javascript" src="/js/auth/LoginTransaction.js"></script> <script type="text/javascript" src="/js/auth/LogoutTransaction.js"></script> <script type="text/javascript" src="/js/user/GetUserTransaction.js"></script> <link rel="icon" type="image/png" href="/images/favicon.ico" /> <title><?php echo StaticConfig::getSiteName() . ' | ' . Response::getInstance()->getPageTitle(); ?> </title> </head> </html>
* * Licensed under the Apache License, Version 2.0 (the "License") * http://www.apache.org/licenses/LICENSE-2.0 */ //setup the auto loading function function __autoload($className) { if (Inform8Context::getClassRegistry()->getClass($className) != NULL) { include Inform8Context::getClassRegistry()->getClass($className); } } require_once 'StaticConfigClass.php'; require_once 'lib/Inform8/Inform8Context.php'; require_once 'lib/Inform8/loadall.php'; // configure the logging system Inform8Context::setLogger(StaticConfig::getLogger()); require_once 'controllers.php'; // load the database connection include 'config/includes/db/db.conn.prod.php'; $checker = new BlackListChecker(); if ($checker->isOnBlackList() >= 1) { die('Sorry your IP has been blocked. If you think this an error please contact us.'); } setlocale(LC_ALL, StaticConfig::getLocale()); // configure the session session_start(); require_once 'session.php'; // check authentication require_once 'auth.php'; // last chance to config anything else. include 'setup.php';
//setup the auto loading function function __autoload($className) { if (Inform8Context::getClassRegistry()->getClass($className) != NULL) { include Inform8Context::getClassRegistry()->getClass($className); } } require_once 'StaticConfigClass.php'; date_default_timezone_set(StaticConfig::getDefaultTimeZone()); require_once 'lib/Inform8/Inform8Context.php'; require_once 'lib/Inform8/loadall.php'; // configure the logging system Inform8Context::setLogger(StaticConfig::getLogger()); require_once 'controllers.php'; // load the database connection include 'config/includes/db/db.conn.prod.php'; $checker = new BlackListChecker(); if ($checker->isOnBlackList() >= 1) { die('Sorry your IP has been blocked. If you think this an error please contact us.'); } setlocale(LC_ALL, StaticConfig::getLocale()); //last chance to config anything else. include 'setup.php'; // configure the session session_set_cookie_params(StaticConfig::getSessionTimeout()); session_start(); require_once 'session.php'; // check authentication if (!(isset($noAuth) && $noAuth == 1)) { require_once 'auth.php'; }
<?php /** * Copyright 2011 - Inform8 * http://www.inform8.com * * Licensed under the Apache License, Version 2.0 (the "License") * http://www.apache.org/licenses/LICENSE-2.0 */ // set the indexing session key Session::setSiteKey(StaticConfig::getSiteName()); // load the session $session = Session::getInstance();
function send() { $templateRes = $this->parseTemplate(); $storageSettingsDao = new JackStorageDao(); $allSettings = $storageSettingsDao->getAll(); $storageSettings = $allSettings[0]; $storageFolder = $storageSettings->getStorageFolder(); $errors = array(); foreach ($this->to as $sendTo) { $mail = new PHPMailer(); // defaults to using php "mail()" $mail->From = $this->getSettings()->getFromEmail(); $mail->FromName = $this->getSettings()->getFromName(); $mail->Subject = $templateRes['subject']; $mail->AddAddress($sendTo); $mail->MsgHTML($templateRes['html']); $mail->AltBody = $templateRes['text']; if ($this->getSettings()->useSMTP()) { $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPDebug = 0; // enables SMTP debug information (for testing) $mail->Host = $this->getSettings()->getSmtpServer(); $mail->Port = $this->getSettings()->getSmtpPort(); if ($this->getSettings()->isSmtpAuthReqd()) { $mail->SMTPAuth = true; // enable SMTP authentication $mail->Username = $this->getSettings()->getSmtpUsername(); // SMTP account username $mail->Password = $this->getSettings()->getSmtpPassword(); // SMTP account password } } else { $mail->IsMail(); } $templateFiles = $this->template->getEmbeddableFiles(); if (isset($templateFiles) && is_array($templateFiles)) { foreach ($templateFiles as $afile) { $mail->AddEmbeddedImage(StaticConfig::getStorageLocation() . '/' . $afile->getFileName(), $afile->getName()); } } $attachFiles = $this->template->getAttachmentFiles(); if (isset($attachFiles) && is_array($attachFiles)) { foreach ($attachFiles as $afile) { $mail->AddAttachment(StaticConfig::getStorageLocation() . '/' . $afile->getFileName(), $afile->getName()); } } if (!$mail->Send()) { $errors[] = 'Failed to send email to: ' . $sendTo; } Inform8Context::getLogger()->log(BaseLogger::$DEBUG, 'Sent email to: ' . $sendTo); set_time_limit(30); } return $errors; }
<?php try { require_once 'config/settings.php'; $controller = WebContext::getController(BaseController::getPage()); $controller->run(); } catch (Exception $e) { mail(StaticConfig::getAdministratorEmail(), StaticConfig::getSiteName() . " - Site error", $e); header('Location: /error'); die; }
<?php include 'lib/Inform8/loadall-plus.php'; StaticConfig::addPreProcessor(new PlusPreProcessor()); /** $authManager = $_SESSION["authmanager".$site_name]; if ($authManager == NULL) { $langcode = $defaultLanguage; $helpLangcode = $defaultLanguage; }else { $user = $authManager->getUser(); $lang = $user->getLanguageIdObject(); $langcode = $lang->getCode(); $helpLangcode = $lang->getCode(); if (!file_exists($langcode . '.php')) { $langcode = $defaultLanguage; } if (!file_exists('help.' . $helpLangcode . '.php')) { $helpLangcode = $defaultLanguage; } } */ // Load Site Language //require_once $langcode . '.php';
<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', '<?php echo StaticConfig::getGoogleAnalyticsCode(); ?> ']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
# extension listed to be canonical). # # $type - the MIME type static $exts; if (!isset($exts)) { $exts = system_mime_type_extensions(); } return isset($exts[$type]) ? $exts[$type] : null; } require_once 'config/settings.php'; if (!Session::getInstance()->getAuthenticationManager()->isAuthenticated()) { header('Location: /'); exit; } $pfile = Request::getSafeGetOrPost('f'); $fileName = StaticConfig::getStreamedContentLocalFolder() . $pfile; if (!file_exists($fileName)) { header('Location: /'); exit; } $fileparts = explode('/', $file); // check no .. in file name header("Content-Type: " . system_extension_mime_type($fileName)); header("Content-Length: " . filesize($fileName)); header("Pragma: no-cache"); header("Expires: 0"); $fp = fopen($fileName, "rb"); //start buffered download while (!feof($fp)) { //reset time limit for big files set_time_limit(0);