def status(inst, basedn, log, args): dn = _get_arg( args.dn, msg="Enter dn to check") accounts = Accounts(inst, basedn) acct = accounts.get(dn=dn) acct_str = "locked: %s" % acct.is_locked() log.info('dn: %s' % dn) log.info(acct_str)
def reset_password(inst, basedn, log, args): dn = _get_arg(args.dn, msg="Enter dn to reset password") new_password = _get_arg(args.new_password, hidden=True, confirm=True, msg="Enter new password for %s" % dn) accounts = Accounts(inst, basedn) acct = accounts.get(dn=dn) acct.reset_password(new_password) log.info('reset password for %s' % dn)
def change_password(inst, basedn, log, args): dn = _get_arg(args.dn, msg="Enter dn to change password") cur_password = _get_arg(args.current_password, hidden=True, confirm=False, msg="Enter current password for %s" % dn) new_password = _get_arg(args.new_password, hidden=True, confirm=True, msg="Enter new password for %s" % dn) accounts = Accounts(inst, basedn) acct = accounts.get(dn=dn) acct.change_password(cur_password, new_password) log.info('changed password for %s' % dn)
def unlock(inst, basedn, log, args): dn = _get_arg( args.dn, msg="Enter dn to check") accounts = Accounts(inst, basedn) acct = accounts.get(dn=dn) acct.unlock() log.info('unlocked %s' % dn)
def entry_status(inst, basedn, log, args): dn = _get_dn_arg(args.dn, msg="Enter dn to check") accounts = Accounts(inst, basedn) acct = accounts.get(dn=dn) status = acct.status() _print_entry_status(status, dn, log, args)
def unlock(inst, basedn, log, args): dn = _get_dn_arg(args.dn, msg="Enter dn to unlock") accounts = Accounts(inst, basedn) acct = accounts.get(dn=dn) acct.unlock() log.info(f'Entry {dn} is unlocked')