Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    iw.rejectanonymous 1.2.2

    Download button

    No screenshots available
    Downloads: 232  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Ingeniweb | More programs
    GPL / FREE
    August 24th, 2012, 16:49 GMT [view history]
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    iw.rejectanonymous description

    Disallow access to a folder and its children if user is anonymous

    iw.rejectanonymous is made to reject unconditionally anonymous users from a Plone site; they should get redirected by Plone to login form. The basic use case is an extranet, where all visitors must be authenticated.

    How to use iw.rejectanonymous?

    By default an anonymous user can browse portal:

     >>> portal_url = self.portal.absolute_url()
     >>> browser.open(portal_url)
     >>> browser.url == portal_url
     True
     >>> browser.headers['status']
     '200 OK'


    We mark the portal with IPrivateSite; this can be achieved by code or in the ZMI using "Interfaces" tab on the portal object. Now Anonymous will get Unauthorized exception. In a plone site this should results in a redirect to login form.

     >>> from zope.interface import alsoProvides
     >>> from iw.rejectanonymous import IPrivateSite
     >>> alsoProvides(self.portal, IPrivateSite)
     >>> browser.open(portal_url)
     Traceback (most recent call last):
     ...
     Unauthorized: ...


    Login form and some styles resources are still accessible:

     >>> login_form_url = self.portal.login_form.absolute_url()
     >>> browser.open(login_form_url)
     >>> browser.url == login_form_url
     True
     >>> require_login_url = self.portal.require_login.absolute_url()
     >>> browser.open(require_login_url)
     >>> browser.url == require_login_url
     True
     >>> cooked_css = self.portal.portal_css.getCookedResources()[0]
     >>> cooked_css_url = '%s/portal_css/%s' % (portal_url, cooked_css.getId())
     >>> browser.open(cooked_css_url)
     >>> browser.url == cooked_css_url
     True
     >>> cooked_js = self.portal.portal_javascripts.getCookedResources()[0]
     >>> cooked_js_url = '%s/portal_javascripts/%s' % (portal_url, cooked_js.getId())
     >>> browser.open(cooked_js_url)
     >>> browser.url == cooked_js_url
     True
     >>> logo_id = self.portal.base_properties.getProperty('logoName')
     >>> logo_url = self.portal[logo_id].absolute_url()
     >>> browser.open(logo_url)
     >>> browser.url == logo_url
     True
     >>> mail_password_form_url = self.portal.mail_password_form.absolute_url()
     >>> browser.open(mail_password_form_url)
     >>> browser.url == mail_password_form_url
     True


    Reset password tool is accessible as well.

     >>> passwordreset_url = self.portal.passwordreset.absolute_url()
     >>> browser.open(passwordreset_url)
     >>> browser.url == passwordreset_url
     True


    Then we log in, and we will be authorized to browse the portal

     >>> from Products.PloneTestCase.setup import default_user, default_password
     >>> browser.addHeader('Authorization',
     ... 'Basic %s:%s' % (default_user, default_password))
     >>> browser.open(portal_url)
     >>> browser.url == portal_url
     True
     >>> browser.headers['status']
     '200 OK'



    Product's homepage

    Requirements:

    · Python
    · Plone CMS

    What's New in This Release: [ read full changelog ]

    · 4.2.1 Compatibility. [thomasdesvenain]

      


    TAGS:

    anonymous users | Plone plugin | reject anonymous | Plone | anonymous | users

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM