[eluser]dinisptc[/eluser]
Message: Creating default object from empty value ---- Severity: Warning --- ion_auth _controller users
i have codeigniter 2.1.3 and ion_auth
the problem when passes on the user controller i have this warning
Code:
//set the flash data error message if there is one
$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
//redirect them to the home page because they must be an administrator to view this
$DContent['page_details'] = array('page_title' => 'Index of onlplans');
$Dheader = array();
$Dsidebar = array();
$Dfooter = array();
$Dmeta = array('meta_title'=>'Welcome to onplans','meta_descricao'=>'Login to onplans');
//preenche as variaveis
$this->template->write_view('meta', 'html/meta', $Dmeta, true);
$this->template->write_view('header', 'html/header', $Dheader, true);
$this->template->write_view('content', 'onplans/architect',$this->data,true);
$this->template->write_view('sidebar', 'html/sidebar_user');
$this->template->write_view('footer', 'html/footer');
$this->template->render();
}
else
{
// get the user object
[size=4] $data->the_user = $this->ion_auth->user()->row();[/size][color=red][/color]
$this->the_user = $data->the_user;
// load $the_user in all displayed views automatically
$this->load->vars($data);
//set the flash data error message if there is one
$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
//list the users
$DContent['page_details'] = array('page_title' => 'Index of onplans');
$Dheader = array();
$Dsidebar = array();
$Dfooter = array();
$Dmeta = array('meta_title'=>'Onplans Admin View','meta_descricao'=>'Login to onplans admin');
//preenche as variaveis
$this->template->write_view('meta', 'html/meta', $Dmeta, true);
$this->template->write_view('header', 'html/header', $Dheader, true);
$this->template->write_view('content', 'onplans/admin',$this->data,true);
$this->template->write_view('sidebar', 'html/sidebar_admin');
$this->template->write_view('footer', 'html/footer');
$this->template->render();
}
/**/
}
the warning its on this line
$data->the_user = $this->ion_auth->user()->row();
this is the admin view
Code:
<h1>Protected View aDMIN!!</h1>
<h4>Email: <?= $the_user->email ?></h4>
<a href="<?= site_url('user/create_user') ?>">Create User</a>
<a href="<?= site_url('user/logout') ?>">logout</a>
i am missing something i cannot find what it is