Пример #1
0
    {
        self::htmlAboutText(true);
    }
}
// End of class ezUser
// Is this script included in another page or is it the HTTP target itself?
if (basename($_SERVER['SCRIPT_NAME']) === basename(__FILE__)) {
    // This script has been called directly by the browser, so check what it has sent
    if (is_array($_POST) && array_key_exists(ezUser::ACTION, $_POST)) {
        switch ((string) $_POST[ezUser::ACTION]) {
            case ezUser::ACTION_SIGNIN:
                ezUser::signIn(cast('array[string]string', $_POST));
                ezUser::getSignInResults();
                break;
            case ezUser::ACTION_VALIDATE:
                ezUser::save($_POST);
                ezUser::getAccountForm(ezUser::ACCOUNT_MODE_RESULT, $_POST[ezUser::TAGNAME_NEWUSER] === ezUser::STRING_TRUE, $_POST[ezUser::TAGNAME_WIZARD] === ezUser::STRING_TRUE);
                break;
            default:
                ezUser::getResultForm(ezUser::RESULT_UNKNOWNACTION);
                break;
        }
    } else {
        if (is_array($_GET) && count($_GET) > 0) {
            ezUser::doActions(cast('array[string]string', $_GET));
        } else {
            ezUser::getAbout();
            // Nothing useful in $_GET or $_POST, so give a friendly greeting
        }
    }
}
Пример #2
0
    {
        self::htmlAboutText(true);
    }
}
// End of class ezUser
// Is this script included in another page or is it the HTTP target itself?
if (basename($_SERVER['SCRIPT_NAME']) === basename(__FILE__)) {
    // This script has been called directly by the browser, so check what it has sent
    if (is_array($_POST) && array_key_exists(ezUser::ACTION, $_POST)) {
        switch ((string) $_POST[ezUser::ACTION]) {
            case ezUser::ACTION_SIGNIN:
                ezUser::signIn($_POST);
                ezUser::getControlPanel();
                break;
            case ezUser::ACTION_VALIDATE:
                ezUser::save($_POST);
                ezUser::getAccountForm(ezUser::ACCOUNT_MODE_RESULT, $_POST[ezUser::TAGNAME_NEWUSER] === ezUser::STRING_TRUE, $_POST[ezUser::TAGNAME_WIZARD] === ezUser::STRING_TRUE);
                break;
            default:
                ezUser::getResultForm(ezUser::RESULT_UNKNOWNACTION);
                break;
        }
    } else {
        if (is_array($_GET) && count($_GET) > 0) {
            ezUser::doActions($_GET);
        } else {
            ezUser::getAbout();
            // Nothing useful in $_GET or $_POST, so give a friendly greeting
        }
    }
}