From 7873bfbe586d73a0385b8b3c2c796d56a89e7031 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 14 Jul 2013 16:49:47 +0200 Subject: Add sucess alert when saving profile Signed-off-by: Florian Pritz --- application/controllers/user.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'application/controllers') diff --git a/application/controllers/user.php b/application/controllers/user.php index 42f9e35ae..f52e9c0b1 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -321,6 +321,10 @@ class User extends CI_Controller { { $this->muser->require_access(); + if ($this->input->post("process") !== false) { + $this->_save_profile(); + } + $this->data["profile_data"] = $this->muser->get_profile_data(); $this->load->view('header', $this->data); @@ -328,7 +332,7 @@ class User extends CI_Controller { $this->load->view('footer', $this->data); } - function save_profile() + private function _save_profile() { $this->muser->require_access(); @@ -373,7 +377,12 @@ class User extends CI_Controller { $this->muser->update_profile($data); } - redirect("user/profile"); + $this->data["alerts"][] = array( + "type" => "success", + "message" => "Changes saved", + ); + + return true; } function logout() -- cgit v1.2.3-24-g4f1b