X-Git-Url: https://svn.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/ee907b08130cbb93fd0d089b43b3d4db7e8ec9bb..a8b15d47c663e72be4c3102486c7b7fdca467901:/skins/photo_theme/homepage_dispatcher.py diff --git a/skins/photo_theme/homepage_dispatcher.py b/skins/photo_theme/homepage_dispatcher.py index 443c164..bc3e140 100755 --- a/skins/photo_theme/homepage_dispatcher.py +++ b/skins/photo_theme/homepage_dispatcher.py @@ -9,22 +9,21 @@ resp = req.RESPONSE came_from = req.form.get('came_from') if came_from : - urlQs = came_from.split('?', 1) - if len(urlQs) == 1 : - came_from = '%s?%s' % (urlQs[0], mq(portal_status_message=_('Login success'))) - else : - url, qs= urlQs - came_from = '%s?%s&%s' % (url, qs, mq(portal_status_message=_('Login success'))) - return resp.redirect(came_from) + urlQs = came_from.split('?', 1) + if len(urlQs) == 1 : + came_from = '%s?%s' % (urlQs[0], mq(portal_status_message=_('Login success'))) + else : + url, qs= urlQs + came_from = '%s?%s&%s' % (url, qs, mq(portal_status_message=_('Login success'))) + return resp.redirect(came_from) -# else : -# from Products.realis.utils import searchContentsWithLocalRolesForAuthenticatedUser as search -# results = search(context, portal_type='Portfolio') -# if results : -# atool = getToolByName(context, 'portal_actions') -# return context.setRedirect(atool, 'user/my_albums', portal_status_message=_('Login success')) -# else : -# utool = getToolByName(context, 'portal_url') -# return resp.redirect('%s?%s' % (utool(), mq(portal_status_message=_('Login success')))) - -return resp.redirect('%s?%s' % (utool(), mq(portal_status_message=_('Login success')))) \ No newline at end of file +else : + from Products.Plinn.utils import searchContentsWithLocalRolesForAuthenticatedUser as search + results = search(portal_type='Portfolio') + if results : + atool = getToolByName(context, 'portal_actions') + return context.setRedirect(atool, 'user/my_albums', portal_status_message=_('Login success')) + else : + utool = getToolByName(context, 'portal_url') + return resp.redirect('%s?%s' % (utool(), mq(portal_status_message=_('Login success')))) + \ No newline at end of file