def user_new(email): # create user and get the initial password in plaintext. email = _unicode_fix(email) user, password = get_user_database().new_user_from_email(email) transaction_commit(None, 'NewUser') # moved from user.ptl/NewUserForm.commit() # send email e = url_quote(email) p = url_quote(password) s = url_quote("Sign in") message = _(_new_user_message) % dict(email=email, password=password, auto_login_url=messages.login_url + "?email=" + e + "&password="******"&submit-login="******"&from_url=Y") extra_headers = ['Content-Type: text/html'] # because of the href sendmail("Welcome to ned.com", message, [email], extra_headers=extra_headers) # send pm using _live_tmpl_pm_new_user in sitedev as the template template_text = qon.util.get_page_template('pm_new_user', format='text') if template_text: message_anon_send(user, "Welcome to ned.com!", template_text, True) # add orientation page to all new users' watch lists try: orientation = get_group_database()['help'].get_wiki().pages['start_here'] user.get_watch_list().watch_item(orientation) except: pass qon.search.searchengine.notify_new_user(user) return (email, message)
def _get_default_action_url(self): request = get_request() action_url = url_quote(request.get_path()) query = request.get_environ("QUERY_STRING") if query: action_url += "?" + query return action_url
def get_action_url(self): action_url = url_quote(get_path()) query = get_request().get_query() if query: action_url += "?" + query return action_url
def get_action_url(self, request): action_url = url_quote(request.get_path()) query = request.get_environ("QUERY_STRING") if query: action_url += "?" + query return action_url
def check_url_quote(self): assert url_quote('abc') == 'abc' assert url_quote('a b c') == 'a%20b%20c' assert url_quote(None, fallback='abc') == 'abc'