Exemple #1
0
 public function update()
 {
     $id = $this->db->escape_str($this->uri->segment(3));
     if ($id) {
         if ($this->_submit_validateModUsuario() === FALSE) {
             $this->mod();
             return;
         } else {
             $record = array('name' => $this->input->post('name'), 'lastname' => $this->input->post('lastname'), 'username' => $this->input->post('username'));
             if ($this->input->post('password') != '') {
                 $record["password"] = User_model::transform_password($this->input->post('password'));
             }
             $this->db->where("id", $id);
             $this->db->update("admusers", $record);
             $this->updatePermisos($id);
             redirect("usuario/index/" . $this->uri->segment(4));
         }
     } else {
         redirect("usuario/index/" . $this->uri->segment(4));
     }
 }