Example #1
0
 def __init__(self, component):
     UIResource.__init__(self, component)
     self.component = component
     self.res_paths = component.web_resources.copy()
     self.res_paths.update({
         'auth_check' : self.res_paths['root'] + '?check=1'
     })
Example #2
0
 def __init__(self, ptype, component,capabilities):
     UIResource.__init__(self, component)
     self.dm = component.resolve(directorymanager)
     self.bd = component.resolve(BindingsDirectory) 
     self.required_capabilities = capabilities
     self.to_remove = [ "start", "count","sort_attr","sort_desc"]
     self.ptype = ptype
     self.template_args = {} 
Example #3
0
 def __init__(self, component,capabilities):
     UIResource.__init__(self, component)
     # maps from 'subset' param value to the 
     # page and parameter string we need to use for
     # redirection
     self.subset_map = { "Host Names" : ("Hosts","name_glob"), 
                        "Host IPs" : ("Hosts","nwaddr_glob"), 
                        "Host MACs" : ("Hosts","dladdr_glob"), 
                        "Host Locations" : ("Hosts","location_name_glob"), 
                        "User Names" : ("Users","name_glob"), 
                        "Switch Names" : ("Switches","name_glob"), 
                        "Location Names" : ("Locations","name_glob")
                        }
Example #4
0
 def __init__(self, component, res_root):
     UIResource.__init__(self, component)
     self.component = component
     self.res_paths = self.web_resources(res_root)
     self.resource_handlers = {
         self.res_paths.auth           : self.handle_auth,
         self.res_paths.check_for_auth : self.handle_check_for_auth,
         self.res_paths.opening_pu     : self.handle_opening_pu,
         self.res_paths.wait_for_pu    : self.handle_wait_for_pu,
         self.res_paths.auth_status    : self.handle_auth_status,
         self.res_paths.do_login       : self.handle_do_login,
         self.res_paths.do_logout      : self.handle_do_logout,
         self.res_paths.success        : self.handle_success,
         self.res_paths.error          : self.handle_error
     }
Example #5
0
    def _render_tmpl(self, request, name, *args, **kwargs):
        """Render mako template with base arguments
        """
        rurl = (request.args.get("rurl") or ('',))[0] or ''
        proxy_cookie = (request.args.get("proxy_cookie") or ('',))[0] or ''
	if proxy_cookie == "": 
	        proxy_param = ""
	else:
	        proxy_param = "&proxy_cookie=" + proxy_cookie

        return UIResource.render_tmpl(self, request, name, 
                p=self.component.get_property, r=self.res_paths, rurl=rurl,
                proxy_cookie=proxy_cookie, proxy_param=proxy_param,  
                rurl_disp=self._get_url_for_display(rurl), *args, **kwargs)
Example #6
0
    def _render_tmpl(self, request, name, *args, **kwargs):
        """Render mako template with base arguments
        """
        rurl = (request.args.get("rurl") or ('', ))[0] or ''
        proxy_cookie = (request.args.get("proxy_cookie") or ('', ))[0] or ''
        if proxy_cookie == "":
            proxy_param = ""
        else:
            proxy_param = "&proxy_cookie=" + proxy_cookie

        return UIResource.render_tmpl(
            self,
            request,
            name,
            p=self.component.get_property,
            r=self.res_paths,
            rurl=rurl,
            proxy_cookie=proxy_cookie,
            proxy_param=proxy_param,
            rurl_disp=self._get_url_for_display(rurl),
            *args,
            **kwargs)
Example #7
0
 def __init__(self, component):
     UIResource.__init__(self, component)
Example #8
0
 def __init__(self, component, props_section_id):
     UIResource.__init__(self, component)
     self._props = Properties(component.storage, props_section_id)
     self._props_dirty = True
     self._registered_resources = {}
Example #9
0
File: pki.py Project: pombreda/snac
 def __init__(self, component):
     UIResource.__init__(self, component)
     self.last_req_num = 0
     self.simple_config = component.resolve(simple_config)
Example #10
0
 def __init__(self, component, file):
     UIResource.__init__(self, component)
     static.File.__init__(self, file)
Example #11
0
 def render_tmpl(self, request, name, *arg, **data):
     """Render mako template with componet config and resource paths"""
     return UIResource.render_tmpl(self, request, name,
             c=self.component.config, r=self.res_paths, *arg, **data)
Example #12
0
 def __init__(self, component):
     UIResource.__init__(self, component)
Example #13
0
 def __init__(self, component,capabilities):
     UIResource.__init__(self, component)
     self.required_capabilities = capabilities
     self.vis_ws = component.resolve(visibility_ws) 
     self.policy = component.resolve(PyPolicyComponent)
Example #14
0
 def __init__(self, component, capabilities):
     UIResource.__init__(self, component)
     self.required_capabilities = capabilities
     self.vis_ws = component.resolve(visibility_ws)
     self.policy = component.resolve(PyPolicyComponent)
Example #15
0
 def __init__(self, component):
     UIResource.__init__(self, component)
     self.last_req_num = 0 
     self.simple_config = component.resolve(simple_config)
Example #16
0
 def __init__(self, component):
     UIResource.__init__(self, component)
     self.component = component
     self.res_paths = component.web_resources.copy()
     self.res_paths.update(
         {'auth_check': self.res_paths['root'] + '?check=1'})
Example #17
0
 def __init__(self, component, props_section_id):
     UIResource.__init__(self, component)
     self._props = Properties(component.storage, props_section_id)
     self._props_dirty = True
     self._registered_resources = {}
Example #18
0
 def __init__(self, component, file):
     UIResource.__init__(self, component)
     static.File.__init__(self, file)