Esempio n. 1
0
function tbxLogin()
{
    global $t;
    AuthenticateUser::Login();
    $v = Validator::Create();
    $v->Register(AuthenticateUser::Authenticated(), Validator_Type::IS_TRUE, AuthenticateUser::GetError());
    if (!$v->Validate()) {
        $t->Assign('g_errors', $v->GetErrors());
        $t->Assign('g_form', $_REQUEST);
        return tbxDisplayLogin();
    }
    if (empty($_REQUEST['referrer']) || stristr($_REQUEST['referrer'], Config::Get('base_url')) === false) {
        $t->Assign('g_logged_in', true);
        tbxDisplayMyAccount(true);
    } else {
        header('Location: ' . $_REQUEST['referrer']);
    }
}