Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 14849)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 14934)
@@ -24,5 +24,5 @@
 from urllib import urlencode
 from datetime import datetime, date
-from time import time
+from time import time, sleep
 from zope.event import notify
 from zope.component import getUtility, queryUtility, createObject, getAdapter
@@ -680,5 +680,5 @@
 class CreateAllStudentsPage(UtilityView, grok.View):
     """Create all student objects from applicant data
-    in the root container or in a specific  applicants container only.
+    in the root container or in a specific applicants container only.
     Only PortalManagers can do this.
     """
@@ -688,4 +688,10 @@
 
     def update(self):
+        grok.getSite()['configuration'].maintmode_enabled_by = u'admin'
+        transaction.commit()
+        # Wait 10 seconds for all transactions to be finished.
+        # Do not wait in tests.
+        if not self.request.principal.id == 'zope.mgr':
+            sleep(10)
         cat = getUtility(ICatalog, name='applicants_catalog')
         results = list(cat.searchResults(state=(ADMITTED, ADMITTED)))
@@ -706,4 +712,5 @@
                 applicants_root.logger.info(
                     '%s - %s - %s' % (ob_class, result.applicant_id, msg))
+        grok.getSite()['configuration'].maintmode_enabled_by = None
         if len(created):
             self.flash(_('${a} students successfully created.',
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py	(revision 14849)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py	(revision 14934)
@@ -26,4 +26,5 @@
 from zope.component import getUtility
 from zope.i18n import translate
+from zope.securitypolicy.interfaces import IPrincipalRoleManager
 from waeup.kofa.testing import FunctionalLayer
 from waeup.kofa.interfaces import IExtFileStore, IFileStoreNameChooser
@@ -42,5 +43,4 @@
 
     def prepare_applicant(self):
-        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         self.browser.open(self.manage_path)
         self.fill_correct_values()
@@ -56,4 +56,5 @@
 
     def test_copier(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         self.prepare_applicant()
         storage = getUtility(IExtFileStore)
@@ -140,4 +141,5 @@
 
     def test_batch_copying(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         self.prepare_applicant()
         IWorkflowState(self.applicant).setState('admitted')
@@ -155,4 +157,5 @@
         logfile = os.path.join(
             self.app['datacenter'].storage, 'logs', 'applicants.log')
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         self.prepare_applicant()
         self.browser.open(self.container_path + '/createallstudents')
@@ -182,4 +185,5 @@
         logfile = os.path.join(
             self.app['datacenter'].storage, 'logs', 'applicants.log')
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         self.prepare_applicant()
         self.browser.open(self.manage_path)
@@ -238,2 +242,27 @@
         logcontent = open(logfile).read()
         self.assertTrue('IOError: Application Slip could not be created.' in logcontent)
+
+    def disabled_test_delay(self):
+        # Create portalmanager manager
+        self.app['users'].addUser('mrportalmanager', 'mrportalmanagersecret')
+        self.app['users']['mrportalmanager'].email = 'mrportalmanager@foo.ng'
+        self.app['users']['mrportalmanager'].title = 'Carlos Portales'
+        prmglobal = IPrincipalRoleManager(self.app)
+        prmglobal.assignRoleToPrincipal(
+            'waeup.PortalManager', 'mrportalmanager')
+        # Login as portal manager
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = 'mrportalmanager'
+        self.browser.getControl(name="form.password").value = 'mrportalmanagersecret'
+        self.browser.getControl("Login").click()
+        self.prepare_applicant()
+        self.browser.open(self.manage_path)
+        self.browser.getControl(name="form.date_of_birth").value = '09/09/1988'
+        self.browser.getControl(name="form.course_admitted").value = ['CERT1']
+        self.browser.getControl("Save").click()
+        IWorkflowState(self.applicant).setState('admitted')
+        notify(grok.ObjectModifiedEvent(self.applicant))
+        start = datetime.now()
+        self.browser.open(self.root_path + '/createallstudents')
+        self.assertTrue('1 students successfully created' in self.browser.contents)
+        self.assertTrue((datetime.now() - start).seconds >= 10)
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py	(revision 14849)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py	(revision 14934)
@@ -167,4 +167,13 @@
     grok.order(4)
 
+creation_warning = _(
+    "'The creation process may take a considerably long time "
+    "depending on the number of student records to be created "
+    "(appr. 0.5s per student). "
+    "All users will be logged out and the portal will be in "
+    "maintenance mode during record creation. You have to login again after "
+    "creation process has finished. "
+    "Do you really want to start the process now?'")
+
 class ApplicantsRootCreateStudentsActionButton(ManageActionButton):
     grok.order(3)
@@ -177,8 +186,6 @@
 
     @property
-    def target_url(self):
-        if self.target and self.request.principal.id == 'admin':
-            return self.view.url(self.view.context, self.target)
-        return
+    def onclick(self):
+        return "return window.confirm(%s);" % creation_warning
 
 class ApplicantsContainerCreateStudentsActionButton(ManageActionButton):
@@ -192,8 +199,6 @@
 
     @property
-    def target_url(self):
-        if self.target and self.request.principal.id == 'admin':
-            return self.view.url(self.view.context, self.target)
-        return
+    def onclick(self):
+        return "return window.confirm(%s);" % creation_warning
 
 class ApplicantViewActionButton(ManageActionButton):
