list2form : gestion des erreurs et des petits fichiers (merci cgi.py…)
[progfou.git] / wcs / wcs-adduser
CommitLineData
9d344481
P
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3
4import sys
5import twill
6
7if len(sys.argv) != 8:
8 print "Syntax: %s <logname> <logpass> <courriel> <nom> <prenom> <username> <password>" % sys.argv[0]
9 sys.exit(1)
10
11dico = {
12 'url_login': 'https://formulaires.auf.org/login/',
13 'username': sys.argv[1],
14 'password': sys.argv[2],
15 'url_new_user': 'https://formulaires.auf.org/admin/users/new',
16 'user_courriel': sys.argv[3],
17 'user_nom': sys.argv[4],
18 'user_prenom': sys.argv[5],
19 'user_username': sys.argv[6],
20 'user_password': sys.argv[7],
21}
22
23twill.execute_string('''
24go %(url_login)s
25fv 1 username %(username)s
26fv 1 password %(password)s
27submit
28
29go %(url_new_user)s
30fv 1 f0 %(user_courriel)s
31fv 1 f1 '%(user_nom)s'
32fv 1 f2 '%(user_prenom)s'
33fv 1 is_admin False
34fv 1 method_password$username %(user_username)s
35fv 1 method_password$password %(user_password)s
36fv 1 method_password$awaiting_confirmation False
bbb18994
P
37fv 1 method_password$awaiting_moderation False
38fv 1 method_password$disabled False
9d344481
P
39submit submit
40''' % dico)
41