This repository has been archived on 2020-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
ildus/lib/ildus/server/account.rb

54 lines
1.0 KiB
Ruby

# = ildus/server/account - server account library
#
# Copyright (C) 2005 Paul van Tilburg <paul@luon.net>
#
# Ildus is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
require 'yaml'
module Ildus
class Server
class Account
attr_reader :user, :pass
def self.register_account(user, pass)
end
def self.unregister_account(user, pass)
end
def initialize
@user = nil
@pass = nil
@auth = false
end
def user=(username)
raise Handler::AlreadyAuthError if @auth
@user = username
end
def pass=(password)
raise Handler::AlreadyAuthError if @auth
@pass = password
## STUB
@auth = (password == "foo")
##
end
def authenticated?
@auth
end
end # class Account
end # class Server
end # module Ildus