Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Route::post('cadastro', 'CadastroController@index');
- $user = new AppUser();
- $user->Name = Input::get('Name');
- $user->User = Input::get('User');
- $user->Password = hash('sha256', Input::get('Password'));
- $user->save();
- //echo hash('sha256', Input::get('Password'));
- $user = AppUser::where('User', Input::get("User"));
- if(!$user){
- return redirect('/naocadastrado');
- }else{
- if($user->Password == hash('sha256', Input::get("Password"))){
- return View ('/cadastrado');
- }else{
- return View ('/senhaincorreta');
- }
- }
- }
- /**
- * Show the form for creating a new resource.
- *
- * @return IlluminateHttpResponse
- */
- public function create()
- {
- return View ('/login');
- }
- public function senhaincorreta () {
- return View ('/senhaincorreta');
- }
- public function cadastrado() {
- return View ('/cadastrado');
- }
- public function naocadastrado(){
- return View ('/naocadastrado');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement