3 ### Remote service commands
5 ### (c) 2013 Mark Wooding
8 ###----- Licensing notice ---------------------------------------------------
10 ### This file is part of Chopwood: a password-changing service.
12 ### Chopwood is free software; you can redistribute it and/or modify
13 ### it under the terms of the GNU Affero General Public License as
14 ### published by the Free Software Foundation; either version 3 of the
15 ### License, or (at your option) any later version.
17 ### Chopwood is distributed in the hope that it will be useful,
18 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ### GNU Affero General Public License for more details.
22 ### You should have received a copy of the GNU Affero General Public
23 ### License along with Chopwood; if not, see
24 ### <http://www.gnu.org/licenses/>.
27 import subcommand
as SC
31 'set', ['remote'], 'Set password for remote service',
32 params
= [SC
.Arg('service'), SC
.Arg('user')])
33 def cmd_set_svc(service
, user
):
34 new
= U
.readline('new password')
35 svc
= CU
.check_service(service
)
36 svc
.setpasswd(user
, new
)
39 'clear', ['remote'], 'Clear password for remote service',
40 params
= [SC
.Arg('service'), SC
.Arg('user')])
41 def cmd_set_svc(service
, user
):
42 svc
= CU
.check_service(service
)
46 'mkpwent', ['remote'], 'Create a new user record',
47 params
= [SC
.Arg('user'), SC
.Arg('service')],
48 rparam
= SC
.Arg('fields'))
49 def cmd_mkpwent_svc(user
, service
, fields
):
50 passwd
= U
.readline('new password')
51 svc
= CU
.check_service(service
)
52 svc
.mkpwent(user
, passwd
, fields
)
55 'rmpwent', ['remote'], 'Remove an existing user record',
56 params
= [SC
.Arg('user'), SC
.Arg('service')])
57 def cmd_rmpwent_svc(user
, service
):
58 svc
= CU
.check_service(service
)
61 ###----- That's all, folks --------------------------------------------------