import os, transaction, sys, traceback
from AccessControl.SecurityManagement import newSecurityManager, getSecurityManager, setSecurityManager

from collective.solr_checks.browser import MaintenanceView
from Testing import makerequest

if __name__=='__main__':
    """ """
    if len(sys.argv)>1:
        portal = sys.argv[1]

        myapp=makerequest.makerequest(app[portal])
        print "start"
        owner = myapp.getWrappedOwner()
        newSecurityManager(None, owner)

        mv= MaintenanceView(myapp,myapp.REQUEST)
        mv.check()
        
        print "stop"

import os, transaction, sys, traceback
from AccessControl.SecurityManagement import newSecurityManager, getSecurityManager, setSecurityManager

from collective.solr_checks.browser import MaintenanceView
from Testing import makerequest

if __name__=='__main__':
    """ """
    if len(sys.argv)>1:
        portal = sys.argv[1]

        myapp=makerequest.makerequest(app[portal])
        print "start"
        owner = myapp.getWrappedOwner()
        newSecurityManager(None, owner)

        mv= MaintenanceView(myapp,myapp.REQUEST)
        mv.fix()
        
        transaction.commit()
        print "stop"

import os, transaction, sys, traceback
from AccessControl.SecurityManagement import newSecurityManager, getSecurityManager, setSecurityManager

from collective.solr_checks.browser import MaintenanceView
from Testing import makerequest

if __name__=='__main__':
    """ """
    if len(sys.argv)>1:
        portal = sys.argv[1]

        myapp=makerequest.makerequest(app[portal])
        print "start"
        owner = myapp.getWrappedOwner()
        newSecurityManager(None, owner)

        mv= MaintenanceView(myapp,myapp.REQUEST)
        mv.reindex_allowedRolesAndUsers()

        transaction.commit()
        print "stop"