Example #1
0
 def _makeLoginProcess(self):
     # Check for automatic login
     authManager = AuthenticatorMgr()
     if (
         authManager.isSSOLoginActive()
         and len(authManager.getList()) == 1
         and not Config.getInstance().getDisplayLoginPage()
     ):
         self._redirect(urlHandlers.UHSignInSSO.getURL(authId=authManager.getDefaultAuthenticator().getId()))
         return
     if request.method != "POST":
         return self._signInPage.display(returnURL=self._returnURL)
     else:
         li = LoginInfo(self._login, self._password)
         av = authManager.getAvatar(li)
         if not av:
             return self._signInPageFailed.display(returnURL=self._returnURL)
         elif not av.isActivated():
             if av.isDisabled():
                 self._redirect(self._disabledAccountURL(av))
             else:
                 self._redirect(self._unactivatedAccountURL(av))
             return _("Your account is not active\nPlease activate it and try again")
         else:
             self._setSessionVars(av)
         self._addExtraParamsToURL()
         self._redirect(self._url)
Example #2
0
    def _process(self):
        authManager = AuthenticatorMgr()
        if (authManager.isSSOLoginActive() and len(authManager.getList()) == 1 and
           not Config.getInstance().getDisplayLoginPage()):
            self._redirect(urlHandlers.UHSignInSSO.getURL(authId=authManager.getDefaultAuthenticator().getId()))
            return

        av = authManager.getAvatarByLogin(self._login).values()[0]
        self._responseUtil.content_type='application/json'
        if not av:
            return '{"success":false,"message":"User not found"}'
        elif not av.isActivated():
            return '{"success":false,"message":"User not activated"}'
        else:
            return '{"success":true}'
Example #3
0
    def _process(self):
        authManager = AuthenticatorMgr()
        if (authManager.isSSOLoginActive() and len(authManager.getList()) == 1
                and not Config.getInstance().getDisplayLoginPage()):
            self._redirect(
                urlHandlers.UHSignInSSO.getURL(
                    authId=authManager.getDefaultAuthenticator().getId()))
            return

        av = authManager.getAvatarByLogin(self._login).values()[0]
        self._responseUtil.content_type = 'application/json'
        if not av:
            return '{"success":false,"message":"User not found"}'
        elif not av.isActivated():
            return '{"success":false,"message":"User not activated"}'
        else:
            return '{"success":true}'
Example #4
0
    def _process(self):
        #Check for automatic login
        authManager = AuthenticatorMgr()
        if (authManager.isSSOLoginActive() and len(authManager.getList()) == 1 and
           not Config.getInstance().getDisplayLoginPage()):
            self._redirect(urlHandlers.UHSignInSSO.getURL(authId=authManager.getDefaultAuthenticator().getId()))
            return

        li = LoginInfo( self._login, self._password )
        av = authManager.getAvatar(li)
        self._responseUtil.content_type='application/json'
        if not av:
            return '{"success":false,"message":"User not authenticated or found"}'
        elif not av.isActivated():
            return '{"success":false,"message":"User not activated"}'
        else:
            return '{"success":true}'
Example #5
0
    def _process(self):
        #Check for automatic login
        authManager = AuthenticatorMgr()
        if (authManager.isSSOLoginActive() and len(authManager.getList()) == 1
                and not Config.getInstance().getDisplayLoginPage()):
            self._redirect(
                urlHandlers.UHSignInSSO.getURL(
                    authId=authManager.getDefaultAuthenticator().getId()))
            return

        li = LoginInfo(self._login, self._password)
        av = authManager.getAvatar(li)
        self._responseUtil.content_type = 'application/json'
        if not av:
            return '{"success":false,"message":"User not authenticated or found"}'
        elif not av.isActivated():
            return '{"success":false,"message":"User not activated"}'
        else:
            return '{"success":true}'