Ejemplo n.º 1
0
        $reqested_lang = filter::alfas($_GET['lang']);
    } elseif (!empty($_POST['lang'])) {
        $reqested_lang = filter::alfas($_POST['lang']);
    }
    $lang = new phpos_languages();
    if (!empty($reqested_lang)) {
        if ($lang->lang_exists($reqested_lang)) {
            $login_language = $reqested_lang;
            $_SESSION['login_lang'] = $reqested_lang;
        }
    }
    $lang->lang_load($login_language);
} else {
    $usr = new phpos_users();
    $config = new phpos_config();
    if ($usr->user_is_logged()) {
        $config->set_id_user($usr->get_logged_user());
    }
    $usr->get_logged_user();
    $access_level = $usr->get_access_level();
    if (!empty($_GET['lang'])) {
        //$PHPOS_GLOBALCONFIG['lang'] = strtolower($_GET['lang']);
        //$PHPOS_USERCONFIG['lang'] = strtolower($_GET['lang']);
        $requested_lang = trim(filter::alfas(strtolower($_GET['lang'])));
        if ($langs->lang_exists($requested_lang)) {
            if ($config->get_global('demo_mode') != 1 || $access_level == 3) {
                $config->update_user('lang', $requested_lang);
            } else {
                $demo_lang = trim($requested_lang);
                $_SESSION['demo_lang'] = $demo_lang;
            }
Ejemplo n.º 2
0
function myconfig($config_name, $config_value = null)
{
    $usr = new phpos_users();
    $config = new phpos_config();
    if ($usr->user_is_logged()) {
        $config->set_id_user($usr->get_logged_user());
        return $config->get_user($config_name);
    }
}