Пример #1
0
def register():
    """
    Registers a new user to service.
    """
    #only Karsten is allowed to add a new user
    if current_user.get_email() != "*****@*****.**":
        return redirect(url_for('index'))

    return render_template('add_user.html', tab="", date=datetime.now())
Пример #2
0
def register():
    '''
    Registers a new user to service.
    ''' 
    #only Karsten is allowed to add a new user
    if current_user.get_email() != "*****@*****.**":
        return redirect(url_for('index'))
        
    return render_template('add_user.html',
                           tab="", date = datetime.now())        
Пример #3
0
def is_administrator(map_defn):
    email = current_user.get_email()
    administrators = map_defn.get().get('administrators')
    # for now it's more sane to not lock anyone out if there are no admins
    # eg. treat as public
    if administrators is None:
        return True
    administrators = administrators.strip()
    if administrators == '':
        return True
    admin_emails = [t.lower().strip() for t in administrators.splitlines()]
    if email.lower() in admin_emails:
        return True
    else:
        return False