コード例 #1
0
    def __call__(self):

        if is_cas_auth_enabled():
            # Single-Logout via CAS server
            return '{}/logout'.format(get_cas_server_url())
        else:
            # Logout via Plone PAS
            return '{}/logout'.format(api.portal.get().absolute_url())
コード例 #2
0
 def redirect_url(self):
     if is_cas_auth_enabled():
         # Single-Logout via CAS server
         return '{}/logout'.format(get_cas_server_url())
     else:
         # Logout via Plone PAS
         portal_url_tool = getToolByName(self.context, 'portal_url')
         return '{}/logout'.format(portal_url_tool())
コード例 #3
0
 def get_config(self):
     config = self.get_info()
     # Only expose essential configuration for unauthenticated requests
     if getSecurityManager().getUser() != nobody:
         config.update(self.get_settings())
         config['features'] = self.get_features()
     config['root_url'] = api.portal.get().absolute_url()
     config['cas_url'] = get_cas_server_url()
     return config
コード例 #4
0
 def get_config(self):
     config = self.get_info()
     # Only expose essential configuration for unauthenticated requests
     if getSecurityManager().getUser() != nobody:
         config.update(self.get_settings())
         config['features'] = self.get_features()
     config['root_url'] = api.portal.get().absolute_url()
     config['cas_url'] = get_cas_server_url()
     return config
コード例 #5
0
 def cas_server_url(self):
     return get_cas_server_url()
コード例 #6
0
 def test_trailing_slashes_are_stripped(self):
     get_current_admin_unit().public_url = 'http://example.com/'
     applyProfile(self.layer['portal'], 'opengever.setup:casauth')
     self.assertEquals('http://example.com/portal', get_cas_server_url())
コード例 #7
0
 def test_cas_server_url_is_fetched_from_plugin(self):
     applyProfile(self.layer['portal'], 'opengever.setup:casauth')
     cas_plugin = self.portal.acl_users.cas_auth
     cas_plugin.cas_server_url = 'http://cas.example.org'
     self.assertEquals('http://cas.example.org', get_cas_server_url())
コード例 #8
0
 def test_trailing_slashes_are_stripped(self):
     get_current_admin_unit().public_url = 'http://example.com/'
     applyProfile(self.layer['portal'], 'opengever.setup:casauth')
     self.assertEquals('http://example.com/portal', get_cas_server_url())
コード例 #9
0
 def test_cas_server_url_is_fetched_from_plugin(self):
     applyProfile(self.layer['portal'], 'opengever.setup:casauth')
     cas_plugin = self.portal.acl_users.cas_auth
     cas_plugin.cas_server_url = 'http://cas.example.org'
     self.assertEquals('http://cas.example.org', get_cas_server_url())
コード例 #10
0
 def test_cas_server_url_is_none_if_cas_plugin_is_missing(self):
     self.assertEquals(None, get_cas_server_url())
コード例 #11
0
 def test_cas_server_url_is_none_if_cas_plugin_is_missing(self):
     self.assertEquals(None, get_cas_server_url())