kirgudu_sso 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/templates/kirgudu_sso/authentications/base/fonts/caecilialtstd-bold-webfont.woff +0 -0
  6. data/app/assets/templates/kirgudu_sso/authentications/base/fonts/caecilialtstd-light-webfont.woff +0 -0
  7. data/app/assets/templates/kirgudu_sso/authentications/base/fonts/gotham-bold.woff +0 -0
  8. data/app/assets/templates/kirgudu_sso/authentications/base/fonts/gotham-book.woff +0 -0
  9. data/app/assets/templates/kirgudu_sso/authentications/base/images/badge-free.png +0 -0
  10. data/app/assets/templates/kirgudu_sso/authentications/base/images/badge-free@2x.png +0 -0
  11. data/app/assets/templates/kirgudu_sso/authentications/base/images/badge-premium.png +0 -0
  12. data/app/assets/templates/kirgudu_sso/authentications/base/images/badge-premium@2x.png +0 -0
  13. data/app/assets/templates/kirgudu_sso/authentications/base/images/chevron-blue-bg.png +0 -0
  14. data/app/assets/templates/kirgudu_sso/authentications/base/images/chevron-blue-bg@2x.png +0 -0
  15. data/app/assets/templates/kirgudu_sso/authentications/base/images/error-bang.png +0 -0
  16. data/app/assets/templates/kirgudu_sso/authentications/base/images/error-bang@2x.png +0 -0
  17. data/app/assets/templates/kirgudu_sso/authentications/base/images/green-check.png +0 -0
  18. data/app/assets/templates/kirgudu_sso/authentications/base/images/green-check@2x.png +0 -0
  19. data/app/assets/templates/kirgudu_sso/authentications/base/images/header-bar.png +0 -0
  20. data/app/assets/templates/kirgudu_sso/authentications/base/images/icon-settings.png +0 -0
  21. data/app/assets/templates/kirgudu_sso/authentications/base/images/icon-settings@2x.png +0 -0
  22. data/app/assets/templates/kirgudu_sso/authentications/base/images/icon-shield-white.png +0 -0
  23. data/app/assets/templates/kirgudu_sso/authentications/base/images/icon-shield-white@2x.png +0 -0
  24. data/app/assets/templates/kirgudu_sso/authentications/base/images/kirgudu-sso-tour1@2x.png +0 -0
  25. data/app/assets/templates/kirgudu_sso/authentications/base/images/kirgudu-sso-tour2@2x.png +0 -0
  26. data/app/assets/templates/kirgudu_sso/authentications/base/images/kirgudu-sso-tour3@2x.png +0 -0
  27. data/app/assets/templates/kirgudu_sso/authentications/base/images/menu-dropdown-arrow-white (1).png +0 -0
  28. data/app/assets/templates/kirgudu_sso/authentications/base/images/menu-dropdown-arrow-white.png +0 -0
  29. data/app/assets/templates/kirgudu_sso/authentications/base/images/settings-bg.jpeg +0 -0
  30. data/app/assets/templates/kirgudu_sso/authentications/base/stylesheets/register.css +794 -0
  31. data/app/assets/templates/kirgudu_sso/authentications/base/stylesheets/sso.css +4824 -0
  32. data/app/controllers/kirgudu_sso/authentications_controller.rb +140 -0
  33. data/app/controllers/kirgudu_sso/base_controller.rb +5 -0
  34. data/app/helpers/kirgudu_sso/application_helper.rb +4 -0
  35. data/app/models/kirgudu_sso/client.rb +142 -0
  36. data/app/models/kirgudu_sso/http_error.rb +5 -0
  37. data/app/views/kirgudu_sso/application.html.erb +14 -0
  38. data/app/views/kirgudu_sso/authentications/base/authentications/confirm_email.html.erb +51 -0
  39. data/app/views/kirgudu_sso/authentications/base/authentications/login.html.erb +60 -0
  40. data/app/views/kirgudu_sso/authentications/base/authentications/register.html.erb +123 -0
  41. data/app/views/kirgudu_sso/authentications/base/authentications/register_successful.html.erb +25 -0
  42. data/app/views/kirgudu_sso/authentications/base/authentications/restore_password.html.erb +53 -0
  43. data/app/views/kirgudu_sso/authentications/base/authentications/restore_password_code.html.erb +49 -0
  44. data/app/views/kirgudu_sso/authentications/base/authentications/restore_password_success.html.erb +33 -0
  45. data/app/views/kirgudu_sso/authentications/base/layouts/application.html.erb +128 -0
  46. data/app/views/kirgudu_sso/authentications/base/mailers/authentications/confirmation_code.html.erb +21 -0
  47. data/app/views/kirgudu_sso/authentications/base/mailers/authentications/confirmation_code.text.erb +21 -0
  48. data/app/views/kirgudu_sso/authentications/base/mailers/authentications/restore_password_code.html.erb +20 -0
  49. data/app/views/kirgudu_sso/authentications/base/mailers/authentications/restore_password_code.text.erb +20 -0
  50. data/app/views/kirgudu_sso/authentications/base/mailers/authentications/restore_password_success.html.erb +12 -0
  51. data/app/views/kirgudu_sso/authentications/base/mailers/authentications/restore_password_success.text.erb +18 -0
  52. data/config/locales/chupakabra_tools.en.yml +28 -0
  53. data/config/locales/chupakabra_tools.ru.yml +28 -0
  54. data/config/locales/kirgudu_sso.en.yml +79 -0
  55. data/config/locales/kirgudu_sso.ru.yml +145 -0
  56. data/config/routes.rb +2 -0
  57. data/lib/kirgudu_sso/engine.rb +5 -0
  58. data/lib/kirgudu_sso/version.rb +3 -0
  59. data/lib/kirgudu_sso.rb +4 -0
  60. data/lib/tasks/kirgudu_sso_tasks.rake +4 -0
  61. data/test/dummy/README.rdoc +28 -0
  62. data/test/dummy/Rakefile +6 -0
  63. data/test/dummy/app/assets/javascripts/application.js +13 -0
  64. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  65. data/test/dummy/app/controllers/application_controller.rb +5 -0
  66. data/test/dummy/app/helpers/application_helper.rb +2 -0
  67. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  68. data/test/dummy/bin/bundle +3 -0
  69. data/test/dummy/bin/rails +4 -0
  70. data/test/dummy/bin/rake +4 -0
  71. data/test/dummy/config/application.rb +23 -0
  72. data/test/dummy/config/boot.rb +5 -0
  73. data/test/dummy/config/database.yml +25 -0
  74. data/test/dummy/config/environment.rb +5 -0
  75. data/test/dummy/config/environments/development.rb +37 -0
  76. data/test/dummy/config/environments/production.rb +83 -0
  77. data/test/dummy/config/environments/test.rb +39 -0
  78. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  79. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  80. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  81. data/test/dummy/config/initializers/inflections.rb +16 -0
  82. data/test/dummy/config/initializers/mime_types.rb +4 -0
  83. data/test/dummy/config/initializers/session_store.rb +3 -0
  84. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  85. data/test/dummy/config/locales/en.yml +23 -0
  86. data/test/dummy/config/routes.rb +4 -0
  87. data/test/dummy/config/secrets.yml +22 -0
  88. data/test/dummy/config.ru +4 -0
  89. data/test/dummy/public/404.html +67 -0
  90. data/test/dummy/public/422.html +67 -0
  91. data/test/dummy/public/500.html +66 -0
  92. data/test/dummy/public/favicon.ico +0 -0
  93. data/test/integration/navigation_test.rb +10 -0
  94. data/test/kirgudu_sso_test.rb +7 -0
  95. data/test/test_helper.rb +15 -0
  96. metadata +258 -0
