VirtualMailManager/cli/subcommands.py
branchv0.7.x
changeset 728 69eb7a65d8a4
parent 711 2a75058fc064
child 737 81f4bfc34ed8
equal deleted inserted replaced
727:695426b49de0 728:69eb7a65d8a4
   394     ctx.hdlr.user_name(ctx.args.address.lower(), ctx.args.name)
   394     ctx.hdlr.user_name(ctx.args.address.lower(), ctx.args.name)
   395 
   395 
   396 
   396 
   397 def user_password(ctx):
   397 def user_password(ctx):
   398     """update the password for the given address"""
   398     """update the password for the given address"""
   399     ctx.hdlr.user_password(ctx.args.address.lower(), ctx.args.password)
   399     ctx.hdlr.user_password(ctx.args.address.lower(), ctx.args.password,
       
   400                            ctx.args.scheme)
   400 
   401 
   401 
   402 
   402 def user_note(ctx):
   403 def user_note(ctx):
   403     """update the note of the given address"""
   404     """update the note of the given address"""
   404     ctx.hdlr.user_note(ctx.args.address.lower(), ctx.args.note)
   405     ctx.hdlr.user_note(ctx.args.address.lower(), ctx.args.note)
   830 
   831 
   831     up = a('userpassword', aliases=('up',),
   832     up = a('userpassword', aliases=('up',),
   832            help=_('update the password for the given address'),
   833            help=_('update the password for the given address'),
   833            epilog=fill(_("The password of an account can be updated with this "
   834            epilog=fill(_("The password of an account can be updated with this "
   834                "subcommand.\n\nIf no password was provided, vmm will prompt "
   835                "subcommand.\n\nIf no password was provided, vmm will prompt "
   835                "for it interactively.")),
   836                "for it interactively. When the scheme was omitted, vmm will "
       
   837                "use misc.password_scheme from vmm.cfg. ")),
   836            formatter_class=RawDescriptionHelpFormatter)
   838            formatter_class=RawDescriptionHelpFormatter)
   837     up.add_argument('address',
   839     up.add_argument('address',
   838                     help=_("an account's e-mail address (local-part@fqdn)"))
   840                     help=_("an account's e-mail address (local-part@fqdn)"))
   839     up.add_argument('-p', metavar='PASSWORD', dest='password',
   841     up.add_argument('-p', metavar='PASSWORD', dest='password',
   840                     help=_("the user's new password"))
   842                     help=_("the user's new password"))
       
   843     up.add_argument('-s', metavar='SCHEME', dest='scheme',
       
   844                     help=_('scheme used for password hashing'))
   841     up.set_defaults(func=user_password, scmd='userpassword')
   845     up.set_defaults(func=user_password, scmd='userpassword')
   842 
   846 
   843     uq = a('userquota', aliases=('uq',),
   847     uq = a('userquota', aliases=('uq',),
   844            help=_('update the quota limit for the given address'),
   848            help=_('update the quota limit for the given address'),
   845            epilog=fill(_("This subcommand is used to set a new quota limit "
   849            epilog=fill(_("This subcommand is used to set a new quota limit "