コード例 #1
0
ファイル: run.py プロジェクト: d2emon/abermud
def check_host(host):
    '''
    Check we are running on the correct host
    see the notes about the use of flock();
    and the affects of lockf();
    '''
    assert User.host() == host, "AberMUD is only available on {}, not on {}".format(host, User.host())
コード例 #2
0
ファイル: login.py プロジェクト: d2emon/abermud
def login(username=None):
    '''
    Does all the login stuff
    The whole login system is called from this
    '''
    # Check if banned first
    b = User.chkbnid(User.host())
    # cuserid(NULL));
    logger.debug("BANNED %d", b)

    if username:
        username = username.lower()

    user = User.by_username(username)
    if user:
        authenticate(user)
        return user

    # Get the user name
    user = None
    while not user:
        user = input_username(username)
        username = ''

    if user.id:
        # Password checking
        authenticate(user)
    else:
        register(user)
    cls()
    return user