66from imio .esign import ESIGN_ROOT_URL
77from imio .esign .browser .table import external_session_link
88from imio .esign .browser .table import SessionsTable
9- from imio .esign .interfaces import IImioSessionsManagementContext
9+ from imio .esign .config import get_registry_enabled
1010from imio .esign .utils import create_external_session
1111from imio .esign .utils import get_session_annotation
1212from imio .esign .utils import remove_session
2323from zope .i18n import translate
2424from zope .interface import implementer
2525from zope .publisher .interfaces import IPublishTraverse
26- from zope .security .interfaces import Unauthorized
2726
2827import csv
2928import os
@@ -43,13 +42,8 @@ class SessionsListingView(BrowserView):
4342 def __init__ (self , context , request ):
4443 super (SessionsListingView , self ).__init__ (context , request )
4544
46- def __call__ (self ):
47- # Verify that the context provides the correct interface
48- if not IImioSessionsManagementContext .providedBy (self .context ):
49- raise Unauthorized (
50- "This view can only be called on a context providing IImioSessionsManagementContext"
51- )
52- return self .index ()
45+ def available (self ):
46+ return get_registry_enabled ()
5347
5448 def render_table (self ):
5549 table = SessionsTable (self .context , self , self .request , self .get_sessions ())
@@ -68,7 +62,7 @@ def get_dashboard_link(self, session):
6862 raise NotImplementedError
6963
7064 def get_sessions_url (self ):
71- raise NotImplementedError
65+ return api . portal . get (). absolute_url ()
7266
7367
7468class SessionFilesView (BrowserView ):
@@ -117,7 +111,7 @@ def __call__(self):
117111 else :
118112 api .portal .show_message (_ ("Session not found!" ), request = self .request , type = "error" )
119113
120- return self .request .RESPONSE .redirect (self .context .absolute_url () + "/@@esign-sessions-listing " )
114+ return self .request .RESPONSE .redirect (self .context .absolute_url () + "/@@parapheo " )
121115
122116
123117class ExternalSessionCreateView (BrowserView ):
@@ -128,7 +122,7 @@ def __call__(self, session_id=None):
128122 session_id = self .request .get ("session_id" , None )
129123 if session_id is None :
130124 api .portal .show_message (_ ("No session ID provided!" ), request = self .request , type = "error" )
131- return self .context .absolute_url () + "/@@esign-sessions-listing "
125+ return self .context .absolute_url () + "/@@parapheo "
132126 resp = create_external_session (
133127 int (session_id ),
134128 b64_cred = ESIGN_CREDENTIALS ,
@@ -155,7 +149,7 @@ def __call__(self, session_id=None):
155149 request = self .request ,
156150 type = "error" ,
157151 )
158- return self .context .absolute_url () + "/@@esign-sessions-listing "
152+ return self .context .absolute_url () + "/@@parapheo "
159153
160154
161155class FacetedSessionInfoViewlet (ViewletBase ):
@@ -204,7 +198,7 @@ def ext_session_link(self, session):
204198
205199 @property
206200 def session_listing_url (self ):
207- return api .portal .get ().absolute_url () + "/sessions/@@esign-sessions-listing "
201+ return api .portal .get ().absolute_url () + "/@@parapheo "
208202
209203
210204class ItemSessionInfoViewlet (FacetedSessionInfoViewlet ):
0 commit comments