Exemplo n.º 1
0
    def _add_ssl_port_error_vhosts(self):
        fixable_items = 0
        mod = Module.ModuleModel("ssl")
        if mod.data['enabled']:
            site_template = "<b><big>%s</big></b>"
            lstore = self.get_model()
            data = []
            dirList = os.listdir(Configuration.SITES_ENABLED_DIR)
            dirList = [x for x in dirList if self._blacklisted(x) == False]

            bad_items = {}

            for fname in dirList:
                site = VirtualHostModel(fname)
                if site.enabled and not site.has_port():
                    bad_items[fname] = site
                    site = None
            for idx in sorted(bad_items):
                site = bad_items[idx]
                fixable = False
                markup = site_template % site.get_name()
                markup = markup + " CANNOT FIX"

                iter = lstore.append()
                pixbuf = self.render_icon(gtk.STOCK_DIALOG_WARNING,
                                          gtk.ICON_SIZE_LARGE_TOOLBAR)
                lstore.set(
                    iter, COLUMN_ICON, pixbuf, COLUMN_FIXED, False,
                    COLUMN_SEVERITY, site.get_name(), COLUMN_MARKUP, markup +
                    "\nThe virtual host does not have a port number and you have enabled ssl\n<small><i>You must add a port number (80)</i>.</small>"
                )
            if not len(lstore): return -1
        return fixable_items
Exemplo n.º 2
0
 def __fixed_toggled(self, cell, path, treeview):
     if not Shell.command.ask_password(): return
     # get toggled iter
     model = treeview.get_model()
     iter = model.get_iter((int(path), ))
     fixed = model.get_value(iter, COLUMN_FIXED)
     name = model.get_value(iter, COLUMN_SEVERITY)
     fixed = not fixed
     # set new value
     mod = Module.ModuleModel(name)
     mod.toggle(fixed)
     model.set(iter, COLUMN_FIXED, mod.data['enabled'])
     if (mod.changed):
         self.raise_event('please_restart_apache')
     self.raise_event('please_reload_lists', {}, True)
Exemplo n.º 3
0
    def load(self):
        self.items = {}
        mod_template = "<b><big>%s</big></b>"
        mod_unparsable_template = "<b><big>%s</big></b>\n<small><i>Further information not available</i></small>"
        lstore = self._reset_model()
        data = []  
        
        """dirList=os.listdir( Configuration.MODS_AVAILABLE_DIR )
        dirList = [x for x in dirList if self._blacklisted( x ) == False ]            
        for fname in  dirList :                        
            mod = Module.ModuleModel( fname )
            try:
                mod.load()
            except "VhostUnparsable":
                pass
            self.items[ fname ] = mod
            mod = None
        """
        self.items = Module.module_list()

        for idx in sorted( self.items ):
            mod = self.items[ idx ]
            if ( mod.parsable ):
                markup = mod_template \
                % ( mod.data['name'] ) #, mod.data[ 'DocumentRoot' ] )
                markup += "\n<small>%s</small>" % mod.data[ 'description' ]
                if len( mod.data[ 'dependancies' ] ) > 0:
                    markup += "\n<small><b>%s</b></small>" % ( "Dependencies: " + \
                    ", ".join( mod.data[ 'dependancies' ] ) )
                #else:
                #    markup += "\n<small><i>No dependencies</i></small>"
            else:
                markup = mod_unparsable_template % mod.data['name']
            iter = lstore.append()
            lstore.set(iter,
                COLUMN_FIXED, mod.data['enabled'],
                COLUMN_SEVERITY, mod.data['name'],
                COLUMN_MARKUP, markup )
Exemplo n.º 4
0
    def load(self):
        self.items = {}
        mod_template = "<b><big>%s</big></b>"
        mod_unparsable_template = "<b><big>%s</big></b>\n<small><i>Further information not available</i></small>"
        lstore = self._reset_model()
        data = []
        """dirList=os.listdir( Configuration.MODS_AVAILABLE_DIR )
        dirList = [x for x in dirList if self._blacklisted( x ) == False ]            
        for fname in  dirList :                        
            mod = Module.ModuleModel( fname )
            try:
                mod.load()
            except "VhostUnparsable":
                pass
            self.items[ fname ] = mod
            mod = None
        """
        self.items = Module.module_list()

        for idx in sorted(self.items):
            mod = self.items[idx]
            if (mod.parsable):
                markup = mod_template \
                % ( mod.data['name'] ) #, mod.data[ 'DocumentRoot' ] )
                markup += "\n<small>%s</small>" % mod.data['description']
                if len(mod.data['dependancies']) > 0:
                    markup += "\n<small><b>%s</b></small>" % ( "Dependencies: " + \
                    ", ".join( mod.data[ 'dependancies' ] ) )
                #else:
                #    markup += "\n<small><i>No dependencies</i></small>"
            else:
                markup = mod_unparsable_template % mod.data['name']
            iter = lstore.append()
            lstore.set(iter, COLUMN_FIXED, mod.data['enabled'],
                       COLUMN_SEVERITY, mod.data['name'], COLUMN_MARKUP,
                       markup)
Exemplo n.º 5
0
 def __selected(self, *args, **kwargs):
     print "MODULE NAME:", self.get_selected_line()
     print "DEPENDANTS: ", Module.get_module_dependants(
         self.get_selected_line(), self.items)
Exemplo n.º 6
0
 def __selected(self, *args, **kwargs ):
     print "MODULE NAME:", self.get_selected_line()
     print "DEPENDANTS: ", Module.get_module_dependants(self.get_selected_line(), self.items)