mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
Added a logout button
Logout button will now appear in the header if authentication is enabled and the user is logged in.
This commit is contained in:
parent
dc8b8eaa46
commit
aab3832e02
@ -78,7 +78,7 @@ class Auth extends CI_Controller {
|
||||
} else {
|
||||
$data['logged_in'] = FALSE;
|
||||
}
|
||||
$this->load->view('auth/logout_view', $data);
|
||||
redirect('/');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,8 +124,8 @@ class Auth_Ldap {
|
||||
*/
|
||||
function logout() {
|
||||
// Just set logged_in to FALSE and then destroy everything for good measure
|
||||
$this->ci->session->set_userdata(array('logged_in' => FALSE));
|
||||
$this->ci->session->sess_destroy();
|
||||
$this->ci->db_session->set_userdata(array('logged_in' => FALSE));
|
||||
$this->ci->db_session->sess_destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,15 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Logout</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php if($logged_in): ?>
|
||||
<p><?= $username ?> has been logged out.</p>
|
||||
<p>Thanks for visiting <?= $name ?></p>
|
||||
<?php else: ?>
|
||||
<p>You need to <?php echo anchor('/auth/login', 'login', ''); ?> before you log out...</p>
|
||||
<?php endif;?>
|
||||
</body>
|
||||
</html>
|
@ -53,6 +53,13 @@ $this->carabiner->display('css');
|
||||
<?php } ?>
|
||||
<li><a <?php if($l == "api"){ echo 'class="active"'; }?> href="<?php echo site_url('api'); ?>" title="API">API</a></li>
|
||||
<li><a <?php if($l == "about"){ echo 'class="active"'; }?> href="<?php echo site_url('about'); ?>" title="About">About</a></li>
|
||||
<?php
|
||||
if ($this->config->item('require_auth') ){
|
||||
if ($this->auth_ldap->is_authenticated()){
|
||||
echo "<li><a href=" . site_url('auth/logout') . ' title="Logout">Logout</a></li>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user