/** * Constructeur qui initialise certaines variables de classe * et qui lance le traitement initial * * @param filename emplacement du fichier XML de configuration * @return null * @author Florent MONTHEL, Stéphane F **/ protected function __construct($filename) { # On parse le fichier de configuration $this->getConfiguration($filename); # Chargement du fichier de langue loadLang(PLX_CORE . 'lang/' . $this->aConf['default_lang'] . '/core.php'); # récupération des paramètres dans l'url $this->get = plxUtils::getGets(); # gestion du timezone date_default_timezone_set($this->aConf['timezone']); # chargement des variables $this->racine = $this->aConf['racine']; $this->bypage = $this->aConf['bypage_feed']; $this->tri = 'desc'; $this->clef = !empty($this->aConf['clef']) ? $this->aConf['clef'] : ''; # Traitement des plugins $this->plxPlugins = new plxPlugins($this->aConf['default_lang']); $this->plxPlugins->loadPlugins(); # Hook plugins eval($this->plxPlugins->callHook('plxFeedConstructLoadPlugins')); # Traitement sur les répertoires des articles et des commentaires $this->plxGlob_arts = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_articles'], false, true, 'arts'); $this->plxGlob_coms = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_commentaires']); # Récupération des données dans les autres fichiers xml $this->getCategories(path('XMLFILE_CATEGORIES')); $this->getUsers(path('XMLFILE_USERS')); $this->getTags(path('XMLFILE_TAGS')); # Récupération des articles appartenant aux catégories actives $this->getActiveArts(); # Hook plugins eval($this->plxPlugins->callHook('plxFeedConstruct')); }
function loadAppsSystem() { loadLang(__DIR__); $apps = app_param('app'); $file = "apps/app_{$apps}/sys_{$apps}.php"; if (file_exists($file)) { require_once $file; } }
/** * Load language by controller name */ protected function loadLanguage() { loadLang('template'); //for template //load class language file if exists $class = $this->router->class; $language_path = join('/', [APPPATH, 'language', getLang(), $class]) . '_lang.php'; if (file_exists($language_path)) { loadLang($class); } }
function loadPage($page) { require_once "lang/loadlang.php"; if (isset($_COOKIE['bellasia.page'])) { $page = $_COOKIE["bellasia.page"]; } else { setcookie("bellasia.page", $page); } loadLang($page); include $page . ".php"; }
public static function init() { // Define host self::$sHostName = $_SERVER['HTTP_HOST']; self::setCookieDomain(self::$sHostName); // Split URL to chunks self::$aFullPath = explode("/", substr($_SERVER['REQUEST_URI'], 1)); $aHost = explode(".", self::$sHostName); if ($aHost[0] == 'www') { redirect('http://' . $aHost[1] . '.' . $aHost[2]); } // Определяем настройки сайта self::initSite(); self::getPath(); if (self::isAdmin()) { loadLang(CORE_ROOT . 'i18n.' . _LANG . '.php'); } else { loadLang(CORE_ROOT . 'i18n.' . LANG . '.php'); } }
function _autoload($className) { $lang = defined('LANG') ? LANG : _LANG; $classFile = CORE_ROOT . 'class/' . $className . '/' . $className . '.php'; if (!file_exists($classFile)) { $pathToClass = str_replace('_', '/', $className); $chunks = explode("_", $className); $className = $chunks[count($chunks) - 1]; if (!file_exists($classFile = CORE_ROOT . 'class/' . $pathToClass . '/' . $className . '.php')) { // trigger_error('Class ' . $className . ' or his interface not found :(', E_USER_ERROR); return false; } $langFile = CORE_ROOT . 'class/' . $pathToClass . 'i18n.' . $lang . '.php'; } else { $langFile = CORE_ROOT . 'class/' . $className . '/i18n.' . $lang . '.php'; } if (file_exists($langFile)) { loadLang($langFile, $className); } include $classFile; }
/** * Constructeur qui initialise certaines variables de classe * et qui lance le traitement initial * * @param filename emplacement du fichier XML de configuration * @return null * @author Anthony GUÉRIN, Florent MONTHEL, Stéphane F **/ protected function __construct($filename) { # On parse le fichier de configuration $this->getConfiguration($filename); # Chargement du fichier de langue $lang = isset($_SESSION['lang']) ? $_SESSION['lang'] : $this->aConf['default_lang']; $this->aConf['default_lang'] = $lang; loadLang(PLX_CORE . 'lang/' . $lang . '/core.php'); # récupération des paramètres dans l'url $this->get = plxUtils::getGets(); # gestion du timezone date_default_timezone_set($this->aConf['timezone']); # On vérifie s'il faut faire une mise à jour if ((!isset($this->aConf['version']) or PLX_VERSION != $this->aConf['version']) and !defined('PLX_UPDATER')) { header('Location: ' . PLX_ROOT . 'update/index.php'); exit; } # Chargement des variables $this->style = $this->aConf['style']; $this->racine = $this->aConf['racine']; $this->bypage = $this->aConf['bypage']; $this->tri = $this->aConf['tri']; $this->tri_coms = $this->aConf['tri_coms']; # On récupère le chemin de l'url $var = parse_url($this->racine); $this->path_url = str_replace(ltrim($var['path'], '\\/'), '', ltrim($_SERVER['REQUEST_URI'], '\\/')); # Traitement des plugins $this->plxPlugins = new plxPlugins($lang); $this->plxPlugins->loadPlugins(); # Hook plugins eval($this->plxPlugins->callHook('plxMotorConstructLoadPlugins')); # Traitement sur les répertoires des articles et des commentaires $this->plxGlob_arts = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_articles'], false, true, 'arts'); $this->plxGlob_coms = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_commentaires']); # Récupération des données dans les autres fichiers xml $this->getCategories(path('XMLFILE_CATEGORIES')); $this->getStatiques(path('XMLFILE_STATICS')); $this->getTags(path('XMLFILE_TAGS')); $this->getUsers(path('XMLFILE_USERS')); # Récuperation des articles appartenant aux catégories actives $this->getActiveArts(); # Hook plugins eval($this->plxPlugins->callHook('plxMotorConstruct')); }
} //------------Start of install script--------------------------- // Use default session dir if not writable if (is_writable(GLPI_SESSION_DIR)) { setGlpiSessionPath(); } startGlpiSession(); error_reporting(0); // we want to check system before affraid the user. if (!isset($_SESSION["glpilanguage"]) || empty($_SESSION["glpilanguage"])) { $_SESSION["glpilanguage"] = "en_GB"; } if (isset($_POST["language"])) { $_SESSION["glpilanguage"] = $_POST["language"]; } loadLang($_SESSION["glpilanguage"]); if (!isset($_POST["install"])) { $_SESSION = array(); if (file_exists(GLPI_CONFIG_DIR . "/config_db.php")) { glpi_header(GLPI_ROOT . "/index.php"); die; } else { header_html("Select your language"); choose_language(); } } else { // DB clean if (isset($_POST["db_pass"])) { $_POST["db_pass"] = stripslashes($_POST["db_pass"]); $_POST["db_pass"] = rawurldecode($_POST["db_pass"]); $_POST["db_pass"] = stripslashes($_POST["db_pass"]);
* @license GNU/GPL, see LICENSE.txt * @description Article Rating **/ session_start(); define('_FINDEX_', 1); require '../../../system/jscore.php'; if (!isset($_POST['send'])) { alert('error', 'Access Denied!', true, true); die; } else { $red = $id = 0; $delay_time = time(); if (isset($_SESSION['COMMENT_DELAY'])) { $delay_time = $_SESSION['COMMENT_DELAY']; } loadLang('..'); //reCaptcha if ($delay_time - time() <= 0) { $privatekey = oneQuery('comment_setting', 'name', "'recaptcha_privatekey'", 'value'); $publickey = oneQuery('comment_setting', 'name', "'recaptcha_publickey'", 'value'); if (checkOnline() and !empty($_POST["recaptcha_challenge_field"]) and !empty($_POST["recaptcha_response_field"])) { $capthca = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($capthca->is_valid and checkOnline()) { $valid = 1; } } if (!@$_SESSION['ENABLE_CAPTCHA']) { $valid = true; if (!isset($_SESSION['captcha'])) { $captcha = true; } else {
$offsetrow = -1; } current_time(); if ($duree > 0 && $TPSCOUR >= $duree) { //on atteint la fin du temps imparti return TRUE; } } if ($DB->error()) { echo "<hr>" . $LANG['backup'][23] . " [{$formattedQuery}]<br>" . $DB->error() . "<hr>"; } $offsettable = -1; return TRUE; } //########################### Script start ################################ loadLang(); // Send UTF8 Headers header("Content-Type: text/html; charset=UTF-8"); echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'\n 'http://www.w3.org/TR/html4/loose.dtd'>"; echo "<html>"; echo "<head>"; echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>"; echo "<meta http-equiv='Content-Script-Type' content='text/javascript'>"; echo "<meta http-equiv='Content-Style-Type' content='text/css'>"; echo "<meta http-equiv='Content-Language' content='fr'>"; echo "<meta name='generator' content=''>"; echo "<meta name='DC.Language' content='fr' scheme='RFC1766'>"; echo "<title>Setup GLPI</title>"; // CSS echo "<link rel='stylesheet' href='../css/style_install.css' type='text/css' media='screen' >"; echo "</head>";
# Test sur le domaine et sur l'identification if (isset($_SESSION['domain']) and $_SESSION['domain'] != $session_domain or (!isset($_SESSION['user']) or $_SESSION['user'] == '')) { header('Location: auth.php?p=' . htmlentities($_SERVER['REQUEST_URI'])); exit; } } # On inclut les librairies nécessaires include_once PLX_CORE . 'lib/class.plx.date.php'; include_once PLX_CORE . 'lib/class.plx.glob.php'; include_once PLX_CORE . 'lib/class.plx.utils.php'; include_once PLX_CORE . 'lib/class.plx.msg.php'; include_once PLX_CORE . 'lib/class.plx.record.php'; include_once PLX_CORE . 'lib/class.plx.motor.php'; include_once PLX_CORE . 'lib/class.plx.admin.php'; include_once PLX_CORE . 'lib/class.plx.encrypt.php'; include_once PLX_CORE . 'lib/class.plx.medias.php'; include_once PLX_CORE . 'lib/class.plx.plugins.php'; include_once PLX_CORE . 'lib/class.plx.token.php'; # Echappement des caractères if ($_SERVER['REQUEST_METHOD'] == 'POST') { $_POST = plxUtils::unSlash($_POST); } # On impose le charset header('Content-Type: text/html; charset=' . PLX_CHARSET); # Creation de l'objet principal et premier traitement $plxAdmin = plxAdmin::getInstance(); # Chargement des fichiers de langue en fonction du profil de l'utilisateur connecté $lang = isset($_SESSION['lang']) ? $_SESSION['lang'] : $plxAdmin->aConf['default_lang']; loadLang(PLX_CORE . 'lang/' . $lang . '/admin.php'); # Hook Plugins eval($plxAdmin->plxPlugins->callHook('AdminPrepend'));
<?php /** * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2012 Fiyo CMS. * @license GNU/GPL, see LICENSE.txt **/ defined('_FINDEX_') or die('Access Denied'); //memuat file pendukung query dan fungsi lainya require_once '../../../../config.php'; require_once '../../../../system/query.php'; require_once '../../../../system/function.php'; require_once '../../../../system/user.php'; loadLang('../../../system'); //check table setting mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . FDBPrefix . "setting'")) or die; //set timezone $time = siteConfig('timezone'); if ($time) { date_default_timezone_set(siteConfig('timezone')); }
<?php /** * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE. **/ defined('_FINDEX_') or die('Access Denied'); //memuat file pendukung query dan fungsi lainya require_once '../config.php'; require_once '../system/query.php'; require_once '../system/function.php'; require_once '../system/user.php'; require_once '../system/site.php'; require_once 'function.php'; //check table setting $r = mysql_query("SHOW TABLES LIKE '" . FDBPrefix . "setting'"); mysql_num_rows($r) or die(alert("error", "Table setting is not found. Please check <b>DBPrefix</b> on file config.php!", true, true)); //set default timezone $time = siteConfig('timezone'); if ($time) { date_default_timezone_set(siteConfig('timezone')); } //memuat file bahasa jika ditemukan loadLang("system"); define('MetaDesc', siteConfig('site_desc')); define('MetaKeys', siteConfig('site_keys')); define('TitleValue', app_param('name')); //memuat file pendukung system dan file appss loadSystemApps();
include PLX_CORE . 'lib/class.plx.encrypt.php'; include PLX_CORE . 'lib/class.plx.plugins.php'; include PLX_CORE . 'lib/class.plx.token.php'; include PLX_ROOT . 'update/versions.php'; include PLX_ROOT . 'update/class.plx.updater.php'; # Chargement des langues $lang = DEFAULT_LANG; if (isset($_POST['default_lang'])) { $lang = $_POST['default_lang']; } if (!array_key_exists($lang, plxUtils::getLangs())) { $lang = DEFAULT_LANG; } loadLang(PLX_CORE . 'lang/' . $lang . '/core.php'); loadLang(PLX_CORE . 'lang/' . $lang . '/admin.php'); loadLang(PLX_CORE . 'lang/' . $lang . '/update.php'); # On vérifie que PHP 5 ou superieur soit installé if (version_compare(PHP_VERSION, '5.0.0', '<')) { header('Content-Type: text/plain charset=UTF-8'); echo utf8_decode(L_WRONG_PHP_VERSION); exit; } # Echappement des caractères if ($_SERVER['REQUEST_METHOD'] == 'POST') { $_POST = plxUtils::unSlash($_POST); } # Création de l'objet principal et lancement du traitement $plxUpdater = new plxUpdater($versions); plxUtils::cleanHeaders(); session_start(); # Control du token du formulaire
/** * EXIF translation. * * @param $key EXIF key name * @param $value EXIF key value * @return translated value dependend on key meaning and choosed language */ function exif_translation($exif) { // translate all exif fields if (is_array($exif)) { loadLang(); foreach ($exif as $key => $value) { $exif[$key] = exif_key_translation($key, $value); } } return $exif; }
/** * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2012 Fiyo CMS. * @license GNU/GPL, see LICENSE.txt * @description Article Rating **/ session_start(); define('_FINDEX_', 1); require '../../../system/jscore.php'; if (!isset($_POST['send'])) { alert('error', 'Access Denied!', true, true); die; } else { loadLang('../'); $to = $_POST['to']; $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $phone = $_POST['phone']; $post = $_POST['text']; $captcha = $_POST['captcha']; $send = $_POST['send']; if (isset($_SESSION['COMMENT_DELAY']) and $_SESSION['COMMENT_DELAY'] - time() > 0) { echo "{ \"status\":\"0\" , \"alert\":\"" . alert('error', You_alreay_sent_message) . "\"}"; } else { if (isset($name, $email, $post, $send, $to)) { $_SESSION['COMMENT_DELAY'] = 0; if (empty($name) or empty($email) or empty($post)) { echo "{ \"status\":\"0\" , \"alert\":\"" . alert('error', contact_Error) . "\"}";
# On inclut les librairies nécessaires include PLX_CORE . 'lib/class.plx.timezones.php'; include PLX_CORE . 'lib/class.plx.date.php'; include PLX_CORE . 'lib/class.plx.glob.php'; include PLX_CORE . 'lib/class.plx.utils.php'; include PLX_CORE . 'lib/class.plx.token.php'; # Chargement des langues $lang = DEFAULT_LANG; if (isset($_POST['default_lang'])) { $lang = $_POST['default_lang']; } if (!array_key_exists($lang, plxUtils::getLangs())) { $lang = DEFAULT_LANG; } loadLang(PLX_CORE . 'lang/' . $lang . '/install.php'); loadLang(PLX_CORE . 'lang/' . $lang . '/core.php'); # On vérifie que PHP 5 ou superieur soit installé if (version_compare(PHP_VERSION, '5.0.0', '<')) { header('Content-Type: text/plain charset=UTF-8'); echo utf8_decode(L_WRONG_PHP_VERSION); exit; } # On vérifie que PluXml n'est pas déjà installé if (file_exists(path('XMLFILE_PARAMETERS'))) { header('Content-Type: text/plain charset=UTF-8'); echo utf8_decode(L_ERR_PLUXML_ALREADY_INSTALLED); exit; } # Control du token du formulaire plxToken::validateFormToken($_POST); # Vérification de l'existence des dossiers médias
/** * 显示错误信息页面 */ function showError($sql = '') { global $db_charset, $timestamp, $_PBDEV; require_once loadLang('db'); $msg = $d_message['db_errno_' . $this->db_errorNo()]; if (!$msg) { $msg = $d_message['unknowError']; } $message = "<html>\n<head>\n"; $message .= "<meta content=\"text/html; charset={$db_charset}\" http-equiv=\"Content-Type\">\n"; $message .= "</head>\n"; $message .= "<body>\n"; $message .= "<p style=\"font-family: Verdana, Tahoma; font-size: 11px; background: #fff;\">\n"; if ($_PBDEV['debug']) { $message .= "<strong>PBDigg Info:</strong>" . $msg . "\n<br />"; $message .= "<strong>Time:</strong>" . gdate($timestamp, 'Y-m-d @ H:i') . "\n<br />"; $message .= "<strong>Script:</strong>http://" . $_SERVER['HTTP_HOST'] . $_PBDEV['REQUEST_URL'] . "\n<br />"; if ($sql) { $message .= "<strong>SQL:</strong><code>" . $sql . "</code>\n<br />"; } $message .= "<strong>MySQL Error Description:</strong>" . $this->db_errorMsg() . "\n<br />"; $message .= "<strong>MySQL Error Number:</strong>" . $this->db_errorNo() . "\n<br />"; } else { $message .= "<strong>PBDigg Info:</strong>" . $msg . "\n<br />"; } $message .= "</p>\n"; $message .= "</body>\n</html>"; echo $message; exit; }
<?php /** * @name Comment * @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE.txt * @description **/ defined('_FINDEX_') or die('Access Denied'); $db = new FQuery(); $db->connect(); loadLang(__DIR__); if (!defined('SEF_URL')) { $link = check_permalink('link', getLink(), 'link'); $go_link = FUrl . getLink() . "&pid={$_GET['pid']}"; } else { $link = @check_permalink('permalink', $_REQUEST['link'], 'link'); $go_link = FUrl . @$_REQUEST['link'] . SEF_EXT; } require 'entry_comment.php'; define('CAPTCHA', false); if (!CAPTCHA) { $valid = true; if (!isset($_SESSION['captcha'])) { $_SESSION['captcha'] = 99; } $_POST['secure'] = $_SESSION['captcha']; $_SESSION['ENABLE_CAPTCHA'] = false; }
protected function generateInvoiceData($data, array $client) { global $_LANG; if (!isset($_LANG['onappusersstatvirtualmachines'])) { require_once dirname(__DIR__) . '/onappusers.php'; } loadLang($client['language']); //check if invoice should be generated $fromTime = strtotime($this->fromDate); $tillTime = strtotime($this->tillDate); if ($fromTime >= $tillTime) { return false; } if ($client['dueDate'] == 1) { $dueDate = $this->dueDate; } else { $dueDate = date('Ymd', time() + $GLOBALS['CONFIG']['CreateInvoiceDaysBefore'] * 86400); } //check if the item should be taxed $taxed = empty($client['taxexempt']) && (int) $client['tax']; if ($taxed) { $taxrate = getTaxRate(1, $client['state'], $client['country']); $taxrate = $taxrate['rate']; } else { $taxrate = ''; } $timeZone = ' UTC' . ($this->timeZoneOffset >= 0 ? '+' : '-') . $this->timeZoneOffset / 3600; $this->fromDate = date($_LANG['onappusersstatdateformat'], $fromTime); $this->tillDate = date($_LANG['onappusersstatdateformat'], $tillTime); $invoiceDescription = array($_LANG['onappusersstatproduct'] . $client['packagename'], $_LANG['onappusersstatperiod'] . $this->fromDate . ' - ' . $this->tillDate . $timeZone); $invoiceDescription = implode(PHP_EOL, $invoiceDescription); $return = array('userid' => $client['client_id'], 'date' => $this->dueDate, 'duedate' => $dueDate, 'paymentmethod' => $client['paymentmethod'], 'taxrate' => $taxrate, 'sendinvoice' => true, 'itemdescription1' => $invoiceDescription, 'itemamount1' => 0, 'itemtaxed1' => $taxed); unset($data->total_cost); $i = 1; foreach ($data as $key => $value) { if ($value > 0) { $tmp = array('itemdescription' . ++$i => $_LANG['onappusers_invoice_' . $key], 'itemamount' . $i => $value, 'itemtaxed' . $i => $taxed); $return = array_merge($return, $tmp); } } if ($this->printEnabled) { print_r($return); } return $return; }