Ejemplo n.º 1
0
    def render_GET(self, request):
        """
        Create a custom or generic Login/Access to the Application.
        """
        file = FilePath('custom/unauthorized.py')
        if file.exists() and file.isfile() or file.islink():
            # Custom form is provided
            from custom.login import CustomLogin
            root = IResource(CustomLogin())
        else:
            from goliat.auth.login import Login
            from goliat.utils.config import ConfigManager
            root = IResource(
                Login(ConfigManager().get_config('Goliat')['Project']))

        request.setResponseCode(http.UNAUTHORIZED)
        return root.render(request)
Ejemplo n.º 2
0
    def render_GET(self, request):
        """
        Create a custom or generic Login/Access to the Application.
        """
        file=FilePath('custom/unauthorized.py')
        if file.exists() and file.isfile() or file.islink():
            # Custom form is provided
            from custom.login import CustomLogin
            root=IResource(CustomLogin())
        else:
            from goliat.auth.login import Login
            from goliat.utils.config import ConfigManager
            root=IResource(Login(
                ConfigManager().get_config('Goliat')['Project']))

        request.setResponseCode(http.UNAUTHORIZED)
        return root.render(request)