From 18ff58e74f9dce2531d3f68f1d2aeecada9ac73f Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 26 Jun 2012 17:43:50 +0200 Subject: using layout in the sinatra app --- http-srp.rb | 8 +++++ public/login.html | 48 ----------------------------- public/signup.html | 48 ----------------------------- views/index.erb | 88 +++++++++++++++++++----------------------------------- views/layout.erb | 27 +++++++++++++++++ views/login.erb | 18 +++++++++++ views/signup.erb | 20 +++++++++++++ 7 files changed, 103 insertions(+), 154 deletions(-) delete mode 100644 public/login.html delete mode 100644 public/signup.html create mode 100644 views/layout.erb create mode 100644 views/login.erb create mode 100644 views/signup.erb diff --git a/http-srp.rb b/http-srp.rb index f57a6e1..ab1a4f4 100644 --- a/http-srp.rb +++ b/http-srp.rb @@ -34,12 +34,20 @@ get '/' do erb :index end +get '/signup' do + erb :signup +end + post '/signup' do @user = User.current @user.signup!(params) redirect '/' end +get '/login' do + erb :login +end + post '/login' do @user = User.current @user.login!(params) diff --git a/public/login.html b/public/login.html deleted file mode 100644 index 5de7810..0000000 --- a/public/login.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - Secure remote password - - - - - -
- -
-
-

Secure Remote Passwords

-

- Secure remote passwords allow you to login with a password that will be unkown to the server and anyone eavesdropping -

-
-
- -

2. Login

-
- Login with the user you created. -
- - -
- -
- - -
- -
- - Cancel -
-
- -
- - - - - - diff --git a/public/signup.html b/public/signup.html deleted file mode 100644 index c23abf3..0000000 --- a/public/signup.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - Secure remote password - - - - - -
- -
-
-

Secure Remote Passwords

-

- Secure remote passwords allow you to login with a password that will be unkown to the server and anyone eavesdropping -

-
-
- -

1. Signup

-
- Signup to test secure remote passwords -
- - -
- -
- - -
- -
- - Cancel -
-
- -
- - - - - - diff --git a/views/index.erb b/views/index.erb index e4995a5..54068c2 100644 --- a/views/index.erb +++ b/views/index.erb @@ -1,63 +1,35 @@ - - - - - Secure remote password - - - - -
- -
-
-

Secure Remote Passwords

-

- Secure remote passwords allow you to login with a password that will be unkown to the server and anyone eavesdropping -

-
-
- - -
-
-

1. Signup

-

- First you signup just like normal. Your browser runs a bit of javascript and does not transfer your password but some validator based on it. -

- <% if @user.login %> -

You are signed up as <%= @user.login %> - <% if @user.active %> -

You are logged in. - <% end %> +

+
+

1. Signup

+

+ First you signup just like normal. Your browser runs a bit of javascript and does not transfer your password but some validator based on it. +

+ <% if @user.login %> +

You are signed up as <%= @user.login %> + <% if @user.active %> +

You are logged in. <% end %> - - Signup now... - -

-
-

2. Login

-

- Login using the same credentials. Again javascript is used to calculate a random number and a key based on it that the server then uses to validate your password. -

- - Login - -
-
-

3. Verify

-

- The server logs will tell you your password was not transmitted in clear. Never the less the server can determine wether you were authorized. -

-
- - - + <% end %> + + Signup now... + +
+
+

2. Login

+

+ Login using the same credentials. Again javascript is used to calculate a random number and a key based on it that the server then uses to validate your password. +

+ + Login + +
+
+

3. Verify

+

+ The server logs will tell you your password was not transmitted in clear. Never the less the server can determine wether you were authorized. +

+
- - - - diff --git a/views/layout.erb b/views/layout.erb new file mode 100644 index 0000000..c68ac23 --- /dev/null +++ b/views/layout.erb @@ -0,0 +1,27 @@ + + + + + Secure remote password + + + + + +
+ +
+
+

Secure Remote Passwords

+

+ Secure remote passwords allow you to login with a password that will be unkown to the server and anyone eavesdropping +

+
+
+ + <%= yield %> + + + + + diff --git a/views/login.erb b/views/login.erb new file mode 100644 index 0000000..32a16e5 --- /dev/null +++ b/views/login.erb @@ -0,0 +1,18 @@ +

2. Login

+
+ Login with the user you created. +
+ + +
+ +
+ + +
+ +
+ + Cancel +
+
diff --git a/views/signup.erb b/views/signup.erb new file mode 100644 index 0000000..3a949ab --- /dev/null +++ b/views/signup.erb @@ -0,0 +1,20 @@ + +

1. Signup

+
+ Signup to test secure remote passwords +
+ + +
+ +
+ + +
+ +
+ + Cancel +
+
+ -- cgit v1.2.3