[ 'databases', 'List others databases' ],
[ 'cryptkey', 'Generate a random encryption key' ],
[ 'ssha_password', 'Encrypt a password' ],
+ [ 'logout', 'Clear Basic Auth' ],
[ 'status', 'Status infos page' ],
],['command','description'],function(&$r) {
$r['command'] = $this->page->tag('a',$r['command'],'href="'
$r['id'] = $this->page->tag('a',$r['id'],'href="'.$this->db->base.'/'.$r['id'].'.'.$this->ext.'"');
});
+ } elseif ($action == 'logout') {
+ unset($_SERVER['PHP_AUTH_USER']);
+ unset($_SERVER['PHP_AUTH_PW']);
+ unset($_SERVER['REMOTE_USER']);
+ unset($_SERVER['REMOTE_PASSWORD']);
+ #header('HTTP/1.1 401 Access Denied');
+ if (empty($_REQUEST['realm'])) header('WWW-Authenticate: Basic');
+ else header('WWW-Authenticate: Basic realm="'.$_REQUEST['realm'].'"');
+ #echo '<html><head><title>401 Unauthorized</title><meta http-equiv="refresh" content="1"></head><body><h1>401 Unauthorized</h1><p>You are not allowed to see this page. Reload the page to try again.</p></body></html>';
+ header('HTTP/1.0 401 Unauthorized');
+ #header('Location: '.str_replace('//','//@',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/')));
+ header('Content-type: text/html');
+ echo '<meta http-equiv="refresh" content="0; url='.(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/').'">';
+ #if (!empty($_SERVER['PHP_AUTH_USER'])) header('Location: '.str_replace('//','//@',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/')));
+ exit;
+
} elseif ($action == 'ssha_password') {
$this->page($this,'ssha_password');