Example #1
0
def get_site(name, by_alias=False):
    if by_alias:
        vn = 'site/alias'
    else:
        vn = 'site/by_cname'
    rows = Site.view(vn, key=name)
    lrows = list(iter(rows))
    if lrows:
        return lrows[0]
    return None
Example #2
0
def validate_token(siteid, token):
    rows = Site.view('site/token', key=[token, siteid])
    lrows = list(iter(rows))
    if lrows:
        return True
    return False
Example #3
0
def validate_password(siteid, password):
    rows = Site.view('site/password', key=[siteid, make_hash(password)])
    lrows = list(iter(rows))
    if lrows:
        return True
    return False