Exemple #1
0
    def post(self, *args):
        username=self.request.get('username')
        password=self.request.get('password')
        fromurl=self.request.get('fromurl',None)
        if Users.all().count()==0:
            u=Users()
            u.name='admin'
            u.username='******'
            u.password='******'
            u.auth='admin'
            u.put()
        user=Users.all().filter('username ='******'password ='******'template/workframe.html', {})
        else:
            self.redirect('/')
Exemple #2
0
    def post(self, *args):
        username = self.request.get('username')
        password = self.request.get('password')
        fromurl = self.request.get('fromurl', None)
        if Users.all().count() == 0:
            u = Users()
            u.name = 'admin'
            u.username = '******'
            u.password = '******'
            u.auth = 'admin'
            u.put()
        user = Users.all().filter('username ='******'password ='******'template/workframe.html', {})
        else:
            self.redirect('/')
Exemple #3
0
def get_current_user(web):
    guist={}
    Cookies = {}  # tempBook Cookies
    Cookies['request_cookie_list'] = [{'key': cookie_key, 'value': cookie_value} for cookie_key, cookie_value in web.request.cookies.iteritems()]
    for c in Cookies['request_cookie_list']:
        if c['key']=='webusername':
                    guist["username"]=c['value']
        if c['key']=='webnickname':
                    guist["name"]=urllib.unquote(c['value'].encode("utf-8"))
        if c['key']=='auth':
                    guist["auth"]=c['value']
    if guist and guist.has_key('username'):
        user=Users.all().filter('username ='******'username']).fetch(1)
        if user:
            return user[0]
    return False
Exemple #4
0
def get_current_user(web):
    guist = {}
    Cookies = {}  # tempBook Cookies
    Cookies['request_cookie_list'] = [{
        'key': cookie_key,
        'value': cookie_value
    } for cookie_key, cookie_value in web.request.cookies.iteritems()]
    for c in Cookies['request_cookie_list']:
        if c['key'] == 'webusername':
            guist["username"] = c['value']
        if c['key'] == 'webnickname':
            guist["name"] = urllib.unquote(c['value'].encode("utf-8"))
        if c['key'] == 'auth':
            guist["auth"] = c['value']
    if guist and guist.has_key('username'):
        user = Users.all().filter('username ='******'username']).fetch(1)
        if user:
            return user[0]
    return False