예제 #1
0
파일: muser.py 프로젝트: vaveee/TorCMS
    def insert_data(self, post_data):
        if '/' in post_data['user_name'][0]:
            return False
        if ':' in post_data['user_name'][0]:
            return  False
        if len(post_data['user_name'][0]) < 5 or len(post_data['user_name'][0]) > 20:
            return False
        if '\\' in post_data['user_name'][0]:
            return False
        if '#' in post_data['user_name'][0]:
            return  False
        if '+' in post_data['user_name'][0]:
            return False
        if "'" in post_data['user_name'][0]:
            return False
        if '"' in post_data['user_name'][0]:
            return False
        if '(' in post_data['user_name'][0]:
            return False
        if ')' in post_data['user_name'][0]:
            return False
        if ' ' in post_data['user_name'][0]:
            return  False

        try:
            CabMember.create(uid=tools.get_uuid(),
                             user_name=post_data['user_name'][0],
                             user_pass=tools.md5(post_data['user_pass'][0]),
                             user_email=post_data['user_email'][0],
                             privilege='10000',
                             reset_passwd_timestamp=0, )
            return True
        except:
            return False
예제 #2
0
파일: muser.py 프로젝트: jiajie999/TorCMS
 def check_user(self,u_name,u_pass):
     tt = CabMember.select().where(CabMember.user_name == u_name).count()
     if tt == 0:
         return -1
     a = CabMember.get(user_name = u_name)
     if a.user_pass == hashlib.md5(u_pass.encode('utf-8')).hexdigest():
         return 1
     return 0
예제 #3
0
파일: muser.py 프로젝트: net4nt/TorCMS
 def check_user(self, u_name, u_pass):
     tt = CabMember.select().where(CabMember.user_name == u_name).count()
     if tt == 0:
         return -1
     a = CabMember.get(user_name=u_name)
     if a.user_pass == tools.md5(u_pass):
         return 1
     return 0
예제 #4
0
파일: muser.py 프로젝트: net4nt/TorCMS
 def insert_data(self, post_data):
     try:
         CabMember.create(uid=tools.get_uuid(),
                          user_name=post_data['user_name'][0],
                          user_pass=tools.md5(post_data['user_pass'][0]),
                          user_email=post_data['user_email'][0],
                          privilege='10000',
                          reset_passwd_timestamp=0, )
         return True
     except:
         return False
예제 #5
0
파일: muser.py 프로젝트: Ryan007/TorCMS
    def update_reset_passwd_timestamp(self, uname, timeit):

        entry = CabMember.update(
            reset_passwd_timestamp = timeit,
        ).where(CabMember.user_name == uname)
        entry.execute()
        return entry
예제 #6
0
파일: muser.py 프로젝트: vaveee/TorCMS
 def delete_by_user_name(self, user_name):
     try:
         del_count = CabMember.delete().where(CabMember.user_name ==  user_name)
         del_count.execute()
         return True
     except:
         return False
예제 #7
0
파일: muser.py 프로젝트: net4nt/TorCMS
 def delete(self, del_id):
     try:
         del_count = CabMember.delete().where(CabMember.uid == del_id)
         del_count.execute()
         return True
     except:
         return False
예제 #8
0
파일: muser.py 프로젝트: net4nt/TorCMS
    def update_info(self, u_name, newemail):
        entry = CabMember.update(
            user_email=newemail,

        ).where(CabMember.user_name == u_name)
        entry.execute()
        return entry
예제 #9
0
    def insert_data(self, post_data):

        uu = CabMember.select().aggregate(peewee.fn.Max(CabMember.uid))
        if uu:
            pass
        else:
            uu = 0

        try:
            entry = CabMember.create(
            uid = uu + 1,
            user_name = post_data['user_name'][0],
            user_pass =hashlib.md5(post_data['user_pass'][0].encode('utf-8')).hexdigest() ,
            user_email = post_data['user_email'][0]
            )
            return True
        except:
            return False
예제 #10
0
파일: muser.py 프로젝트: Ryan007/TorCMS
    def update_privilege(self, u_name, newprivilege):
        print(u_name)

        entry = CabMember.update(

            privilege=newprivilege
        ).where(CabMember.user_name == u_name)
        entry.execute()
        return entry
예제 #11
0
파일: muser.py 프로젝트: Ryan007/TorCMS
 def insert_data(self, post_data):
     print(post_data)
     print(type(post_data['user_name'][0]))
     print(type(post_data['user_email'][0]))
     entry = CabMember.create(uid=tools.get_uuid(),
                              user_name=post_data['user_name'][0],
                              user_pass=hashlib.md5(post_data['user_pass'][0].encode('utf-8')).hexdigest(),
                              user_email=post_data['user_email'][0],
                              privilege='10000')
     return True
예제 #12
0
파일: muser.py 프로젝트: jiajie999/TorCMS
    def insert_data(self, post_data):

        try:
            entry = CabMember.create(
            uid = tools.get_uuid(),
            user_name = post_data['user_name'][0],
            user_pass =hashlib.md5(post_data['user_pass'][0].encode('utf-8')).hexdigest() ,
            user_email = post_data['user_email'][0]
            )
            return True
        except:
            return False
예제 #13
0
파일: muser.py 프로젝트: jiajie999/TorCMS
 def update_pass(self,u_name, newpass):
     entry = CabMember.update(
         user_pass = hashlib.md5(newpass.encode('utf-8')).hexdigest() ,
     ).where(CabMember.user_name == u_name)
     entry.execute()
     return entry
예제 #14
0
파일: muser.py 프로젝트: maplet/TorCMS
 def update_pass(self, u_name, newpass):
     entry = CabMember.update(user_pass=hashlib.md5(
         newpass.encode('utf-8')).hexdigest(), ).where(
             CabMember.user_name == u_name)
     entry.execute()
     return entry
예제 #15
0
파일: muser.py 프로젝트: jiajie999/TorCMS
 def get_by_id(self, uname):
     try:
         return CabMember.get(user_name=uname)
     except:
         return False
예제 #16
0
 def get_by_uid(self, uid):
     try:
         return CabMember.get(CabMember.uid == uid)
     except:
         return False
예제 #17
0
파일: muser.py 프로젝트: jiajie999/TorCMS
 def __init__(self):
     try:
         CabMember.create_table()
     except:
         pass
예제 #18
0
파일: muser.py 프로젝트: jiajie999/TorCMS
 def get_by_uid(self, uid):
     try:
         return CabMember.get(CabMember.uid == uid)
     except:
         return False
예제 #19
0
 def get_by_id(self, uname):
     try:
         return CabMember.get(user_name=uname)
     except:
         return False
예제 #20
0
파일: muser.py 프로젝트: net4nt/TorCMS
 def get_by_keyword(self, par2):
     return CabMember.select().where(CabMember.user_name.contains(par2))
예제 #21
0
파일: muser.py 프로젝트: net4nt/TorCMS
 def get_by_email(self, emai):
     print(emai)
     try:
         return CabMember.get(user_email=emai)
     except:
         return False
예제 #22
0
 def __init__(self):
     try:
         CabMember.create_table()
     except:
         pass
예제 #23
0
파일: muser.py 프로젝트: net4nt/TorCMS
 def update_pass(self, u_name, newpass):
     entry = CabMember.update(
         user_pass=tools.md5(newpass),
     ).where(CabMember.user_name == u_name)
     entry.execute()
     return entry