Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <h2>The Maintenance Functions are restricted to authorized users only. Please login below.</h2>
  2. <%= form_tag(dirlogin_pageout_path, :controller => "dirlogin", :action => "pageout", :method => "post") %>
  3. <p>
  4. <label for="name">User ID:</label><br>
  5. <%= text_field_tag :userid, params[:userid] %>
  6. </p>
  7.  
  8. <p>
  9. <label for="password">Password:</label><br>
  10. <%= password_field_tag :password, params[:password] %>
  11. </p>
  12.  
  13. <%= submit_tag "login" %>
  14.  
  15. class DirloginController < ApplicationController
  16. def pagein
  17. end
  18.  
  19. def pageout
  20. user = User.find_by_userid(params[:userid])
  21. if user and user.authenticate(params[:password])
  22. redirect_to maintenance_maintenancenav_path
  23. else
  24. render 'pagein'
  25. flash.alert = "Invalid name/password combination"
  26. end
  27. end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement