Mercurial > lada > lada-client
comparison app.js @ 913:44d7822d0d55
Removed OpenId stuff.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 13 Aug 2015 11:48:26 +0200 |
parents | 69a22279cdb6 |
children | 9358c5feb843 |
comparison
equal
deleted
inserted
replaced
912:9fc4afd21f7f | 913:44d7822d0d55 |
---|---|
67 var queryString = document.location.href.split('?')[1]; | 67 var queryString = document.location.href.split('?')[1]; |
68 if (queryString) { | 68 if (queryString) { |
69 Lada.openIDParams = queryString; | 69 Lada.openIDParams = queryString; |
70 } | 70 } |
71 Ext.Ajax.request({ | 71 Ext.Ajax.request({ |
72 url: 'lada-server/login?return_to=' + window.location.href, | 72 url: 'lada-server/user', |
73 method: 'GET', | 73 method: 'GET', |
74 headers: { | |
75 'X-OPENID-PARAMS': Lada.openIDParams | |
76 }, | |
77 scope: this, | 74 scope: this, |
78 success: this.onLoginSuccess, | 75 success: this.onLoginSuccess, |
79 failure: this.onLoginFailure | 76 failure: this.onLoginFailure |
80 }); | 77 }); |
81 }, | 78 }, |
85 var json = Ext.decode(response.responseText); | 82 var json = Ext.decode(response.responseText); |
86 if (json) { | 83 if (json) { |
87 if (json.message === '699') { | 84 if (json.message === '699') { |
88 /* This is the unauthorized message with the authentication | 85 /* This is the unauthorized message with the authentication |
89 * redirect in the data */ | 86 * redirect in the data */ |
90 var authUrl = json.data; | 87 Ext.MessageBox.alert('Es konnte kein Benutzername gefunden werden!', |
91 location.href = authUrl; | 88 json.data); |
92 return; | 89 return; |
93 } | 90 } |
94 if (json.message === '698') { | 91 if (json.message === '698') { |
95 /* This is general authentication error */ | 92 /* This is general authentication error */ |
96 Ext.MessageBox.alert('Kommunikation mit dem Login Server fehlgeschlagen', | 93 Ext.MessageBox.alert('Kommunikation mit dem Login Server fehlgeschlagen', |
105 Ext.MessageBox.alert('Kommunikation mit dem Lada Server fehlgeschlagen', | 102 Ext.MessageBox.alert('Kommunikation mit dem Lada Server fehlgeschlagen', |
106 'Es konnte keine erfolgreiche Verbindung zum lada server aufgebaut werden.'); | 103 'Es konnte keine erfolgreiche Verbindung zum lada server aufgebaut werden.'); |
107 }, | 104 }, |
108 | 105 |
109 onLoginSuccess: function(response) { | 106 onLoginSuccess: function(response) { |
110 | |
111 if (!Ext.isIE9m) { | |
112 /* Strip out the openid query params to look nicers. */ | |
113 // Not supported in old IE's | |
114 window.history.pushState(this.name, this.name, window.location.pathname); | |
115 } | |
116 | |
117 Ext.create('Lada.view.Viewport'); | 107 Ext.create('Lada.view.Viewport'); |
118 | 108 |
119 /* Parse Username and Timestamp */ | 109 /* Parse Username and Timestamp */ |
120 var json = Ext.decode(response.responseText); | 110 var json = Ext.decode(response.responseText); |
121 Lada.username = json.data.username; | 111 Lada.username = json.data.username; |