diff --git a/app/controllers/RemindersController.php b/app/controllers/RemindersController.php index 0a64f8d..4c502f3 100644 --- a/app/controllers/RemindersController.php +++ b/app/controllers/RemindersController.php @@ -37,7 +37,7 @@ class RemindersController extends Controller { { case Password::INVALID_USER: \Session::flash('message', 'The email you entered does not exist. Try a different email.'); - return Redirect::back()->with('error', Lang::get($response)); + return Redirect::back()->withInput(\Input::except('password')); case Password::REMINDER_SENT: \Session::flash('message', 'Please check your email for instructions on how to reset your password'); diff --git a/app/controllers/UserController.php b/app/controllers/UserController.php index fbd8a0a..c7b4936 100644 --- a/app/controllers/UserController.php +++ b/app/controllers/UserController.php @@ -163,7 +163,7 @@ class UserController extends \BaseController $user->photo = 'images/users/'.$filename; } - $user_role = UserXrefRole::where('user_id', '=', $user_id)->get(); + $user_role = UserXrefRole::find($user_id); if(count($user_role)) { @@ -197,4 +197,28 @@ class UserController extends \BaseController return View::make('users.profile')->with('user', $user); } -} \ No newline at end of file + public function mentors() + { + + $mentors = \DB::select(\DB::raw('SELECT * FROM + users, roles, user_xref_role + WHERE users.id = user_xref_role.user_id + AND roles.id = user_xref_role.role_id + AND roles.id = 1')); + + return View::make('users.mentors')->with('mentors', $mentors); + } + + public function mentees() + { + $mentees = \DB::select(\DB::raw('SELECT * FROM + users, roles, user_xref_role + WHERE users.id = user_xref_role.user_id + AND roles.id = user_xref_role.role_id + AND roles.id = 2')); + + return View::make('users.mentees')->with('mentees', $mentees); + } + +} + diff --git a/app/routes.php b/app/routes.php index c8491a4..576e54f 100755 --- a/app/routes.php +++ b/app/routes.php @@ -29,6 +29,8 @@ Route::get('users/group/{user_id}/{group_id}', array('as' => 'complete', 'uses' Route::post('users/group/complete', array('uses' => 'UserController@saveProfile')); Route::get('users/{id}', array('as' => 'users', 'uses' => 'UserController@showProfile')); Route::get('users', array('as' => 'users', 'uses' => 'UserController@index')); +Route::get('mentors', array('as' => 'mentors', 'uses' => 'UserController@mentors')); +Route::get('mentees', array('as' => 'mentees', 'uses' => 'UserController@mentees')); /** * User Password Reminder Controller routes diff --git a/app/views/login.blade.php b/app/views/login.blade.php index 99ebd6c..49b1c1d 100644 --- a/app/views/login.blade.php +++ b/app/views/login.blade.php @@ -45,7 +45,7 @@ @if(Session::has('message'))

{{ Session::get('message') }}

@endif - +
{{ Form::label('email', 'Email', array('class' => 'control-label')) }}
@@ -81,7 +81,7 @@
-
+