user.html: Only show authorized options in pulldown
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
4d3736b7aa
commit
cf3d3eb790
|
@ -288,7 +288,13 @@ def user_info(nickname):
|
|||
""",(user["email"],))
|
||||
mysql.close()
|
||||
routers = mysql.utcawaretuple(routers,"created")
|
||||
return render_template("user.html", user=user, routers=routers, routers_count=len(routers))
|
||||
return render_template("user.html",
|
||||
user=user,
|
||||
routers=routers,
|
||||
routers_count=len(routers),
|
||||
authuser = is_authorized(user["nickname"], session),
|
||||
authadmin = session.get('admin')
|
||||
)
|
||||
|
||||
@app.route('/statistics')
|
||||
def global_statistics():
|
||||
|
|
|
@ -30,10 +30,11 @@
|
|||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{# FIXME: If authorized #}
|
||||
{%- if authuser %}
|
||||
<li><a href="#" data-toggle="modal" data-target="#changepw">Change Password</a></li>
|
||||
<li><a href="#" data-toggle="modal" data-target="#changemail">Change E-Mail Address</a></li>
|
||||
{%- if session.admin %}
|
||||
{%- endif %}
|
||||
{%- if authadmin %}
|
||||
<li><a href="#" onclick="$('#delaccform').submit()">Delete Account</a></li>
|
||||
<li><a href="#" onclick="$('#adminform').submit()">Toggle admin</a></li>
|
||||
<li><a href="#" onclick="$('#abuseform').submit()">Toggle abuse</a></li>
|
||||
|
|
Loading…
Reference in New Issue