diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 773a5842..da66b1fb 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -41,6 +41,7 @@ $routes->get('dashboard/', 'Home::index'); # Users Routes $routes->get("user_list/", "Users::index"); +// $routes->get('user-list/', 'Users::index', ['as' => 'user_list']); $routes->get("user_page/(:any)", "Users::user_page/$1"); $routes->post("user_synchronization", "Users::user_synchronization"); diff --git a/app/Controllers/Authentication.php b/app/Controllers/Authentication.php index 49e40497..285bffa8 100755 --- a/app/Controllers/Authentication.php +++ b/app/Controllers/Authentication.php @@ -32,15 +32,16 @@ class Authentication extends BaseController $password = $this->request->getPost('password'); $user = $auth_model->where('email', $username)->first(); - if (is_null($user)) { return redirect()->back()->with('error', 'Invalid username or password.'); + // return redirect()->back()->withInput()->with('error', 'Invalid username or password.'); } $pwd_verify = password_verify((string)$password, $user['password']); if (!$pwd_verify) { - return redirect()->back()->with('error', 'Invalid username or password.'); + // return redirect()->back()->with('error', 'Invalid username or password.'); + return redirect()->back()->withInput()->with('error', 'Invalid username or password.'); } // You can implement your authentication logic here @@ -60,11 +61,15 @@ class Authentication extends BaseController return redirect()->to('dashboard'); } else { // Invalid credentials, display error message - return redirect()->back()->with('error', 'Invalid username or password.'); + // return redirect()->back()->with('error', 'Invalid username or password.'); + return redirect()->back()->withInput()->with('error', 'Invalid username or password.'); + } } else { // Validation failed, display errors - return redirect()->back()->withInput()->with('validation', $validation); + // return redirect()->back()->withInput()->with('validation', $validation); + return redirect()->back()->withInput()->with('error', 'Invalid username or password.'); + } } diff --git a/app/Controllers/Users.php b/app/Controllers/Users.php index 76976057..1c3586f0 100755 --- a/app/Controllers/Users.php +++ b/app/Controllers/Users.php @@ -58,6 +58,7 @@ class Users extends BaseController $requestData['isactive'] = isset($requestData['isactive']) && $requestData['isactive'] == 'on' ? 1 : 0; unset($requestData['password']); $model->saveData($requestData, $requestData['user_id']); + $alert_message = "User successfully updated."; } else { #add $hash_password = password_hash($requestData['password'], PASSWORD_DEFAULT); @@ -65,7 +66,8 @@ class Users extends BaseController $requestData['created_by'] = $session->get('user_id'); $requestData['isactive'] = 1; $model->saveData($requestData, null); + $alert_message = "User successfully created."; } - return redirect()->route('user_list'); + return redirect()->route('user_list')->with('success', $alert_message); } } diff --git a/app/Views/business_list.php b/app/Views/business_list.php index 575809c5..3d1ac7c6 100644 --- a/app/Views/business_list.php +++ b/app/Views/business_list.php @@ -6,7 +6,7 @@
-