예제 #1
0
def do_cli(manager, options, session=None):
    if hasattr(options, 'user'):
        options.user = options.user.lower()

    if options.action == 'passwd':
        user = user_exist(name=options.user, session=session)
        if not user:
            console('User %s does not exist' % options.user)
            return
        try:
            change_password(user_name=user.name,
                            password=options.password,
                            session=session)
        except WeakPassword as e:
            console(e.value)
            return
        console('Updated password for user %s' % options.user)

    if options.action == 'gentoken':
        user = user_exist(name=options.user, session=session)
        if not user:
            console('User %s does not exist' % options.user)
            return
        user = generate_token(user_name=user.name, session=session)
        console('Generated new token for user %s' % user.name)
        console('Token %s' % user.token)
예제 #2
0
 def put(self, session=None):
     """ Change user password """
     user = current_user
     data = request.json
     try:
         change_password(username=user.name, password=data.get('password'), session=session)
     except WeakPassword as e:
         raise BadRequest(e.value)
     return success_response('Successfully changed user password')
예제 #3
0
파일: user.py 프로젝트: Flexget/Flexget
 def put(self, session=None):
     """ Change user password """
     user = current_user
     data = request.json
     try:
         change_password(username=user.name, password=data.get('password'), session=session)
     except WeakPassword as e:
         raise BadRequest(e.value)
     return success_response('Successfully changed user password')
예제 #4
0
파일: user.py 프로젝트: AlinaKay/Flexget
 def put(self, session=None):
     """ Change user password """
     user = current_user
     data = request.json
     try:
         change_password(username=user.name, password=data.get('password'), session=session)
     except WeakPassword as e:
         return {'status': 'error',
                 'message': e.value}, 500
     return {'status': 'success',
             'message': 'Successfully changed user password'}
예제 #5
0
파일: user.py 프로젝트: cyberguard/Flexget
 def put(self, session=None):
     """ Change user password """
     user = current_user
     data = request.json
     try:
         change_password(user_name=user.name, password=data.get('password'), session=session)
     except WeakPassword as e:
         return {'status': 'error',
                 'message': e.value}, 500
     return {'status': 'success',
             'message': 'Successfully changed user password'}
예제 #6
0
파일: web.py 프로젝트: cash2one/flexget
def do_cli(manager, options, session=None):
    if options.action == 'passwd':
        try:
            change_password(password=options.password, session=session)
        except WeakPassword as e:
            console(e.value)
            return
        console('Updated password')

    if options.action == 'gentoken':
        token = generate_token(session=session)
        console('Generated new token %s' % token)

    if options.action == 'showtoken':
        user = get_user()
        console('Token: %s' % user.token)
예제 #7
0
파일: web.py 프로젝트: AlinaKay/Flexget
def do_cli(manager, options, session=None):
    if options.action == 'passwd':
        try:
            change_password(password=options.password, session=session)
        except WeakPassword as e:
            console(e.value)
            return
        console('Updated password')

    if options.action == 'gentoken':
        token = generate_token(session=session)
        console('Generated new token %s' % token)

    if options.action == 'showtoken':
        user = get_user()
        console('Token: %s' % user.token)
예제 #8
0
파일: users.py 프로젝트: Marmau/Flexget
def do_cli(manager, options, session=None):
    if hasattr(options, 'user'):
        options.user = options.user.lower()

    if options.action == 'passwd':
        user = user_exist(name=options.user, session=session)
        if not user:
            console('User %s does not exist' % options.user)
            return
        try:
            change_password(user_name=user.name, password=options.password, session=session)
        except WeakPassword as e:
            console(e.value)
            return
        console('Updated password for user %s' % options.user)

    if options.action == 'gentoken':
        user = user_exist(name=options.user, session=session)
        if not user:
            console('User %s does not exist' % options.user)
            return
        user = generate_token(user_name=user.name, session=session)
        console('Generated new token for user %s' % user.name)
        console('Token %s' % user.token)