Beispiel #1
0
 public function __construct()
 {
     $this->loadTemplate();
     $this->language = setLanguage($this->languages);
     $this->readCurrentSite();
     $this->replaceCurrentSite();
     $this->handleRegisterPopup();
     $this->switchSite();
 }
Beispiel #2
0
			<h1>Install Symphony <em>Version ' . kVERSION . '</em></h1>
			<h2>Outstanding Requirements</h2>
			<p>Symphony needs the following requirements satisfied before installation can proceed.</p>

			<dl>
				<dt><abbr title="PHP: Hypertext Pre-processor">PHP</abbr> 5.2 or above</dt>
				<dd>Symphony needs a recent version of <abbr title="PHP: Hypertext Pre-processor">PHP</abbr>.</dd>
			</dl>

		</body>

</html>';
    die($code);
}
// Check and set language
if (setLanguage() === NULL) {
    $code = '<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<title>Outstanding Requirements</title>
		<link rel="stylesheet" type="text/css" href="' . kINSTALL_ASSET_LOCATION . '/main.css"/>
		<script type="text/javascript" src="' . kINSTALL_ASSET_LOCATION . '/main.js"></script>
	</head>
		<body>
			<h1>Install Symphony <em>Version ' . kVERSION . '</em></h1>
			<h2>Outstanding Requirements</h2>
			<p>Symphony needs at least one language file to be present before installation can proceed.</p>

		</body>
Beispiel #3
0
<?php

session_start();
define('URL_PREFIX', '../');
require URL_PREFIX . 'fcms.php';
setLanguage();
isLoggedIn('inc/');
$currentUserId = (int) $_SESSION['fcms_id'];
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . T_pgettext('Language Code for this translation', 'lang') . '" lang="' . T_pgettext('Language Code for this translation', 'lang') . '">
<head>
<title>' . getSiteName() . ' - ' . T_('powered by') . ' ' . getCurrentVersion() . '</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="Ryan Haudenschilt" />
<link rel="stylesheet" type="text/css" href="../ui/themes/default/style.css"/>
<link rel="shortcut icon" href="../ui/favicon.ico"/>';
// TODO
// Move css to fcms-core
echo '
<style type="text/css">
html { background: #fff; }
body { width: 350px; margin: 0; padding: 15px; text-align: left; font: 14px/20px Verdana, Tahoma, Arial, sans-serif; border: none; background: #fff; }
h1 { font: bold 20px/30px Verdana, Tahoma, Arial, sans-serif; }
h2 { font: bold 18px/30px Verdana, Tahoma, Arial, sans-serif; }
h3 { font: bold 16px/30px Verdana, Tahoma, Arial, sans-serif; }
</style>
</head>
<body>
<h1>' . T_('BBCode Help') . '</h1>
<p>' . T_('BBCode is a easy way to format text. Check out the examples below, the first line shows the bbcode and the second line show the output.') . '</p>
Beispiel #4
0
<?php 
require_once "includes/php_utils.php";
//require './vendor/autoload.php';
// i18n:
$language = setLanguage();
$nameErr = $emailErr = "";
$clientName = defaultVal($_SESSION, "clientName", "");
$clientEmail = defaultVal($_SESSION, "clientEmail", "");
$clientComment = defaultVal($_SESSION, "clientComment", "");
// The form has been submitted.  Do error correction, and act on data if it's good
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    echo 'Form got submitted' . "<br>";
    // Verify client name
    $clientName = filter_input(INPUT_POST, 'clientName', FILTER_SANITIZE_STRING);
    if (empty($clientName)) {
        $nameErr = _("nom_obligatoire");
    } else {
        if (!preg_match("/^[a-zA-Z0-9 .]*\$/", $clientName)) {
            $nameErr = _("courriel_chars");
            $clientName = "";
            //$nameErr = "Only letters, numbers and white space allowed";
        }
    }
    // Verify client email
    $clientEmail = filter_input(INPUT_POST, 'clientEmail', FILTER_SANITIZE_STRING);
    if (empty($clientEmail)) {
        $emailErr = _("courriel_obligatoire");
    } else {
        if (!filter_var($clientEmail, FILTER_VALIDATE_EMAIL)) {
            $emailErr = _("courriel_invalide");
Beispiel #5
0
    $bestLangPageId = $multilinguallib->selectLangObj($type, $pageId, $_REQUEST['language']);
    if ($pageId != $bestLangPageId) {
        if (!empty($param['page_id'])) {
            $orig_url = preg_replace('/(.*[&?]page_id=)' . $pageId . '(.*)/', '${1}' . $bestLangPageId . '$2', $orig_url);
        } elseif (!empty($param['articleId'])) {
            $orig_url = preg_replace('/(.*[&?]articleId=)' . $pageId . '(.*)/', '${1}' . $bestLangPageId . '$2', $orig_url);
        } else {
            $newPage = urlencode($tikilib->get_page_name_from_id($bestLangPageId));
            $orig_url = preg_replace('/(.*[&?]page=)' . preg_quote($page) . '(.*)/', '${1}' . "{$newPage}" . '$2', $orig_url);
            $orig_url = preg_replace('/(.*)(tiki-index.php)$/', "\$1\$2?page={$newPage}", $orig_url);
        }
    }
    $orig_url = preg_replace('/(.*)no_bl=y&(.*)/', '$1$2', $orig_url);
    $orig_url = preg_replace('/(.*)&no_bl=y(.*)/', '$1$2', $orig_url);
    if ($prefs['feature_sefurl'] == 'y') {
        include_once 'tiki-sefurl.php';
        $orig_url = filter_out_sefurl($orig_url);
    }
    if ($item_url) {
        if ($prefs['feature_sefurl'] == 'y') {
            $orig_url = $orig_url . "?" . $item_url;
        } elseif (!strstr($_SERVER['HTTP_REFERER'], 'tiki-index.php') && !strstr($_SERVER['HTTP_REFERER'], 'tiki-read_article.php')) {
            $orig_url = $orig_url . "&" . $item_url;
        }
    }
}
if (isset($_GET['language'])) {
    setLanguage($_GET['language']);
}
header("location: {$orig_url}");
exit;
Beispiel #6
0
                $smarty->assign('email', $_REQUEST['user']);
            } else {
                $smarty->assign('email', $info['email']);
            }
            $smarty->assign('mid', 'tiki-change_password.tpl');
            $smarty->display("tiki.tpl");
            die;
        } else {
            $user = $_REQUEST['user'];
            $userAutoLoggedIn = TRUE;
            $_SESSION["{$user_cookie_site}"] = $user;
            TikiLib::lib('menu')->empty_menu_cache();
        }
    }
    if ($language = $tikilib->get_user_preference($user, 'language')) {
        setLanguage($language);
    }
    if (!empty($prefs['url_after_validation']) && !$wasAdminValidation) {
        $target = $prefs['url_after_validation'];
        $access->redirect($target);
    } elseif ($userAutoLoggedIn == TRUE) {
        $access->redirect($prefs['tikiIndex'], tra("Account validated successfully."));
    } else {
        $smarty->assign('msg', tra("Account validated successfully."));
        $smarty->assign('mid', 'tiki-information.tpl');
        $smarty->display("tiki.tpl");
        die;
    }
} else {
    if ($error == PASSWORD_INCORRECT) {
        $error = tra("Invalid username or password");
Beispiel #7
0
ob_start();
// initialize
require _base_ . '/lib/lib.bootstrap.php';
Boot::init(BOOT_DATETIME);
// not a pagewriter but something similar
$GLOBALS['operation_result'] = '';
if (!function_exists("docebo_out")) {
    function docebo_cout($string)
    {
        $GLOBALS['operation_result'] .= $string;
    }
}
require_once _adm_ . '/lib/lib.permission.php';
require_once _base_ . '/lib/lib.pagewriter.php';
//--- here the specific code ---------------------------------------------------
setLanguage('english');
function getReportRecipients($id_rep)
{
    //get month, day
    $arr_days = array();
    $arr_months = array();
    $output = array();
    //check for daily
    $recipients = array();
    $qry = "SELECT * FROM %lms_report_schedule WHERE period LIKE '%day%' AND id_report_filter={$id_rep} AND enabled = 1";
    $res = sql_query($qry);
    while ($row = sql_fetch_assoc($res)) {
        $qry2 = "SELECT id_user FROM %lms_report_schedule_recipient WHERE id_report_schedule=" . $row['id_report_schedule'];
        $res2 = sql_query($qry2);
        while (list($recipient) = sql_fetch_row($res2)) {
            $recipients[] = $recipient;
Beispiel #8
0
         require_once "libs/contentManager.php";
         $oRequest = new stdClass();
         $oRequest->request = $oPage->path;
         $aInit['session']->request = $oRequest;
         $html = _getPage($aInit, $oPage->path);
         $aInit['session']->last_request = $oPage->path;
         $aInit['memcache']->set($aInit['session']->id, $aInit['session']);
         echo $html;
     })->setName($oPage->path);
 }
 // build the language and country route
 $locales = $aInit['memcache']->get(APP_ID . '_locales');
 foreach ($locales as $locale) {
     $app->get('/' . $locale, function () use($app, $aInit, $locale) {
         _setLocale($aInit, $locale);
         setLanguage($aInit, substr($locale, 0, 2));
         // reload the page with the last loaded page
         require_once "libs/contentManager.php";
         $oRequest = new stdClass();
         $oRequest->request = $aInit['session']->last_request;
         $aInit['session']->request = $oRequest;
         $html = _getPage($aInit, $oRequest->request);
         echo $html;
     })->setName('/' . $locale);
 }
 $countries = $aInit['memcache']->get(APP_ID . '_countries');
 foreach ($countries as $country) {
     $app->get('/' . $country, function () use($app, $aInit, $country) {
         setCountry($aInit, $country);
         // reload the page with the last loaded page
         require_once "libs/contentManager.php";
Beispiel #9
0
/**
 * init 
 * 
 * @param string $dir 
 * 
 * @return void
 */
function init($dir = '')
{
    setLanguage();
    isLoggedIn($dir);
    checkScheduler($dir);
}
Beispiel #10
0
/**
 *Starts Orongo! :) 
 * @param String $paramCurrentPage the current page
 */
function startOrongo($paramCurrentPage = 'anonymous')
{
    session_start();
    define("ROOT", dirname(__FILE__));
    define("LIB", ROOT . "/lib");
    define("ADMIN", ROOT . "/orongo-admin");
    define("CONFIG", ROOT . "/config.php");
    define('RANK_ADMIN', 3);
    define('RANK_WRITER', 2);
    define('RANK_USER', 1);
    define('ARTICLE_NOT_EXIST', 2100);
    define('PAGE_NOT_EXIST', 3100);
    define('USER_NOT_EXIST', 4100);
    define('COMMENT_NOT_EXIST', 5100);
    error_reporting(E_ALL);
    if (file_exists("orongo-install.php")) {
        die("If you didn't install OrongoCMS yet, proceed to the <a href='orongo-install.php'>installer</a><br/>If you installed it, please delete orongo-install.php");
    }
    if (!file_exists(CONFIG)) {
        die("config.php (" . CONFIG . ") was missing!");
    }
    require_once CONFIG;
    require LIB . '/function_load.php';
    try {
        load(LIB);
    } catch (Exception $e) {
        die($e->getMessage());
    }
    setDatabase(new Database(CONFIG));
    try {
        setLanguage(new Language(ADMIN . '/lang/' . Settings::getLanguageName()));
    } catch (Exception $e) {
        $msgbox = new MessageBox();
        $msgbox->bindException($e);
        die($msgbox->getImports() . $msgbox->toHTML());
    }
    setCurrentPage($paramCurrentPage);
    $style = null;
    try {
        $style = Settings::getStyle();
    } catch (Exception $e) {
        $msgbox = new MessageBox();
        $msgbox->bindException($e);
        die($msgbox->getImports() . $msgbox->toHTML());
    }
    setMenu(new Menu());
    setStyle($style);
    setDisplay(new Display($style->getStylePath()));
    setUser(handleSessions());
    if (defined('HACK_PLUGINS') && HACK_PLUGINS == true) {
        Plugin::hackKeys();
    }
    try {
        setPlugins(Plugin::getActivatedPlugins('orongo-admin/'));
    } catch (Exception $e) {
        $msgbox = new MessageBox();
        $msgbox->bindException($e);
        getDisplay()->addObject($msgbox);
    }
    //getLanguage()->setTempLanguage(ADMIN . '/lang/en_US');
    OrongoDefaultEventHandlers::init();
}
Beispiel #11
0
} elseif ($_GET['action'] == 'setLowPriorityUserInformation') {
    setLowPriorityUserInformation($_SESSION['user']['id'], $_POST['statusMessage'], $_POST['imageId']);
} elseif ($_GET['action'] == 'searchMessages') {
    searchMessages($_POST['string'], $_POST['caseSensitive'], (int) $_POST['userId']);
} elseif ($_GET['action'] == 'setTopic') {
    setTopic($_POST['topic'], $_SESSION['user']['id']);
} elseif ($_GET['action'] == 'setChatName') {
    setChatName($_POST['chatName'], $_SESSION['user']['id']);
} elseif ($_GET['action'] == 'setChatImage') {
    setChatImage($_POST['image'], $_SESSION['user']['id']);
} elseif ($_GET['action'] == 'getChatImage') {
    getChatImage();
} elseif ($_GET['action'] == 'getChatInformation') {
    getChatInformation();
} elseif ($_GET['action'] == 'setLanguage') {
    setLanguage($_SESSION['user']['id'], $_POST['language']);
} elseif ($_GET['action'] == 'setIsTyping') {
    setIsTyping($_SESSION['user']['id'], $_POST['isTyping']);
} elseif ($_GET['action'] == 'checkUserActivity') {
    checkUserActivity($_SESSION['user']['id']);
} elseif ($_GET['action'] == 'getUser') {
    getUser();
} elseif ($_GET['action'] == 'upload') {
    uploadFile($_FILES['files'], $_SESSION['user']['id'], $_POST['share'], $_POST['uploadType']);
} elseif ($_GET['action'] == 'pingServer') {
    printJson('{"running": true}');
} elseif ($_GET['action'] == 'shareUploadedFile') {
    shareAlreadyUploadedFile($_POST['fileId'], $_SESSION['user']['id']);
} elseif ($_GET['action'] == 'getRecentlyEditedMessages') {
    getRecentlyEditedMessages();
}
Beispiel #12
0
<?php

if (isset($_GET['js'])) {
    $jsFileName = $_GET['js'];
    include 'class/template.class.php';
    include 'include/functions.inc.php';
    $language = setLanguage(array('en', 'de'));
    $js = new Template();
    $js->setFolder('js/');
    $js->setFileExtension('.js');
    $js->readTpl($jsFileName);
    $js->tplReplace('lang', $language);
    $js->translateTemplate();
    $js->printTemplate();
}
Beispiel #13
0
 */
function err_handler_stathtml($errno, $errmsg, $filename, $linenum)
{
    $date = date('Y-m-d H:i:s (T)');
    $err = "{$date}\r\n";
    $err .= "{$errmsg}\r\n";
    $err .= "{$filename}\r\n";
    $err .= "on line: {$linenum}\r\n";
    $err .= "\r\n\r\n";
    file_put_contents('./app/log/html5.log', $err, FILE_APPEND);
}
# Текущий URL кабинета
$urlHost = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'];
# Создали экземпляр класса SystemClass
$systemClass = new SystemsClass();
# Получаем массив с полными путями для запросов к бекенду
$billLink = $systemClass->getBillLink($urlHost);
# Получаем входные Get/Post
$paramsInput = $systemClass->get_input_data();
# Создали экземпляр класса CabinetClass
$cabinetClass = new CabinetClass($billLink, $paramsInput);
# Выбор локализации:
setLanguage($cabinetClass->_attributesOut);
# Start обработчика запроса и информации
$cabinetClass->proceedRequest();
# Страница которую необходимо вывести на экран
$page = $cabinetClass->_outPage;
# Вывод шаблона
$tpl = new TemplateClass($cabinetClass->_attributesOut['config']['path_template']);
$tpl->set('val', $cabinetClass->attributesArrayOut());
$tpl->display($page);
Beispiel #14
0
/**
 * Collect the available languages (translations) and return those in an array.
 */
function GetAvailableLanguages()
{
    $sl = array();
    if ($handle = opendir(BASE_PATH . '/lib/languages')) {
        while (false !== ($file = readdir($handle))) {
            // Filter out irrelevant files && dirs
            if ($file != "." && $file != ".." && strmatch_tail($file, ".inc.php")) {
                $f = substr($file, 0, strpos($file, '.'));
                $sl[$f] = setLanguage($f);
                // making sure language support is indeed in sync in code and definition files:
                if ($sl[$f]['lang'] != $f) {
                    die("CCMS code has not been updated to support language: language code=" . $f);
                }
            }
        }
    }
    return $sl;
}
Beispiel #15
0
        $smarty->refreshLanguage();
        return $tikilib->set_user_preference($user, 'language', $localeIdentifier);
    } else {
        return false;
    }
}
if ($prefs['feature_multilingual'] != 'y') {
    // change_language depends on feature_multilingual.
    $prefs['change_language'] = 'n';
}
if ($prefs['change_language'] == 'y') {
    // $noSwitchLang = true; // Uncomment to disable switchLang
    if (isset($_GET['switchLang']) && !isset($noSwitchLang)) {
        // Special feature to allow creating Tiki links that also permanently switch the language of the user following the link.
        // Tiki does not create such links. See http://doc.tiki.org/i18n+Admin#Goodies
        setLanguage($_GET['switchLang']);
    } elseif ($prefs['feature_detect_language'] == 'y' and !$tikilib->userHasPreference('language')) {
        // Detect browser language
        $browser_language = detect_browser_language();
        if (isValidLocale($browser_language)) {
            $prefs['language'] = $browser_language;
        }
    }
} else {
    $prefs['language'] = $prefs['site_language'];
}
if (!isValidLocale($prefs['language'])) {
    // Override broken user locales
    setLanguage($prefs['site_language']);
}
TikiLib::lib('multilingual')->setupBiDi();
Beispiel #16
0
    }
    return $out;
}
if (isset($_REQUEST["lang"])) {
    $lang_q = array($_REQUEST["lang"] => '1');
    $lang = $_REQUEST["lang"];
} else {
    $lang_q = setLanguage();
}
if (isset($_REQUEST["page"])) {
    $page = escapeshellcmd(htmlentities($_REQUEST["page"]));
    $file = selectPage($lang_q, $page);
    if (!file_exists($file)) {
        header('HTTP/1.0 404 Not Found', 404);
        if (empty($_SERVER["HTTP_REFERER"]) || empty($_SERVER["REQUEST_URI"])) {
            header("Location: /");
        } else {
            echo "<html><head><title>404</title><head>";
            echo "<body>404 error - broken link</body></html>";
            $to = "webmaster";
            $subject = "404 error";
            $content = "\nA 404 error has occurred on the website : may you fix it ?\nFrom :  " . $_SERVER["HTTP_REFERER"] . "\nTo : " . $_SERVER["REQUEST_URI"] . "\nAt : " . date("D M j Y g:i:s a T" . "\nUser-agent : " . $_SERVER["HTTP_USER_AGENT"]);
            @mail($to, $subject, escapeshellcmd($content), "svn-build");
        }
        die;
    }
} else {
    $page = "index";
    $lang_q = setLanguage();
    $file = selectPage($lang_q, $page);
}
    case "selectMain":
        $_SESSION['current_main_menu'] = (int) $_GET['idMain'];
        $first_page = firstPage($_SESSION['current_main_menu']);
        if ($first_page['modulename'] != '') {
            Util::jump_to('index.php?modname=' . $first_page['modulename'] . '&op=' . $first_page['op'] . '&sel_module=' . $first_page['idModule']);
        }
        break;
        //change language for register user
    //change language for register user
    case "registerconfirm":
        setLanguage($_POST['language']);
        break;
    case "registerme":
        list($language_reg) = sql_fetch_row(sql_query("\r\n\t\tSELECT language\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_user_temp \r\n\t\tWHERE random_code = '" . $_GET['random_code'] . "'"));
        if ($language_reg != '') {
            setLanguage($language_reg);
        }
        break;
}
// special operation
$sop = importVar('sop', false, '');
if ($sop) {
    if (is_array($sop)) {
        $sop = key($sop);
    }
    switch ($sop) {
        case "setcourse":
            $id_c = Get::req('sop_idc', DOTY_INT, 0);
            if (isset($_SESSION['idCourse']) && $_SESSION['idCourse'] != $id_c) {
                TrackUser::closeSessionCourseTrack();
                unset($_SESSION['idCourse']);
Beispiel #18
0
$pdlc->sortElements();
$elements = $pdlc->getElements();
/* So, now the ehm.. 'GUI' part...
 * At this line you probably would ask, why there is no GUI class or
 * something, but just a bunch of more or less useful functions.
 * The best reason is, that the html template part of pdirl was the best
 * example to show how syntax higlighting can look like a code LSD trip.
 * Everytime you would have to use "$pdirl->" and "$pdirlView ->" etc...
 * The other reason is, that the code and the template weren't
 * understandable, so I made them simpler.
 * For GUI configuration use $GUIconf istead of $conf.
 * $GUIconf has default values if they are empty in $conf
 */
$GUIconf = defaultGUIConfiguration($conf);
// Set GNU gettext to the current language
if (!setLanguage($GUIconf['language'])) {
    die('No translation avaible for "' . $GUIconf['language'] . '". Please	look at <a href="https://translations.launchpad.net/pdirl">translations.launchpad.net/pdirl</a>\\ if pdirl was translated in your language yet.');
}
// Get elements and add human readable variables e.g. size, mtime etc.
addHumanInformation($elements);
// returns an array for the directories and another for the files.
seperateDirectoriesAndFiles($elements);
/* if they are no files and countOnly is activated we will remove
 * the "Last modification" column
 */
$hideMTime = empty($elements['files']) && $pdlc->countElements;
// glues the aforementioned arrays
if (!empty($elements['directories']) || !empty($elements['files'])) {
    $elements = array_merge($elements['directories'], $elements['files']);
} else {
    $elements = array();