示例#1
0
<?php

require_once "../server/bootstrap.php";
UITools::setProfile($smarty);
$smarty->display('../templates/profile.tpl');
示例#2
0
    }
    $userRequest = new Request($_REQUEST);
    $session = SessionController::apiCurrentSession($userRequest);
    if ($session['valid']) {
        $smarty->assign("LOGGED_IN", "1");
        UITools::$IsLoggedIn = true;
        $smarty->assign("CURRENT_USER_USERNAME", $session["username"]);
        $smarty->assign("CURRENT_USER_EMAIL", $session["email"]);
        $smarty->assign("CURRENT_USER_IS_EMAIL_VERIFIED", $session["is_email_verified"]);
        $smarty->assign("CURRENT_USER_IS_ADMIN", $session["is_admin"]);
        $smarty->assign("CURRENT_USER_PRIVATE_CONTESTS_COUNT", $session["private_contests_count"]);
        $smarty->assign("CURRENT_USER_PRIVATE_PROBLEMS_COUNT", $session["private_problems_count"]);
        $smarty->assign("CURRENT_USER_AUTH_TOKEN", $session["auth_token"]);
        $smarty->assign("CURRENT_USER_GRAVATAR_URL_128", '<img src="https://secure.gravatar.com/avatar/' . md5($session["email"]) . '?s=92">');
        $smarty->assign("CURRENT_USER_GRAVATAR_URL_16", '<img src="https://secure.gravatar.com/avatar/' . md5($session["email"]) . '?s=16">');
        $smarty->assign("CURRENT_USER_GRAVATAR_URL_32", '<img src="https://secure.gravatar.com/avatar/' . md5($session["email"]) . '?s=32">');
        UITools::$isAdmin = $session["is_admin"];
        $userRequest["username"] = $session["username"];
    } else {
        $smarty->assign("CURRENT_USER_GRAVATAR_URL_128", '<img src="/media/avatar_92.png">');
        $smarty->assign("CURRENT_USER_GRAVATAR_URL_16", '<img src="/media/avatar_16.png">');
    }
    $lang = UserController::getPreferredLanguage($userRequest);
    if (defined("OMEGAUP_DEVELOPMENT_MODE") && OMEGAUP_DEVELOPMENT_MODE) {
        $smarty->force_compile = true;
        $smarty->caching = 0;
    }
    $smarty->configLoad(__DIR__ . "/../templates/" . $lang . ".lang");
}
// Load pager class
require_once 'libs/Pager.php';
<?php

require_once '../../server/bootstrap.php';
UITools::redirectToLoginIfNotLoggedIn();
UITools::redirectIfNoAdmin();
$smarty->display('../../templates/admin.changepassword.tpl');
示例#4
0
    $userRequest = new Request($_REQUEST);
    $session = SessionController::apiCurrentSession($userRequest);
    if ($session['valid']) {
        $smarty->assign('LOGGED_IN', '1');
        UITools::$IsLoggedIn = true;
        $smarty->assign('CURRENT_USER_USERNAME', $session['username']);
        $smarty->assign('CURRENT_USER_EMAIL', $session['email']);
        $smarty->assign('CURRENT_USER_IS_EMAIL_VERIFIED', $session['is_email_verified']);
        $smarty->assign('CURRENT_USER_IS_ADMIN', $session['is_admin']);
        $smarty->assign('CURRENT_USER_PRIVATE_CONTESTS_COUNT', $session['private_contests_count']);
        $smarty->assign('CURRENT_USER_PRIVATE_PROBLEMS_COUNT', $session['private_problems_count']);
        $smarty->assign('CURRENT_USER_AUTH_TOKEN', $session['auth_token']);
        $smarty->assign('CURRENT_USER_GRAVATAR_URL_128', '<img src="https://secure.gravatar.com/avatar/' . md5($session['email']) . '?s=92">');
        $smarty->assign('CURRENT_USER_GRAVATAR_URL_16', '<img src="https://secure.gravatar.com/avatar/' . md5($session['email']) . '?s=16">');
        $smarty->assign('CURRENT_USER_GRAVATAR_URL_32', '<img src="https://secure.gravatar.com/avatar/' . md5($session['email']) . '?s=32">');
        $smarty->assign('CURRENT_USER_GRAVATAR_URL_51', '<img src="https://secure.gravatar.com/avatar/' . md5($session['email']) . '?s=51">');
        UITools::$isAdmin = $session['is_admin'];
        $userRequest['username'] = $session['username'];
    } else {
        $smarty->assign('CURRENT_USER_GRAVATAR_URL_128', '<img src="/media/avatar_92.png">');
        $smarty->assign('CURRENT_USER_GRAVATAR_URL_16', '<img src="/media/avatar_16.png">');
    }
    $lang = UserController::getPreferredLanguage($userRequest);
    if (defined('OMEGAUP_DEVELOPMENT_MODE') && OMEGAUP_DEVELOPMENT_MODE) {
        $smarty->force_compile = true;
        $smarty->caching = 0;
    }
    $smarty->configLoad(__DIR__ . '/../templates/' . $lang . '.lang');
}
// Load pager class
require_once 'libs/Pager.php';