| | |
| | | $('#neueRolle').click(um_new_role); |
| | | $('#rollen').click(um_role_list_click); |
| | | $('#nutzerrollen').click(um_user_role_list_click); |
| | | $('#userMenu').text('?'); |
| | | $('#logout').click(um_apicall_logout); |
| | | um_clear_user_form(); |
| | | um_apicall_get_user_list(); |
| | | um_apicall_get_granted_roles(); |
| | | um_apicall_get_login(); |
| | | } |
| | | |
| | | /* ----- user functions ------ */ |
| | |
| | | function um_user_form_lesen() { |
| | | var userId = $('#anmeldename').val(); |
| | | var kw = $('#kennwort').val(); |
| | | var user = new User(userId, kw, '-', '-', '-'); |
| | | var firstName = $('#vorname').val(); |
| | | var lastName = $('#nachname').val(); |
| | | var user = new User(userId, kw, firstName, lastName, '-'); |
| | | return user; |
| | | } |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | function um_apicall_get_login() { |
| | | var m = '?c=de.uhilger.um.pub.SessionManager&m=getSessionUser'; |
| | | var u = '../pub' + m; |
| | | $.ajax({ |
| | | url: u, |
| | | type: "GET", |
| | | dataType : "json", |
| | | success: function( resp ) { |
| | | $('#userMenu').text(resp.UserData.firstName); |
| | | }, |
| | | error: function( xhr, status, errorThrown ) { |
| | | $('#fehler').html("Error: " + errorThrown + " Status: " + status); |
| | | }, |
| | | complete: function( xhr, status ) { |
| | | //alert( "The request is complete!" ); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | function um_apicall_logout() { |
| | | var m = '?c=de.uhilger.um.pub.SessionManager&m=expireSession'; |
| | | var u = '../pub' + m; |
| | | $.ajax({ |
| | | url: u, |
| | | type: "GET", |
| | | dataType : "text", |
| | | success: function( resp ) { |
| | | $('#userMenu').text('nicht angemeldet'); |
| | | window.location.href = '../logout.html'; |
| | | }, |
| | | error: function( xhr, status, errorThrown ) { |
| | | $('#fehler').html("Error: " + errorThrown + " Status: " + status); |
| | | }, |
| | | complete: function( xhr, status ) { |
| | | //alert( "The request is complete!" ); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* ----- Hilfsfunktionen ----- */ |
| | | |
| | | function serialisieren(obj) { |