Exemplo n.º 1
0
 def setupPAS(cls, container):
     factory = container.manage_addProduct['PluggableAuthService']
     factory.addPluggableAuthService(REQUEST=None)
     pas = container.acl_users
     ppasinstall.registerPluginTypes(pas)
     utils.updatePAS(container, CONNECTION_ID)
     return pas
Exemplo n.º 2
0
 def handle_setup(self):
     conn = self.request.get("form.conn", "")
     if not conn:
         self.request["portal_status_message"] = "Please choose a connection."
         return self.template()
     else:
         utils.updatePAS(getToolByName(self.context, "portal_url").getPortalObject(), sql_connection=conn)
         assert self.is_setup()
         # Instead of returning self.template() I have to redirect
         # here because otherwise the test would complain about an
         # unauthorized context (the 'view' may not be accessed by
         # the page template).
         return self.request.response.redirect(self.request["URL0"] + "?portal_status_message=Setup+successful.")