Esempio n. 1
0
    new System();
} catch (Exception $e) {
    echo $e->getMessage();
}
Session::start();
System::gZip();
if (isset($_POST['login'])) {
    if (!isset($_POST['token']) || !Token::isExist($_POST['token'])) {
        // VALIDATE ALL
        $alertred[] = TOKEN_NOT_EXIST;
    }
    if (Xaptcha::isEnable()) {
        if (!isset($_POST['g-recaptcha-response']) || $_POST['g-recaptcha-response'] == '') {
            $alertred[] = "Please insert the Captcha";
        }
        if (!Xaptcha::verify($_POST['g-recaptcha-response'])) {
            $alertred[] = "Your Captcha is not correct.";
        }
    }
    if (!isset($alertred)) {
        /*check if username is exist or not */
        $username = Typo::cleanX(Typo::strip($_POST['username']));
        $sql = sprintf("SELECT `userid`,`status`,`activation` FROM `user` WHERE `userid` = '%s'", $username);
        $usr = Db::result($sql);
        $c = Db::$num_rows;
        //echo $c;
        //print_r($usr);
        if ($c == "1") {
            //$alertgreen = "";
            // check if user is active
            if ($usr[0]->status == '1') {