exec($sql); return (intval($res) > 0); } public static function resetLoginAttempts($login) { global $CC_CONFIG; $con = Propel::getConnection(); $sql = "UPDATE ".$CC_CONFIG['subjTable']." SET login_attempts = '0'" ." WHERE login='$login'"; $res = $con->exec($sql); return true; } public static function getLoginAttempts($login) { global $CC_CONFIG; $con = Propel::getConnection(); $sql = "SELECT login_attempts FROM ".$CC_CONFIG['subjTable']." WHERE login='$login'"; $res = $con->query($sql)->fetchColumn(0); return ($res !== false) ? $res : 0; } } // class Subjects