def register_user():
     """ Expects request to have keys 'email', 'name', 'cgac_code', and 'title' """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.register,
                                             getSystemEmail=True,
                                             getSession=True)
 def checkEmailToken():
     """ Expects request to have token  """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(
         accountManager,
         accountManager.checkEmailConfirmationToken,
         getSession=True)
 def reset_password():
     """ Removes current password from DB and sends email with token for user to reset their password.  Expects 'email' key in request body. """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.resetPassword,
                                             RouteUtils.SYSTEM_EMAIL,
                                             session)
Esempio n. 4
0
    def list_submissions():
        """ List submission IDs associated with the current user """
        filter_by = request.args.get('filter_by')
        filter_by = filter_by.lower() if filter_by is not None else filter_by
        accountManager = AccountHandler(request,bcrypt = bcrypt)

        if filter_by == 'agency':
            return RouteUtils.run_instance_function(accountManager, accountManager.listSubmissionsByCurrentUserAgency)
        return RouteUtils.run_instance_function(accountManager, accountManager.listSubmissionsByCurrentUser)
 def email_users():
     """
     Sends email notifications to users that their submission is ready for review & publish viewing
     """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.emailUsers,
                                             RouteUtils.SYSTEM_EMAIL,
                                             session)
 def checkPasswordToken():
     """ Expects request to have email  """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(
         accountManager, accountManager.checkPasswordToken, getSession=True)
 def max_login():
     account_manager = AccountHandler(request)
     return account_manager.max_login(session)
 def set_password():
     """ Set a new password for specified user """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.set_new_password(session)
 def current_user():
     """ gets the current user information """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.get_current_user(session)
 def checkEmailToken():
     """ Expects request to have token  """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.check_email_confirmation_token(session)
 def list_user_emails():
     """ list all users """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.list_user_emails()
 def register_user():
     """ Expects request to have keys 'email', 'name', 'cgac_code', and 'title' """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.register(system_email, session)
 def delete_user():
     """ Updates editable fields for the specified user """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.deleteUser()
 def login():
     account_manager = AccountHandler(request, bcrypt=bcrypt)
     return account_manager.login(session)
 def logout():
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.logout,
                                             getSession=True)
Esempio n. 16
0
 def confirm():
     """ Expects request to have email  """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(
         accountManager, accountManager.createEmailConfirmation, True, True)
Esempio n. 17
0
 def update_user():
     """ Updates editable fields for the specified user """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.updateUser,
                                             getSystemEmail=True)
 def max_login():
     account_manager = AccountHandler(request)
     return account_manager.max_login(session)
Esempio n. 19
0
 def set_skip_guide():
     """ Sets skip_guide param for current user """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.setSkipGuide,
                                             getSession=True)
 def max_login():
     accountManager = AccountHandler(request)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.max_login,
                                             session)
 def email_users():
     """
     Sends email notifications to users that their submission is ready for review & publish viewing
     """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.email_users(system_email, session)
Esempio n. 22
0
 def list_users():
     """ list all users """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.listUsers)
 def update_user():
     """ Updates editable fields for the specified user """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.update_user(system_email)
Esempio n. 24
0
 def list_users_with_status():
     """ Expects request to have key 'status', will list all users with that status """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(
         accountManager, accountManager.listUsersWithStatus)
 def confirm():
     """ Expects request to have email  """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.create_email_confirmation(system_email)
Esempio n. 26
0
 def set_password():
     """ Set a new password for specified user """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.setNewPassword,
                                             getSession=True)
 def checkPasswordToken():
     """ Expects request to have email  """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.checkPasswordToken(session)
Esempio n. 28
0
 def current_user():
     """ gets the current user information """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.getCurrentUser,
                                             getSession=True)
 def list_users_with_status():
     """ Expects request to have key 'status', will list all users with that status """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.list_users_with_status()
 def set_skip_guide():
     """ Sets skip_guide param for current user """
     account_manager = AccountHandler(request, bcrypt=bcrypt)
     return account_manager.set_skip_guide()
 def reset_password():
     """ Removes current password from DB and sends email with token for user to reset their password.  Expects 'email' key in request body. """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.reset_password(system_email, session)
 def email_users():
     """
     Sends email notifications to users that their submission is ready for review & publish viewing
     """
     account_manager = AccountHandler(request, bcrypt=bcrypt)
     return account_manager.email_users(system_email)
 def set_skip_guide():
     """ Sets skip_guide param for current user """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return accountManager.set_skip_guide(session)
 def login():
     account_manager = AccountHandler(request, bcrypt=bcrypt)
     return account_manager.login(session)