Browse Source

Sig in interface

prieto 8 years ago
parent
commit
899cc4e133

+ 8
- 1
plugins/webui/interface/controllers/users.py View File

@@ -2,6 +2,7 @@
2 2
 from .base import get_response
3 3
 from ...exceptions import *
4 4
 from ...client import WebUiClient as WebUiClient
5
+from lodel.auth.client import LodelSession as Session
5 6
 from lodel import logger
6 7
 import leapi_dyncode as dyncode
7 8
 
@@ -9,7 +10,13 @@ def signin(request):
9 10
     msg=''
10 11
     if request.method == 'POST':
11 12
         WebUiClient.authenticate(request.form['inputLogin'], request.form['inputPassword'])
12
-        return get_response('users/welcome.html')
13
+        logger.debug(WebUiClient.session().datas)
14
+        uid=WebUiClient.session().datas['__auth_user_infos']['uid']
15
+        leoclass=WebUiClient.session().datas['__auth_user_infos']['leoclass']
16
+        query_filter=list()
17
+        query_filter.append((leoclass.uid_fieldname()[0],' = ', uid))
18
+        username = leoclass.get(query_filter)
19
+        return get_response('users/welcome.html', username = username)
13 20
     else:
14 21
         return get_response('users/signin.html')
15 22
 

+ 1
- 1
plugins/webui/templates/users/welcome.html View File

@@ -6,7 +6,7 @@
6 6
 {% endblock %}
7 7
 {% block content %} 
8 8
 <div class="container">
9
-    <h1>Lodel2 - Welcome</h1>
9
+    <h1>Lodel2 - Welcome {{ username }}</h1>
10 10
     <div class="row">
11 11
         <div class="col-md-6"></div>
12 12
         <div class="col-md-6">You are successfully login...</div>

Loading…
Cancel
Save