daily pastebin goal
21%
SHARE
TWEET

Untitled

a guest Mar 20th, 2017 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Route::post('cadastro', 'CadastroController@index');
  2.    
  3. $user = new AppUser();
  4.     $user->Name = Input::get('Name');
  5.     $user->User = Input::get('User');
  6.     $user->Password = hash('sha256', Input::get('Password'));
  7.     $user->save();
  8.  
  9.     //echo hash('sha256', Input::get('Password'));
  10.  
  11.  
  12.  
  13.     $user = AppUser::where('User', Input::get("User"));
  14.  
  15.                           if(!$user){
  16.  
  17.                                return redirect('/naocadastrado');
  18.  
  19.                           }else{
  20.  
  21.                                if($user->Password == hash('sha256', Input::get("Password"))){
  22.  
  23.                                   return View ('/cadastrado');
  24.  
  25.                                }else{
  26.  
  27.                                   return View ('/senhaincorreta');      
  28.  
  29.                                }
  30.  
  31.                           }
  32.  
  33.  
  34.  
  35. }
  36.  
  37.  
  38. /**
  39.  * Show the form for creating a new resource.
  40.  *
  41.  * @return IlluminateHttpResponse
  42.  */
  43.  
  44. public function create()
  45. {
  46.     return View ('/login');
  47. }
  48.  
  49. public function senhaincorreta () {
  50.     return View ('/senhaincorreta');
  51. }
  52.  
  53. public function cadastrado() {
  54.     return View ('/cadastrado');
  55. }
  56.  
  57. public function naocadastrado(){
  58.     return View ('/naocadastrado');
  59. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top