public function oldpassword_check($oldpassword) { $Model_user = new Model_user(); $userkey = $this->superKey(); $myid = $this->session->userdata('uid'); $old_password_hash = sha1($userkey . $oldpassword); $old_password_db_hash = $Model_user->getuserpass($myid); $error = '<div class="kode-alert kode-alert kode-alert-icon kode-alert-click alert6"><i class="fa fa-lock"></i>Old password not match!<a href="#" class="closed">×</a></div>'; if ($old_password_hash != $old_password_db_hash->password) { $this->form_validation->set_message('oldpassword_check', '' . $error . ''); return FALSE; } return TRUE; }