Esempio n. 1
0
def do_first_time_setup(cookie, username, password):
    # Checks.
    if cookie != staff.crypt_pass(config.ADMIN_PASS, local.environ["REMOTE_ADDR"]):
        return make_first_time_setup_gateway()
    if not username:
        raise WakaError("Missing username.")
    if not password:
        raise WakaError("Missing password.")

    staff.add_staff(username, password, staff.ADMIN, [])

    board = local.environ["waka.board"]
    return make_http_forward(misc.make_script_url(task="loginpanel", board=board.name), config.ALTERNATE_REDIRECT)
Esempio n. 2
0
def add_staff_proxy(cookie, mpass, usertocreate, passtocreate, account, reign):
    user = staff.StaffMember.get_from_cookie(cookie)

    if user.account != staff.ADMIN:
        raise WakaError(strings.INSUFFICIENTPRIVILEGES)

    if account == staff.ADMIN and mpass != config.ADMIN_PASS:
        raise WakaError("Incorrect management password.")

    staff.add_staff(usertocreate, passtocreate, account, reign)

    board = local.environ["waka.board"]
    return make_http_forward(misc.make_script_url(task="staff", board=board.name), config.ALTERNATE_REDIRECT)
Esempio n. 3
0
def add_staff_proxy(admin, mpass, usertocreate, passtocreate, account, reign):
    user = staff.check_password(admin)

    if user.account != staff.ADMIN:
        raise WakaError(strings.INUSUFFICENTPRIVLEDGES)

    if account == staff.ADMIN and mpass != config.ADMIN_PASS:
        raise WakaError('Incorrect management password.')

    staff.add_staff(usertocreate, passtocreate, account, reign)

    board = local.environ['waka.board']
    return make_http_forward(misc.make_script_url(task='staff',
        board=board.name), config.ALTERNATE_REDIRECT)
Esempio n. 4
0
def do_first_time_setup(admin, username, password):
    # Checks.
    if admin != staff.crypt_pass(config.ADMIN_PASS,
                                 local.environ['REMOTE_ADDR']):
        return make_first_time_setup_gateway()
    if not username:
        raise WakaError('Missing username.')
    if not password:
        raise WakaError('Missing password.')

    staff.add_staff(username, password, staff.ADMIN, [])

    board = local.environ['waka.board']
    return make_http_forward(misc.make_script_url(task='loginpanel',
        board=board.name), config.ALTERNATE_REDIRECT)
Esempio n. 5
0
def add_staff_proxy(admin, mpass, usertocreate, passtocreate, account, reign):
    user = staff.check_password(admin)

    if user.account != staff.ADMIN:
        raise WakaError(strings.INSUFFICIENTPRIVILEGES)

    if account == staff.ADMIN and mpass != config.ADMIN_PASS:
        raise WakaError('Incorrect management password.')

    staff.add_staff(usertocreate, passtocreate, account, reign)

    board = local.environ['waka.board']
    return make_http_forward(
        misc.make_script_url(task='staff', board=board.name),
        config.ALTERNATE_REDIRECT)
Esempio n. 6
0
def do_first_time_setup(admin, username, password):
    # Checks.
    if admin != staff.crypt_pass(config.ADMIN_PASS,
                                 local.environ['REMOTE_ADDR']):
        return make_first_time_setup_gateway()
    if not username:
        raise WakaError('Missing username.')
    if not password:
        raise WakaError('Missing password.')

    staff.add_staff(username, password, staff.ADMIN, [])

    board = local.environ['waka.board']
    return make_http_forward(
        misc.make_script_url(task='loginpanel', board=board.name),
        config.ALTERNATE_REDIRECT)