Exemple #1
0
    def load(self):
        # Create the Password Manager
        password_manager = PasswordManager()

        # Create the DBConnection
        database = DBConnection()

        # Create the SQL
        sql = "SELECT * FROM connections WHERE id_connection = {}"

        # Bind the value
        sql = sql.format(self.id)

        # Execute the query
        rows = database.select_query(sql)

        # Set the attrs
        for row in rows:
            self.name = row['name']
            self.host = row['host']
            self.port = row['port']
            self.user = row['user']
            self.password = password_manager.decrypt_password(row['passwd'])
            self.use_key = True if int(row['use_key']) == 1 else False
            self.key_path = row['key_path']
Exemple #2
0
    def load(self):
        # Create the Password Manager
        password_manager = PasswordManager()

        # Create the DBConnection
        database = DBConnection()

        # Create the SQL
        sql = "SELECT * FROM connections WHERE id_connection = {}"

        # Bind the value
        sql = sql.format(self.id)

        # Execute the query
        rows = database.select_query(sql)

        # Set the attrs
        for row in rows:
            self.name = row['name']
            self.host = row['host']
            self.port = row['port']
            self.user = row['user']
            self.password = password_manager.decrypt_password(row['passwd'])
            self.use_key = True if int(row['use_key']) == 1 else False
            self.key_path = row['key_path']