def remind_submit(self): """ Password remind request submitted. """ user = request.params['username'] (key, email) = app_globals.rpcservice.get_password_link(user) if key: msg = _( "You (or someone else) requested change of forgotten password to SZARP Synchronization Server.\n\nIf you did not request password change, just ignore this e-mail.\nIf you want to reset your SZARP synchronization password, click (or paste to your WWW browser) following link: \n%s\nLink is valid to the end of current day.\n\nSZARP Synchronization Server\n" ) % (url(controller='login', action='activate_link', qualified=True, user=user, key=key)) send_email(email, _("SZARP sync password reset"), msg) # We display this message also for non-existent user names so this page # cannot be used to check existing user names. c.message = _( "Check your e-mail for password activation link. Link is valid to the end of current day." ) c.controller = 'syncuser' c.action = "index" return render("/info.mako")
def save(self, id=None): log.debug('save: id %s params %s', id, str(request.params)) user = dict() if id is None: user['name'] = request.params['name'] else: user['name'] = id for f in ('email', 'server', 'hwkey', 'comment'): user[f] = request.params[f] user['sync'] = self._get_selected_bases(request) if request.params['exp'] == 'date': user['expired'] = request.params['expired'] else: user['expired'] = '-1' if id is None: try: password = app_globals.rpcservice.add_user(session['user'], session['passhash'], user) msg = _("Your SZARP Synchronization account has been created.\n\nYour login: %s\nYour password: %s\nVisist %s to change your password and view your settings.\n\nSZARP Synchronization Server\n") % (user['name'], password, url('home', qualified = True)) send_email(user['email'], _("SZARP sync new account"), msg) except Exception, e: log.error(str(e)) raise e return redirect(url.current(action='edit', id=user['name']))
def reset_password_confirmed(self, id): """ Reset user password and send e-mail with password. """ password = app_globals.rpcservice.reset_password(session['user'], session['passhash'], id) user = app_globals.rpcservice.get_user(session['user'], session['passhash'], id) msg = _("Your password for SZARP Synchronization Server has been reset by administrator.\nYour login is '%s', your new password is '%s'.\n\nSZARP Synchronization Server\n") % (user['name'], password) send_email(user['email'], _("SZARP sync new password"), msg) c.message = "New password has been sent to user %s" % id c.controller = 'syncuser' c.action = 'edit' return render('/info.mako')
def activate_link(self): """ Password activation link. """ user = request.params['user'] key = request.params['key'] (password, email) = app_globals.rpcservice.activate_password_link(user, key) if password is False: c.message = _("Link is incorrect or outdated!") else: msg = _("Your password for SZARP Synchronization Server has been reset.\nYour login is '%s', your new password is '%s'.\n\nSZARP Synchronization Server\n") % (user, password) send_email(email, _("SZARP sync new password"), msg) c.message = _("Your password has been reset. New password has been sent to you by e-mail.") c.action = "index" c.controller = 'login' return render("/info.mako")
def remind_submit(self): """ Password remind request submitted. """ user = request.params['username'] (key, email) = app_globals.rpcservice.get_password_link(user) if key: msg = _("You (or someone else) requested change of forgotten password to SZARP Synchronization Server.\n\nIf you did not request password change, just ignore this e-mail.\nIf you want to reset your SZARP synchronization password, click (or paste to your WWW browser) following link: \n%s\nLink is valid to the end of current day.\n\nSZARP Synchronization Server\n") % (url(controller = 'login', action = 'activate_link', qualified = True, user = user, key = key)) send_email(email, _("SZARP sync password reset"), msg) # We display this message also for non-existent user names so this page # cannot be used to check existing user names. c.message = _("Check your e-mail for password activation link. Link is valid to the end of current day.") c.controller = 'syncuser' c.action = "index" return render("/info.mako")
def activate_link(self): """ Password activation link. """ user = request.params['user'] key = request.params['key'] (password, email) = app_globals.rpcservice.activate_password_link(user, key) if password is False: c.message = _("Link is incorrect or outdated!") else: msg = _( "Your password for SZARP Synchronization Server has been reset.\nYour login is '%s', your new password is '%s'.\n\nSZARP Synchronization Server\n" ) % (user, password) send_email(email, _("SZARP sync new password"), msg) c.message = _( "Your password has been reset. New password has been sent to you by e-mail." ) c.action = "index" c.controller = 'login' return render("/info.mako")