From 4676b756e8ed258b0757c62e8d46ff275ed79411 Mon Sep 17 00:00:00 2001 From: jasder Date: Wed, 27 Oct 2021 17:01:16 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E5=AE=8C=E5=96=84=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=8F=91=E9=80=81=E9=82=AE=E4=BB=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/images/logo.png | Bin 2816 -> 10051 bytes app/controllers/application_controller.rb | 85 ++---------------- app/mailers/user_mailer.rb | 11 +-- app/views/user_mailer/register_email.html.erb | 12 +-- 4 files changed, 14 insertions(+), 94 deletions(-) diff --git a/app/assets/images/logo.png b/app/assets/images/logo.png index 436d23490404beedcf7cd776bbf8ed0282794ca4..72505d8a2cf0c50ec0ee18d34a00ba082cbbc2b7 100644 GIT binary patch literal 10051 zcmaKSWmp`|)@_12!9BP$z~G+X?t?>sfx+D^5HxsjCj@tgf#B}$F2RCBa0uj1&UfDP z-5>Yd`7vExwPn?=-ThSWS`lh0vY2S3Xs=$q!jzYj(s=diwE?W{fPw`3kHD^xgJ>b-HAvS@S6NBO%+a3R^sfxN zm%S5A`_(IvcV14WX0{MFDlo*-+Ch}&ytR{t%Gz9%Mu%6KQ`t!pVr4Do;{wt2Q309x z*qRBN)4UU-67dp(8L)@AnNoS#+c~%jd5O~e%dQZt{kNNghU#A;ZnmN{{{u=_S&d54 z(FH=q%gzTd1M+ZD@e8s8`8Wl+c-W}8IDz~eoctU>ZU84xh?7r#}m1qB5;IJr2uxBxH-fUCEIo2eJT!IkzO z3sMkQGZ$+oH)}@+s=pRZ!H({3qBJn1|1$-9r~jCBaQ%0fU;*RsGIinrvUC2O(m#UA z%Kv{+d;9-LySiyW{ul56)37VZ+X=#<0daM7cQJ!4oCWP)S588bE)Y{UM;DNzquoDI zRI_q)b9A+GbfS`!q+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M|e#CC%Y**bN4QUtiYgF`c zY;3Gn8?0WhpK|Wpxn`1dI-OtD)z!UTR8(~T^y$;5MMXsg>-G96rKP1Cl)9dM_SubU zvPOc!c<01Kc&Aqcy-s1gFX;Kw;7;y1XR?N#Va5~n>jkZcm`tV{NM3YLsNHV=PfSeA%=GkhlTv`eV2~0M6KBQ5#Qac8 zNkT%xtoZo&DDV30?CfNd$u!g9aCEr!I2?{I!^6W>KgWzR5MQ=U7v)bnqun;&B&oXc zwTvfdzo8tToJ!A@=EhcyHsdj#_l3#xCxXRd8A3Fh&A&=XNr{Y#in`WcMc#;uiwlp5 zi3zKzso9~_QCwV{J9=x?flMWN%LplvWSHR9Qx5d1r4i3?%8~q0KaElT65-Z8YXrV& zLa*k_KSJ9mg^tJ}M5EEDYi@2N@ms}_BS$XV2jA}{qNAh3 zy1ToTf$F}3f`WUMJbJx8AT2Fzj+Tt{^z<0-y3*3p2bG4i*=)yygM-KIKTg66%a$!O z_4oIGqcGq=ZEfwY+}zxZyu7>>jg5_Ona$>3YqhVbso8P#=+VmT?CiS>3JO+Pt=5A| z!*z9a+2Z2jhMkF%m>?u4C(mhXYx{^A7|nQE?V6gJj?A4q*RMaZCZP@0TULF2{b#YU zu{ZDCyZ32~J!pIhE|=@#wr$%UNk~YztEHvo+<4_p!bdD$zI?IGX8ZRTSKfD4tM!eE z{1;{tV?ahmMnY9p)t`HMdhA=aY#H|D*^NDW_H6C$?mlI)SV~e-QYMXd8S#I!wQuj_ SnFiSa0000 Course::STUDENT && @course.is_public == 0 - tip_exception(401, "..") unless User.current.logged? - check_account - tip_exception(@course.excellent ? 410 : 409, "您没有权限进入") - end - if @user_course_identity > Course::CREATOR && @user_course_identity <= Course::STUDENT && @course.tea_id != current_user.id - # 实名认证和职业认证的身份判断 - tip_exception(411, "你的实名认证和职业认证审核未通过") if @course.authentication && - @course.professional_certification && (!current_user.authentication && !current_user.professional_certification) - tip_exception(411, "你的实名认证审核未通过") if @course.authentication && !current_user.authentication - tip_exception(411, "你的职业认证审核未通过") if @course.professional_certification && !current_user.professional_certification - end - uid_logger("###############user_course_identity:#{@user_course_identity}") - end - - # 题库的访问权限 - def bank_visit_auth - tip_exception(-2,"未通过职业认证") if current_user.is_teacher? && !current_user.certification_teacher? && !current_user.admin_or_business? && @bank.user_id != current_user.id && @bank.is_public - tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin_or_business? || - (current_user.certification_teacher? && @bank.is_public) - end - - # 判断用户的邮箱或者手机是否可用 # params[:type] 1: 注册;2:忘记密码;3:绑定 def check_mail_and_phone_valid login, type @@ -120,16 +82,16 @@ class ApplicationController < ActionController::Base login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])$/ tip_exception(-2, "请输入正确的手机号或邮箱") end - # 考虑到安全参数问题,多一次查询,去掉Union - user = User.where(phone: login).first || User.where(mail: login).first - if type.to_i == 1 && !user.nil? + + user_exist = Owner.exists?(phone: login) || Owner.exists?(mail: login) + if user_exist && type.to_i == 1 tip_exception(-2, "该手机号码或邮箱已被注册") - elsif type.to_i == 2 && user.nil? + elsif type.to_i == 2 && !user_exist tip_exception(-2, "该手机号码或邮箱未注册") - elsif type.to_i == 3 && user.present? + elsif type.to_i == 3 && user_exist tip_exception(-2, "该手机号码或邮箱已绑定") end - sucess_status + render_ok end # 发送及记录激活码 @@ -186,26 +148,6 @@ class ApplicationController < ActionController::Base end end - def find_course - return normal_status(2, '缺少course_id参数!') if params[:course_id].blank? - @course = Course.find(params[:course_id]) - tip_exception(404, "") if @course.is_delete == 1 && !current_user.admin_or_business? - rescue Exception => e - tip_exception(e.message) - end - - def course_manager - return normal_status(403, '只有课堂管理员才有权限') if @user_course_identity > Course::CREATOR - end - - def find_board - return normal_status(2, "缺少board_id参数") if params[:board_id].blank? - @board = Board.find(params[:board_id]) - rescue Exception => e - uid_logger_error(e.message) - tip_exception(e.message) - end - def validate_type(object_type) normal_status(2, "参数") if params.has_key?(:sort_type) && !SORT_TYPE.include?(params[:sort_type].strip) end @@ -215,21 +157,6 @@ class ApplicationController < ActionController::Base @page_size = params[:page_size] || 15 end - # 课堂教师权限 - def teacher_allowed - logger.info("#####identity: #{current_user.course_identity(@course)}") - unless current_user.course_identity(@course) < Course::STUDENT - normal_status(403, "") - end - end - - # 课堂教师、课堂管理员、超级管理员的权限(不包含助教) - def teacher_or_admin_allowed - unless current_user.course_identity(@course) < Course::ASSISTANT_PROFESSOR - normal_status(403, "") - end - end - def require_admin normal_status(403, "") unless User.current.admin? end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 6e957b4df..d03f14e6f 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -1,17 +1,10 @@ class UserMailer < ApplicationMailer # 注意:这个地方一定要和你的邮箱服务域名一致 - default from: 'educoder@trustie.org' + default from: 'notification@gitlink.org.cn' # 用户注册验证码 def register_email(mail, code) @code = code - mail(to: mail, subject: '验证你的电子邮件') - end - - # 课堂讨论区的邮件通知 - def course_message_email(mail, message_id) - @message = Message.find_by(id: message_id) - @course = @message&.board&.course - mail(to: mail, subject: '课堂发布了新的帖子') if @message.present? && @course.present? + mail(to: mail, subject: 'GitLink | 注册确实开源邮箱验证') end end diff --git a/app/views/user_mailer/register_email.html.erb b/app/views/user_mailer/register_email.html.erb index 6f88177c5..431db06f3 100644 --- a/app/views/user_mailer/register_email.html.erb +++ b/app/views/user_mailer/register_email.html.erb @@ -1,7 +1,7 @@ - 验证码发送 + GitLink-验证码发送