From 9d4e1e0945a7b7257d6bbc2d713c434a2708d955 Mon Sep 17 00:00:00 2001 From: Bomrah Harry Date: Wed, 11 Oct 2023 00:17:13 +0800 Subject: [PATCH] added password reset pattern --- app/controllers/seminars_controller.rb | 5 +++++ app/views/seminars/reset_password_page.html.erb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/seminars_controller.rb b/app/controllers/seminars_controller.rb index ed92d6d..2bf9443 100644 --- a/app/controllers/seminars_controller.rb +++ b/app/controllers/seminars_controller.rb @@ -835,6 +835,10 @@ class SeminarsController < ApplicationController params = OrbitHelper.params seminar = SeminarMain.find_by(uid: params[:uid]) seminar_signup = seminar.seminar_signups.where(:status=>'C', :id=> params[:cid], :token => params[:token]).first + password_pattern = "" + if(seminar.seminar_signup_field_sets.count != 0) + password_pattern = seminar.seminar_signup_field_sets.where(:field_name => "password").first.validator rescue "" + end status = false if(!seminar_signup.nil?) status = true @@ -842,6 +846,7 @@ class SeminarsController < ApplicationController { "status" => status, "seminar" => seminar, + "pattern" => password_pattern, "cid" => params[:cid], "token" => params[:token] } diff --git a/app/views/seminars/reset_password_page.html.erb b/app/views/seminars/reset_password_page.html.erb index 0f9bd7b..8129d70 100644 --- a/app/views/seminars/reset_password_page.html.erb +++ b/app/views/seminars/reset_password_page.html.erb @@ -29,7 +29,7 @@ - <%= password_field_tag :password, nil, :placeholder => t(:dots), :id=>"user_password", :required=> true %> + <%= password_field_tag :password, nil, :placeholder => t(:dots), :id=>"user_password", :required=> true, :pattern => data["pattern"], :title => t("seminar_signup.password_check") %>