@@ -0,0 +1,140 @@
1
+ module KirguduSso
2
+ class AuthenticationsController < ::KirguduSso::BaseController
3
+
4
+ skip_before_action :authenticate_user
5
+
6
+ kb_template_path 'kirgudu_sso/authentications/base'
7
+
8
+ before_action :redirect_if_logged_in, except: [:logout]
9
+ before_action :load_sso_application_credentials
10
+
11
+
12
+ def login
13
+ local_data = {
14
+ messages: [],
15
+ errors: []
16
+ }
17
+ params_to_local_data = [:email, :password, :redirect_to]
18
+ params_to_local_data.each do |param_name|
19
+ local_data[param_name] = params[param_name] if params[param_name]
20
+ end
21
+ session[:redirect_to] = params[:redirect_to] if params[:redirect_to]
22
+
23
+ render "/#{self.get_template_path}/authentications/login", locals: {data: local_data}, layout: "/#{self.get_template_path}/layouts/application"
24
+ end
25
+
26
+ def login_process
27
+
28
+ local_data = {
29
+ messages: [],
30
+ errors: []
31
+ }
32
+ params_to_local_data = [:email, :password, :remember_me, :redirect_to]
33
+ params_to_local_data.each do |param_name|
34
+ local_data[param_name] = params[param_name] if params[param_name]
35
+ end
36
+
37
+ # Init Kirgudu Sso Client
38
+ sso_client = ::KirguduSso::Client.new(@sso_application_id, @sso_application_secret_key)
39
+
40
+ # Request Direct Login
41
+ if verify_recaptcha
42
+ begin
43
+ sso_result = sso_client.user_login(params[:email], params[:password])
44
+ # Processing Login Result
45
+ sso_result.symbolize_keys!
46
+ ActiveRecord::Base.transaction do
47
+ # logger.info "SSO USER RESULT: #{sso_result.to_json}"
48
+ # logger.info "SSO UIN: #{sso_result[:uin]}"
49
+ local_user = ::KirguduBase::Security::User.where(uin: sso_result[:uin]).first
50
+ #logger.info "LOCAL USER NOT FOUND with UIN: #{sso_result[:uin]}" unless local_user
51
+ unless local_user
52
+ local_user = ::KirguduBase::Security::User.new
53
+ local_user.mass_assign(sso_result)
54
+ local_user.password = ::ChupakabraTools::Security.get_password_hash("")
55
+ unless local_user.save
56
+ local_user.errors.each do |value|
57
+ local_data[:errors] << "#{value}: #{local_user.errors[value]}"
58
+ end
59
+ end
60
+ end
61
+ self.current_user_set_info(local_user, local_data[:remember_me]) if local_data[:errors].count == 0
62
+ # logger.info "CURRENT USER NAME: #{local_user.full_name}"
63
+ # logger.info "CURRENT USER ID: #{local_user.id}"
64
+ # logger.info "CURRENT USER UIN: #{local_user.uin}"
65
+ # logger.info "CURRENT USER ERRORS: #{local_user.errors.to_json}"
66
+ end
67
+ rescue Exception => e
68
+ local_data[:errors] << e.message
69
+ end
70
+ else
71
+ local_data[:errors] << I18n.t("kirgudu_sso.authentications.login.errors.captcha_error")
72
+ end
73
+
74
+ if @current_user
75
+ redirect_to root_path
76
+ else
77
+ render "/#{self.get_template_path}/authentications/login", locals: {data: local_data}, layout: "/#{self.get_template_path}/layouts/application"
78
+ end
79
+ end
80
+
81
+
82
+ def logout
83
+ self.clear_current_user_info
84
+ #logger.info "session[:user_id]=: #{session[:user_id]}"
85
+ redirect_to root_path
86
+ end
87
+
88
+ def register
89
+ local_data = {}
90
+ render "/#{self.get_template_path}/authentications/register", locals: {data: local_data}
91
+ end
92
+
93
+ def register_process
94
+
95
+ end
96
+
97
+ def restore_password
98
+ local_data = {}
99
+ render "/#{self.get_template_path}/authentications/restore_password", locals: {data: local_data}
100
+ end
101
+
102
+ def restore_password_process
103
+
104
+ end
105
+
106
+
107
+ def delete_user
108
+
109
+ end
110
+
111
+ def delete_user_process
112
+
113
+ end
114
+
115
+
116
+ protected
117
+
118
+ def user_strong_params(user_params)
119
+ #user_params.permit()
120
+ end
121
+
122
+
123
+ def redirect_if_logged_in
124
+ if @current_user
125
+ redirect_to root_path
126
+ end
127
+ end
128
+
129
+ def get_template_path
130
+ self.class.get_method_latest_result(:get_kb_template)
131
+ end
132
+
133
+ def load_sso_application_credentials
134
+ @sso_application_id = ENV["KIRGUDU_SSO_APPLICATION_ID"]
135
+ @sso_application_secret_key = ENV["KIRGUDU_SSO_APPLICATION_SECRET_KEY"]
136
+ raise "Please Load Environment Variables 'KIRGUDU_SSO_APPLICATION_ID' and 'KIRGUDU_SSO_APPLICATION_PASSWORD'" if @sso_application_id.nil? || @sso_application_secret_key.nil?
137
+ end
138
+
139
+ end
140
+ end
@@ -0,0 +1,5 @@
1
+ module KirguduSso
2
+ class BaseController < ::KirguduBase::ApplicationController
3
+
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module KirguduSso
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,142 @@
1
+ class KirguduSso::Client
2
+
3
+ attr_accessor :application_id
4
+ attr_accessor :secret_key
5
+
6
+ def initialize(application_id, secret_key)
7
+ self.application_id = application_id
8
+ self.secret_key = secret_key
9
+ end
10
+
11
+ def user_login(email, password, options = {})
12
+
13
+ # data for post to sso server
14
+ local_data =
15
+ {
16
+ application_id: self.application_id,
17
+ secret_key: self.secret_key,
18
+ email: email,
19
+ password: password
20
+ }
21
+ sso_server_result = nil
22
+
23
+ response = nil
24
+
25
+ begin
26
+ # posting request to sso server with supplied data in var 'local_data'
27
+ response = Net::HTTP.post_form(URI.parse("#{self.get_sso_website_url}/api/applications/users/login"), local_data)
28
+ rescue Exception => e
29
+ raise "#{::ChupakabraTools::ApiStatus[ChupakabraTools::ApiStatus.id_by_tag("http_error")]}. #{e.message}"
30
+ end
31
+
32
+ begin
33
+ # Deserializing Result from JSON Resoponse
34
+ sso_server_result = ActiveSupport::JSON.decode(response.body)
35
+ rescue Exception => e
36
+ raise ::ChupakabraTools::ApiStatus[ChupakabraTools::ApiStatus.id_by_tag("json_response_error")]
37
+ end
38
+ sso_server_result.symbolize_keys!
39
+ #raise "SSO: #{sso_server_result.to_json}"
40
+
41
+ if sso_server_result[:status] != ChupakabraTools::ApiStatus.id_by_tag("ok")
42
+ raise ChupakabraTools::ApiStatus[sso_server_result[:status]]
43
+ end
44
+ sso_server_result[:data]
45
+ end
46
+
47
+ def logout
48
+
49
+ end
50
+
51
+ def user_register(user, options = {})
52
+ result_hash = {
53
+ status: ::ChupakabraTools::ApiStatus.id_by_tag("unknown"),
54
+ message: ""
55
+ }
56
+ # data for post to sso server
57
+ local_data =
58
+ {
59
+ application_id: self.application_id,
60
+ secret_key: self.secret_key,
61
+ user: user
62
+ }
63
+ sso_server_result = nil
64
+
65
+ begin
66
+ # posting request to sso server with supplied data in var 'local_data'
67
+ response = Net::HTTP.post_form(URI.parse("#{self.get_sso_website_url}/api/applications/users/register"), local_data)
68
+ begin
69
+ # Deserializing Result from JSON Resoponse
70
+ sso_server_result = ActiveSupport::JSON.decode(response.body)
71
+ sso_server_result.symbolize_keys!
72
+ # setting result from server
73
+ result_hash[:status] = sso_server_result[:status]
74
+ result_hash[:user] = sso_server_result[:data]
75
+ rescue
76
+ result_hash[:status] = ::ChupakabraTools::ApiStatus.id_by_tag("json_response_error")
77
+ end
78
+ rescue Exception => e
79
+ result_hash[:status] = ::ChupakabraTools::ApiStatus.id_by_tag("http_error")
80
+ end
81
+
82
+ #raise "SSO: #{sso_server_result.to_json}"
83
+
84
+ result_hash[:message] = ::ChupakabraTools::ApiStatus[result_hash[:status]]
85
+ result_hash
86
+ end
87
+
88
+ def user_delete(email, password, options = {})
89
+ result_hash = {
90
+ status: ::ChupakabraTools::ApiStatus.id_by_tag("unknown"),
91
+ message: ""
92
+ }
93
+ # data for post to sso server
94
+ local_data =
95
+ {
96
+ application_id: self.application_id,
97
+ secret_key: self.secret_key,
98
+ email: email,
99
+ password: password
100
+ }
101
+ sso_server_result = nil
102
+
103
+ begin
104
+ # posting request to sso server with supplied data in var 'local_data'
105
+ response = Net::HTTP.post_form(URI.parse("#{self.get_sso_website_url}/api/applications/users/delete"), local_data)
106
+ begin
107
+ # Deserializing Result from JSON Resoponse
108
+ sso_server_result = ActiveSupport::JSON.decode(response.body)
109
+ sso_server_result.symbolize_keys!
110
+ # setting result from server
111
+ result_hash[:status] = sso_server_result[:status]
112
+ result_hash[:user] = sso_server_result[:data]
113
+ rescue
114
+ result_hash[:status] = ::ChupakabraTools::ApiStatus.id_by_tag("json_response_error")
115
+ end
116
+ rescue Exception => e
117
+ result_hash[:status] = ::ChupakabraTools::ApiStatus.id_by_tag("http_error")
118
+ end
119
+
120
+ #raise "SSO: #{sso_server_result.to_json}"
121
+
122
+ result_hash[:message] = ::ChupakabraTools::ApiStatus[result_hash[:status]]
123
+ result_hash
124
+ end
125
+
126
+ def reset_password
127
+
128
+ end
129
+
130
+
131
+ protected
132
+
133
+ def get_sso_website_url
134
+ if Rails.env.development?
135
+ "http://localhost:9000"
136
+ else
137
+ "http://sso.kirgudu.net"
138
+ end
139
+
140
+ end
141
+
142
+ end
@@ -0,0 +1,5 @@
1
+ class KirguduSso::HttpError < StandardError
2
+ def initiaize
3
+ end
4
+
5
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>KirguduSso</title>
5
+ <%= stylesheet_link_tag "kirgudu_sso/application", media: "all" %>
6
+ <%= javascript_include_tag "kirgudu_sso/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,51 @@
1
+ <%= content_for :page_title do %>
2
+ <%= I18n.t("kirgudu_base.authentications.confirm_email.title") %>
3
+ <% end %>
4
+ <%= content_for :title do %>
5
+ <%= I18n.t("kirgudu_base.authentications.confirm_email.title") %>
6
+ <% end %>
7
+
8
+ <%= content_for :page_header do %>
9
+ <link rel="stylesheet" href="/assets/register.css">
10
+ <% end %>
11
+
12
+ <div class="LoginForm">
13
+ <div class="callout-box">
14
+ <div class="reg-header">
15
+ <h3>
16
+ <%= I18n.t("layout.labels.login") %>
17
+ <%= I18n.t("layout.labels.or") %>&nbsp;
18
+ <a id="switchLink" href="<%= ::KirguduBase.authentications_controller.to_url_for(:register, data[:params]) %>">
19
+ <%= I18n.t("layout.labels.register") %>
20
+ </a>
21
+ </h3>
22
+ </div>
23
+ <div class="signin">
24
+ <%= form_tag(::KirguduBase.authentications_controller.to_url_for(:login_process), id: "login_form", name: "login_form", method: "post") do %>
25
+ <label>
26
+ <%= I18n.t("kirgudu_base.authentications.confirm_email.login_form.username") %>
27
+ </label>
28
+ <input id="email" maxlength="128" name="email" class="text" type="text" disabled="disabled">
29
+ <% if data[:user].errors[:email].count > 0 %>
30
+ <div class="form_errors">
31
+ <div class="error-status">
32
+ <% data[:user].errors[:email].each do |message| %>
33
+ <p><%= message %></p>
34
+ <% end %>
35
+ </div>
36
+ </div>
37
+ <% end %>
38
+
39
+ <input id="login" name="login" value="<%= I18n.t("kirgudu_base.authentications.login.login_form.btn_login") %>" class="super-emphasize" type="submit">
40
+ <% end %>
41
+ <br/>
42
+ <a href="<%= ::KirguduBase.authentications_controller.to_url_for(:one_time_pass_login, data[:params]) %>" target="_top" class="password">
43
+ <%= I18n.t("kirgudu_base.authentications.login.labels.token_login") %>
44
+ </a>
45
+ <br/>
46
+ <a href="<%= ::KirguduBase.authentications_controller.to_url_for(:restore_password, data[:params]) %>" target="_top" class="password">
47
+ <%= I18n.t("kirgudu_base.authentications.login.labels.restore_password") %>
48
+ </a>
49
+ </div>
50
+ </div>
51
+ </div>
@@ -0,0 +1,60 @@
1
+ <%= content_for :page_title do %>
2
+ <%= I18n.t("kirgudu_sso.authentications.login.title") %>
3
+ <% end %>
4
+ <%= content_for :title do %>
5
+ <%= I18n.t("kirgudu_sso.authentications.login.title") %>
6
+ <% end %>
7
+
8
+ <%= content_for :page_header do %>
9
+ <link rel="stylesheet" href="/assets/kirgudu_sso/authentications/base/stylesheets/register.css">
10
+ <% end %>
11
+
12
+ <div class="LoginForm">
13
+ <div class="callout-box">
14
+ <div class="reg-header">
15
+ <h3>
16
+ <%= I18n.t("kirgudu_sso.authentications.layout.labels.login") %>
17
+ <%= I18n.t("kirgudu_sso.authentications.layout.labels.or") %>&nbsp;
18
+ <a id="switchLink" href="<%= self.controller.to_url_for(:register, data[:params]) %>">
19
+ <%= I18n.t("kirgudu_sso.authentications.layout.labels.register") %>
20
+ </a>
21
+ </h3>
22
+ </div>
23
+ <div class="signin">
24
+ <%= form_tag(self.controller.to_url_for(:login_process), id: "login_form", name: "login_form", method: "post") do %>
25
+ <label>
26
+ <%= I18n.t("kirgudu_sso.authentications.login.login_form.email") %>
27
+ </label>
28
+ <input id="email" maxlength="128" name="email" class="text" type="text" value="<%= data[:email] %>">
29
+
30
+ <div id="username_errors" class="form_errors"></div>
31
+ <label>
32
+ <%= I18n.t("kirgudu_sso.authentications.login.login_form.password") %>
33
+ </label>
34
+ <input id="password" maxlength="128" name="password" class="text" type="password" value="<%= data[:password] %>">
35
+
36
+ <div class="checkbox-container">
37
+ <input id="rememberMe" name="rememberMe" value="true" class="checkbox" type="checkbox">
38
+ <label class="checkbox-text">
39
+ <%= I18n.t("kirgudu_sso.authentications.login.login_form.remember_me") %>
40
+ </label>
41
+ </div>
42
+ <label>
43
+ <%= I18n.t("kirgudu_sso.authentications.login.login_form.captcha") %>
44
+ </label>
45
+ <%= recaptcha_tags(ssl: true) %>
46
+
47
+
48
+ <input id="login" name="login" value="<%= I18n.t("kirgudu_sso.authentications.login.login_form.btn_login") %>" class="super-emphasize" type="submit">
49
+ <% end %>
50
+ <br/>
51
+ <a href="<%= self.controller.to_url_for(:one_time_pass_login, data[:params]) %>" target="_top" class="password">
52
+ <%= I18n.t("kirgudu_sso.authentications.login.labels.token_login") %>
53
+ </a>
54
+ <br/>
55
+ <a href="<%= self.controller.to_url_for(:restore_password, data[:params]) %>" target="_top" class="password">
56
+ <%= I18n.t("kirgudu_sso.authentications.login.labels.restore_password") %>
57
+ </a>
58
+ </div>
59
+ </div>
60
+ </div>
@@ -0,0 +1,123 @@
1
+ <%= content_for :page_title do %>
2
+ <%= I18n.t("kirgudu_sso.authentications.register.title") %>
3
+ <% end %>
4
+ <%= content_for :title do %>
5
+ <%= I18n.t("kirgudu_sso.authentications.register.title") %>
6
+ <% end %>
7
+
8
+ <%= content_for :page_header do %>
9
+ <link rel="stylesheet" href="/assets/register.css">
10
+ <% end %>
11
+
12
+
13
+
14
+ <div class="RegistrationForm">
15
+ <div class="RegistrationCheck"></div>
16
+ <div class="callout-box">
17
+ <div class="reg-header">
18
+ <h3>
19
+ <%= I18n.t("layout.labels.register") %>
20
+ <!--<span class="switch">-->
21
+ <!--<form id="switchForm" action="https://www.evernote.com/Login.action" method="post">-->
22
+ <%= I18n.t("layout.labels.or") %>&nbsp;
23
+ <a id="switchLink" style="cursor: pointer;" href="<%= self.controller.to_url_for(:login, data[:params]) %>">
24
+ <%= I18n.t("layout.labels.login") %>
25
+ </a>
26
+ <!--</form>-->
27
+ <!--</span>-->
28
+ </h3>
29
+ </div>
30
+ <div class="register">
31
+
32
+ <%= kb_auth_form_for(data[:user], url: self.controller.to_url_for(:register, data[:params]), method: :post) do |f| %>
33
+ <label>
34
+ <%= I18n.t("kirgudu_sso.authentications.register.register_form.email") %> *
35
+ </label>
36
+ <%= f.text_field :email, data[:user].email, class: "text", maxlegth: 128 %>
37
+ <% if data[:user].errors[:email].count > 0 %>
38
+ <div class="email-errors">
39
+ <div class="error-status">
40
+ <% data[:user].errors[:email].each do |message| %>
41
+ <p><%= message %></p>
42
+ <% end %>
43
+ </div>
44
+ </div>
45
+ <% end %>
46
+
47
+
48
+ <label>
49
+ <%= I18n.t("kirgudu_sso.authentications.register.register_form.first_name") %> *
50
+ </label>
51
+ <%= f.text_field :first_name, data[:user].first_name, class: "text", maxlegth: 128 %>
52
+ <% if data[:user].errors[:first_name].count > 0 %>
53
+ <div class="password-errors">
54
+ <div class="error-status">
55
+ <% data[:user].errors[:first_name].each do |message| %>
56
+ <p><%= message %></p>
57
+ <% end %>
58
+ </div>
59
+ </div>
60
+ <% end %>
61
+
62
+ <label>
63
+ <%= I18n.t("kirgudu_sso.authentications.register.register_form.last_name") %>
64
+ </label>
65
+ <%= f.text_field :last_name, data[:user].last_name, class: "text", maxlegth: 128 %>
66
+ <% if data[:user].errors[:last_name].count > 0 %>
67
+ <div class="password-errors">
68
+ <div class="error-status">
69
+ <% data[:user].errors[:last_name].each do |message| %>
70
+ <p><%= message %></p>
71
+ <% end %>
72
+ </div>
73
+ </div>
74
+ <% end %>
75
+
76
+ <div class="PasswordStrength"></div>
77
+ <label>
78
+ <%= I18n.t("kirgudu_sso.authentications.register.register_form.password") %> *
79
+ </label>
80
+
81
+ <%= f.password_field :password, data[:user].password, class: "text", maxlegth: 128 %>
82
+ <% if data[:user].errors[:password].count > 0 %>
83
+ <div class="password-errors">
84
+ <div class="error-status">
85
+ <% data[:user].errors[:password].each do |message| %>
86
+ <p><%= message %></p>
87
+ <% end %>
88
+ </div>
89
+ </div>
90
+ <% end %>
91
+ <label>
92
+ <%= I18n.t("kirgudu_sso.authentications.register.register_form.password_confirmation") %> *
93
+ </label>
94
+ <%= f.password_field :password_confirmation, data[:user].password_confirmation, class: "text", maxlegth: 128 %>
95
+ <% if data[:user].errors[:password_confirmation].count > 0 %>
96
+ <div class="password-errors">
97
+ <div class="error-status">
98
+ <% data[:user].errors[:password_confirmation].each do |message| %>
99
+ <p><%= message %></p>
100
+ <% end %>
101
+ </div>
102
+ </div>
103
+ <% end %>
104
+ <label>
105
+ <%= I18n.t("kirgudu_sso.authentications.register.register_form.captcha") %> *
106
+ </label>
107
+ <%= recaptcha_tags(ssl: true) %>
108
+ <div class="terms">
109
+ <p>Al presionar click en Registrar, Yo acepto
110
+ <a target="_window" href="http://officials.kirgudu.net/tos">
111
+ <%= I18n.t("layout.footer.terms") %>
112
+ </a>
113
+ <%= I18n.t("layout.labels.and") %>
114
+ <a target="_window" href="http://officials.kirgudu.net/privacy">
115
+ <%= I18n.t("layout.footer.privacy_policy") %>
116
+ </a>.
117
+ </p>
118
+ </div>
119
+ <input name="register" value="<%= I18n.t("kirgudu_sso.authentications.register.register_form.btn_create") %>" class="super-emphasize" type="submit">
120
+ <% end %>
121
+ </div>
122
+ </div>
123
+ </div>
@@ -0,0 +1,25 @@
1
+ <%= content_for :title do %>
2
+ <%= I18n.t("kirgudu_base.authentications.confirm_email.title") %>
3
+ <% end %>
4
+
5
+ <%= content_for :header do %>
6
+ <link rel="stylesheet" href="/assets/register.css">
7
+ <% end %>
8
+
9
+
10
+
11
+ <div class="RegistrationForm">
12
+ <div class="RegistrationCheck"></div>
13
+ <div class="callout-box">
14
+ <div class="reg-header">
15
+ <h3>
16
+ <span class="switch">
17
+ You are successfully registered
18
+ <a id="switchLink" style="cursor: pointer;" href="<%= ::KirguduBase.authentications_controller.to_url_for(:login, data[:params]) %>">
19
+ <%= I18n.t("layout.labels.login") %>
20
+ </a>
21
+ </span>
22
+ </h3>
23
+ </div>
24
+ </div>
25
+ </div>
@@ -0,0 +1,53 @@
1
+ <%= content_for :page_title do %>
2
+ <%= I18n.t("kirgudu_base.authentications.restore_password.title") %>
3
+ <% end %>
4
+ <%= content_for :title do %>
5
+ <%= I18n.t("kirgudu_base.authentications.restore_password.title") %>
6
+ <% end %>
7
+
8
+ <%= content_for :page_header do %>
9
+ <link rel="stylesheet" href="/assets/register.css">
10
+ <% end %>
11
+
12
+
13
+ <!--<div class="split">-->
14
+ <!--<div class="instruction">-->
15
+ <!--<p>Por favor proporciona un nombre de usuario o dirección de correo que usaste al registrar tu-->
16
+ <!--cuenta de Evernote.</p>-->
17
+
18
+ <!--<p>Te enviaremos un correo que te permitirá reinicializar tu contraseña.</p></div>-->
19
+ <!--</div>-->
20
+
21
+
22
+
23
+ <div class="ForgotPasswordForm">
24
+ <div class="callout-box">
25
+ <div class="reg-header">
26
+ <h3>
27
+ <a id="switchLink" href="<%= ::KirguduBase.authentications_controller.to_url_for(:login, data[:params]) %>">
28
+ <%= I18n.t("layout.labels.login") %>
29
+ </a>
30
+ <%= I18n.t("layout.labels.or") %>&nbsp;
31
+ <a id="switchLink" href="<%= ::KirguduBase.authentications_controller.to_url_for(:register, data[:params]) %>">
32
+ <%= I18n.t("layout.labels.register") %>
33
+ </a>
34
+ </h3>
35
+ </div>
36
+ <div class="register">
37
+ <%= form_tag(::KirguduBase.authentications_controller.to_url_for(:restore_password_send), method: :post, name: "resetPasswordForm") do %>
38
+ <label>
39
+ <%= I18n.t("kirgudu_base.authentications.restore_password.restore_password_form.email") %>
40
+ </label>
41
+ <input id="email" name="email" value="<%= data[:email] %>" type="text">
42
+ <br>
43
+ <label>
44
+ <%= I18n.t("kirgudu_base.authentications.restore_password.restore_password_form.captcha") %>
45
+ </label>
46
+ <%= recaptcha_tags(ssl: true) %>
47
+ <input name="sendEmail" value="<%= I18n.t("kirgudu_base.authentications.restore_password.restore_password_form.btn_send") %>" class="emphasize" type="submit">
48
+ <% end %>
49
+ </div>
50
+ </div>
51
+ </div>
52
+
53
+