Beispiel #1
0
    def POST(self):
        print auth.onpage
        if auth.onpage:
            con = config.Config()
            new_name = web.input().name
            new_username = web.input().username
            new_password = web.input().password
            new_email = web.input().email
            ident = blog.get_user()[0]
            old_password = ident['passwd']
            old_name = con.ConfigSectionMap("Info")["name"]
            hash_password = hashlib.sha1(ident['salt'] +
                                         new_password).hexdigest()
            if hash_password is not ident['passwd'] and str(
                    new_password) is not "" and new_password is not None:
                old_password = hash_password

            blog.update_user(new_username, old_password, new_email)

            if new_name is not old_name:
                con.setName(new_name)
                espresso.generateHeader(new_name)
            raise web.seeother('/americano')
        else:
            raise web.seeother('/settings-auth')
Beispiel #2
0
 def POST(self, step):
     con = config.Config()
     if int(con.ConfigSectionMap("Info")["installed"]) is not 3:
         if int(step) is 1:
             name = web.input().name
             username = web.input().username
             password = web.input().password
             con.setName(name)
             genpass = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(8))
             con.setMySQLPassword(genpass)
             con.setMySQLUsername("americano")
             con.setMySQLDatabase("americano")
             create_americano_database(username, password, genpass)
             con.setInstalled("2")
             espresso.generateHeader(name)
         if int(step) is 2:
             username = web.input().username
             password = web.input().password
             email = web.input().email
             blog.generateUser(username, password, email)
             con.setInstalled("3")
Beispiel #3
0
    def POST(self):
        print auth.onpage
        if auth.onpage:
            con = config.Config()
            new_name = web.input().name
            new_username = web.input().username
            new_password = web.input().password
            new_email = web.input().email
            ident = blog.get_user()[0]
            old_password = ident['passwd']
            old_name = con.ConfigSectionMap("Info")["name"]
            hash_password = hashlib.sha1(ident['salt']+new_password).hexdigest()
            if hash_password is not ident['passwd'] and str(new_password) is not "" and new_password is not None:
                old_password = hash_password

            blog.update_user(new_username, old_password, new_email)

            if new_name is not old_name:
                con.setName(new_name)
                espresso.generateHeader(new_name)
            raise web.seeother('/americano')
        else:
            raise web.seeother('/settings-auth')
Beispiel #4
0
 def POST(self, step):
     con = config.Config()
     if int(con.ConfigSectionMap("Info")["installed"]) is not 3:
         if int(step) is 1:
             name = web.input().name
             username = web.input().username
             password = web.input().password
             con.setName(name)
             genpass = ''.join(
                 random.choice(string.ascii_uppercase + string.digits)
                 for x in range(8))
             con.setMySQLPassword(genpass)
             con.setMySQLUsername("americano")
             con.setMySQLDatabase("americano")
             create_americano_database(username, password, genpass)
             con.setInstalled("2")
             espresso.generateHeader(name)
         if int(step) is 2:
             username = web.input().username
             password = web.input().password
             email = web.input().email
             blog.generateUser(username, password, email)
             con.setInstalled("3")