This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2017-01-11 22:14:52 +01:00

113 lines
4.5 KiB
HTML

{% extends "base.html" %}
{%block header%}
{% include "nav.html" with active="profile" %}
{%endblock%}
{% block content %}
<div class="row-fluid">
<section class="span4">
<h2>Om deg</h2>
<div class="well">
<ul>
<li><strong>Brukernavn</strong>: {{user.username}}</li>
<li><strong>Navn</strong>: {{user.first_name}} {{user.last_name}}</li>
<li><strong>Mail</strong>: {{user.email}}</li>
</ul>
</div>
</section>
<section class="span4">
<h2>Dine tjenester</h2>
<div class="well">
<ul>
<li><span id="sso">Felles innlogging (DNS-konto)</span></li>
<li><span id="wireless_status">Trådløst nettverk (neuf-wifi)</span></li>
<li><span id="client_status">Foreningsmaskiner</span></li>
</ul>
</div>
</section>
<section class="span4">
<h2>Dine grupper</h2>
<div class="well">
<ul>
{% if groups %}
{% for group in groups %}
{% if group == "dns-aktiv" %}
<li title="Du har tilgang til foreningsmaskinene.">{{ group }}</li>
{% else %}
<li>{{ group }}</li>
{% endif %}
{% endfor %}
{% else %}
<li>Ingen grupper.</li>
{% endif %}
</ul>
</div>
</section>
</div>
{%endblock%}
{% block tailinc %}
<script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap-tooltip.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap-popover.js"></script>
<script>
$(function() {
/* FIXME cleanup this mess */
var username = "{{user.username}}";
/* Display the service status of the user */
var img_check = ' <img src="{{ STATIC_URL }}style/img/check.png" alt="OK" />';
var img_error = ' <img src="{{ STATIC_URL }}style/img/exclamation_mark.png" alt="ERROR" />';
var image = '';
var title = '';
var data_content = '';
$.getJSON("/userstatus/client/?format=json&username="+username, function(data) {
if(data.active) {
image = img_check;
title = 'Du har en bruker til foreningsmaskinene';
data_content = 'Siste vellykkede pålogging: ' + data.last_successful_auth;
} else {
image = img_error;
title = 'Ingen konto';
data_content = 'Du mangler Kerberos principal.';
}
$("#client_status").append(image).prop('title', title).attr('data-content', data_content).popover();
});
/*$.getJSON("/userstatus/wireless/?format=json&username="+username, function(data) {
if(data.active) {
image = img_check;
title = 'Du har tilgang til trådløst nettverk';
data_content = 'Siste vellykkede pålogging: ';
if(data.last_successful_auth != undefined) {
data_content += data.last_successful_auth;
} else {
data_content += 'Ukjent.'
}
} else {
image = img_error;
title = 'Ingen trådløskonto';
data_content = 'Du har ikke en trådløskonto i Radius.';
}
$("#wireless_status").append(image).prop('title', title).attr('data-content', data_content).popover();
});*/
/* Radius is not in use, show info about SSID with PSK */
title = 'Du har tilgang til trådløst nettverk';
data_content = 'Spør andre aktive eller i Glassbaren om passord til neuf-wifi';
$("#wireless_status").append(img_check).prop('title', title).attr('data-content', data_content).popover();
$.getJSON("/ldap/users/"+username+"/")
.done(function(data) {
image = img_check;
title = 'Gyldig DNS-konto for aktive';
data_content = 'Din konto støtter felles innlogging og kan brukes f.eks på aktiv.neuf.no.';
$("#sso").append(image).prop('title', title).attr('data-content', data_content).popover();
})
.fail(function() {
image = img_error;
title = 'Ingen DNS-konto for aktive';
data_content = 'Kun medlemmer av gruppen dns-aktiv kan bruke felles innlogging.';
$("#sso").append(image).prop('title', title).attr('data-content', data_content).popover();
});
});
</script>
{% endblock %}