Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add : hostd, password on register.

  • Loading branch information...
commit 837550c48ad9d17cfa3c46b2987593584552a8e2 1 parent c396057
@naparuba authored
View
8 shinken/webui/plugins_hostd/register/register.py
@@ -24,6 +24,7 @@
# along with Shinken. If not, see <http://www.gnu.org/licenses/>.
import json
+import hashlib
from shinken.webui.bottle import redirect
@@ -37,7 +38,11 @@ def register():
def do_register():
username = app.request.forms.get('username')
-
+ email = app.request.forms.get('email')
+ password = app.request.forms.get('password')
+ password_hash = hashlib.sha512(password).hexdigest()
+ print "Get a new user %s with email %s and hash %s" % (username, email, password_hash)
+
def is_name_available():
app.response.content_type = 'application/json'
@@ -56,5 +61,6 @@ def is_name_available():
pages = {register : { 'routes' : ['/register'], 'view' : 'register', 'static' : True},
is_name_available : { 'routes' : ['/availability'], 'method' : 'POST', 'view' : None, 'static' : True},
+ do_register : { 'routes' : ['/register'], 'method' : 'POST', 'view' : 'register', 'static' : True},
}
View
20 shinken/webui/plugins_hostd/register/views/register.tpl
@@ -42,14 +42,18 @@ $(document).ready(function(){
Please register <br/>
<form class='well span5 offset2' name='register' action='/register' METHOD='POST'>
- <input type="textarea" name='username' class="span3" placeholder="Username" onChange="check_username(this.value)">
- <span class="help-inline">Username <i id='name_ok' class="icon-ok"></i> <i id='name_bad' class="icon-remove"></i> </span>
-
- <div class="input-prepend">
- <span class="add-on"><i class="icon-envelope"></i></span><input class="span2" nae="email" type="text">
- <span class="help-inline"> Email </span>
- </div>
-
+ <div class="input-prepend">
+ <span class="add-on"><i class="icon-user"></i></span><input type="textarea" name='username' class="span4" placeholder="Username" onKeydown="check_username(this.value)">
+ <span class="help-inline"><i id='name_ok' class="icon-ok"></i> <i id='name_bad' class="icon-remove"></i> </span>
+ </div>
+ <div class="input-prepend">
+ <span class="add-on"><i class="icon-envelope"></i></span><input class="span3" name="email" type="text" placeholder="Email">
+ </div>
+
+ <div class="input-prepend">
+ <span class="add-on"><i class="icon-check"></i></span><input class="span3" name="password" type="password" placeholder="Password">
+ </div>
+
<a href='javascript:submit();' class='btn'> submit</a>
</form>
Please sign in to comment.
Something went wrong with that request. Please try again.