def setnum(self, format=None): "Set number of account items returned" num = check_num_param(request) if num and num in [10, 20, 50, 100]: session['accounts_num_items'] = num session.save() nextpage = request.headers.get('Referer', '/') if '://' in nextpage: from_url = urlparse(nextpage) nextpage = from_url[2] redirect(nextpage)
def setnum(self, format=None): "Set num of organizations returned" num = check_num_param(request) if num and num in [10, 20, 50, 100]: session["organizations_num_items"] = num session.save() nextpage = request.headers.get("Referer", "/") if "://" in nextpage: from_url = urlparse(nextpage) nextpage = from_url[2] redirect(nextpage)
def setnum(self, format=None): "Set number of items to return for auditlog/mailq" app = request.GET.get('ac', 'mailq') num = check_num_param(request) if num and num in [10, 20, 50, 100]: if app == 'auditlog': session['auditlog_num_items'] = num else: session['mailq_num_items'] = num session.save() nextpage = request.headers.get('Referer', '/') if '://' in nextpage: from_url = urlparse(nextpage) nextpage = from_url[2] redirect(nextpage)
def setnum(self, format=None): "Set num of items to return" num = check_num_param(request) if num and num in [10, 20, 50, 100]: session['msgs_search_num_results'] = num session['msgs_num_items'] = num session.save() nextpage = request.headers.get('Referer', '/') if '://' in nextpage: from_url = urlparse(nextpage) nextpage = from_url[2] params = [] for param in request.params: value = request.params[param] if value: params.append('%s=%s' % (urllib2.quote(param), urllib2.quote(value))) if params: nextpage = "%s?%s" % (nextpage, '&'.join(params)) redirect(nextpage)