I'm trying to implement AD authentication in my php application however I'm having troubles pulling information from session userdata and I'm not sure why.
The authenication works as I'm able to login with AD credentials and display WIN, but I cannot display session data.
I'm trying to use this lightweight library: Auth_AD Codeigniter Library
Auth Controller:
public function login()
{
// read the form fields, lowercase the username for neatness
$username = strtolower($this->input->post('username'));
$password = $this->input->post('password');
// check the login
if($this->auth_ad->login($username, $password))
{
$data['udcn'] = $this->session->userdata('cn');
$this->load->view('user/win', '$data');
}
else
{
$this->load->view('user/lose');
// user could not be authenticated, whoops.
}
}
VIEW:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>WIN</title>
</head>
<body>
<?php echo $udcn['cn']; ?>
</body>
</html>
Any help would be greatly appreciated!
$data. Should be$this->load->view('user/win', $data);- ourmandave