Esempio n. 1
0
def view_eula():
	if request.user.liability and request.user.safety:
		redirect('/', 303)
	i18n_o = i18n.override_title('eula',i18n.i18n['e']['pages']['eula']['title'],i18n.i18n['f']['pages']['eula']['title'])
	for i in ('e','f'):
		i18n_o[i]['pages']['register']['agree'] = i18n.i18n[i]['pages']['eula']['agree']
	return dict(page='register',
				i18n=i18n_o)
Esempio n. 2
0
def view_edit_post(pid):
	try:
		p = Post.from_pid(pid)
		return dict(post=p,mode='edit',
					i18n=i18n.override_title('create_editpost','Editing EN:"' + p.title_e + '" FR:"' + p.title_f + '"','Editing "' + p.title_f + '"'))
	except IndexError, e:
		request.session.error = 'nopostpid'
		return dict(error='nopostpid',mode='edit')
Esempio n. 3
0
def view_user(name):
	if request.station and not ('HTTP_REFERER' in request.environ and '/station' in request.environ['HTTP_REFERER']):
		error(code=401)
	if (not request.admin) and (request.user.username != name) and not request.station:
		error(code=401)
	user = Account.get_user(name)
	if not user:
		error(code=404)
	return dict(vuser=user,i18n=i18n.override_title('user',user.username,user.username))
Esempio n. 4
0
def view_user_edit(name):
	if not request.admin and request.user.username != name:
		error(code=401)
	user = Account.get_user(name)
	if not user:
		error(code=404)
	return dict(vuser=user,
				i18n=i18n.override_title('user_edit',
										 i18n.i18n['e']['pages']['user_edit']['editing'] + ' ' + user.username,
										 i18n.i18n['f']['pages']['user_edit']['editing'] + ' ' + user.username))
Esempio n. 5
0
def view_user(name):
    if request.station and not ('HTTP_REFERER' in request.environ and
                                '/station' in request.environ['HTTP_REFERER']):
        error(code=401)
    if (not request.admin) and (request.user.username !=
                                name) and not request.station:
        error(code=401)
    user = Account.get_user(name)
    if not user:
        error(code=404)
    return dict(vuser=user,
                i18n=i18n.override_title('user', user.username, user.username))
Esempio n. 6
0
def view_user_edit(name):
    if not request.admin and request.user.username != name:
        error(code=401)
    user = Account.get_user(name)
    if not user:
        error(code=404)
    return dict(vuser=user,
                i18n=i18n.override_title(
                    'user_edit',
                    i18n.i18n['e']['pages']['user_edit']['editing'] + ' ' +
                    user.username,
                    i18n.i18n['f']['pages']['user_edit']['editing'] + ' ' +
                    user.username))
Esempio n. 7
0
def view_edit_post(pid):
    try:
        p = Post.from_pid(pid)
        return dict(
            post=p,
            mode="edit",
            i18n=i18n.override_title(
                "create_editpost",
                'Editing EN:"' + p.title_e + '" FR:"' + p.title_f + '"',
                'Editing "' + p.title_f + '"',
            ),
        )
    except IndexError, e:
        request.session.error = "nopostpid"
        return dict(error="nopostpid", mode="edit")
Esempio n. 8
0
def view_post(pid):
    try:
        p = Post.from_pid(pid)
        return dict(post=p, i18n=i18n.override_title("index", p.title_e, p.title_f))
    except:
        error(code=404)
Esempio n. 9
0
def view_post(pid):
	try:
		p = Post.from_pid(pid)
		return dict(post=p,i18n=i18n.override_title('index',p.title_e,p.title_f))
	except:
		error(code=404)