author | sylvain.thenault@logilab.fr |
Tue, 17 Feb 2009 18:17:40 +0100 | |
branch | tls-sprint |
changeset 684 | ddeab9691381 |
parent 601 | a9e65aff3049 |
child 1132 | 96752791c2b6 |
permissions | -rw-r--r-- |
0 | 1 |
"""cubicweb-ctl commands and command handlers common to twisted/modpython |
2 |
web configuration |
|
3 |
||
4 |
:organization: Logilab |
|
601
a9e65aff3049
ask if anonymous should be allowed, configure accordingly
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
5 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
0 | 6 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
7 |
""" |
|
8 |
__docformat__ = "restructuredtext en" |
|
9 |
||
601
a9e65aff3049
ask if anonymous should be allowed, configure accordingly
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
10 |
from cubicweb.toolsutils import CommandHandler, confirm |
0 | 11 |
|
12 |
||
13 |
class WebCreateHandler(CommandHandler): |
|
14 |
cmdname = 'create' |
|
15 |
||
16 |
def bootstrap(self, cubes, inputlevel=0): |
|
17 |
"""bootstrap this configuration""" |
|
18 |
print '** generic web configuration' |
|
19 |
config = self.config |
|
20 |
if config.repo_method == 'pyro': |
|
21 |
print |
|
22 |
print '** repository server configuration' |
|
23 |
print '-' * 72 |
|
24 |
config.input_config('pyro-client', inputlevel) |
|
601
a9e65aff3049
ask if anonymous should be allowed, configure accordingly
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
25 |
if confirm('allow anonymous access', False): |
a9e65aff3049
ask if anonymous should be allowed, configure accordingly
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
26 |
config.global_set_option('anonymous-user', 'anon') |
a9e65aff3049
ask if anonymous should be allowed, configure accordingly
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
27 |
config.global_set_option('anonymous-password', 'anon') |
a9e65aff3049
ask if anonymous should be allowed, configure accordingly
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
28 |
|
0 | 29 |
def postcreate(self): |
30 |
"""hooks called once application's initialization has been completed""" |
|
31 |