ask if anonymous should be allowed, configure accordingly
authorsylvain.thenault@logilab.fr
Wed, 11 Feb 2009 18:22:22 +0100
changeset 601 a9e65aff3049
parent 600 1fbf11a876a8
child 605 1a23781534a2
ask if anonymous should be allowed, configure accordingly
web/webctl.py
--- a/web/webctl.py	Wed Feb 11 17:55:44 2009 +0100
+++ b/web/webctl.py	Wed Feb 11 18:22:22 2009 +0100
@@ -2,12 +2,12 @@
 web configuration
 
 :organization: Logilab
-:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
 
-from cubicweb.toolsutils import CommandHandler
+from cubicweb.toolsutils import CommandHandler, confirm
 
 
 class WebCreateHandler(CommandHandler):
@@ -22,7 +22,10 @@
             print '** repository server configuration'
             print '-' * 72
             config.input_config('pyro-client', inputlevel)
-    
+        if confirm('allow anonymous access', False):
+           config.global_set_option('anonymous-user', 'anon') 
+           config.global_set_option('anonymous-password', 'anon') 
+        
     def postcreate(self):
         """hooks called once application's initialization has been completed"""