[webpack.logout] now logout works

This commit is contained in:
xdrm-brackets 2018-03-06 19:39:34 +01:00
parent 9c00c83240
commit 39cc5ef906
5 changed files with 76 additions and 2 deletions

View File

@ -63,6 +63,10 @@
if( $_SESSION['CAS']['admin'] === true )
$_SESSION['AUTH'][] = 'cas_admin';
/* (2) Remove cas in AUTH */
}else{
$_SESSION['AUTH'] = \array_diff($_SESSION['AUTH'], ['cas_user']);
$_SESSION['AUTH'] = \array_diff($_SESSION['AUTH'], ['cas_admin']);
}
/* (2) Other permissions */

View File

@ -129,7 +129,7 @@ class casController{
new \api\core\AuthSystemDefault();
/* (3) Return if logged out */
return ['logged_out' => in_array('cas_user', $_SESSION['AUTH'])];
return ['logged_out' => !in_array('cas_user', $_SESSION['AUTH'])];
}

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="48"
viewBox="0 0 48 48"
width="48"
version="1.1"
id="svg6"
sodipodi:docname="remove.svg"
inkscape:version="0.92.2 5c3e80d, 2017-08-06">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1280"
inkscape:window-height="684"
id="namedview8"
showgrid="false"
inkscape:zoom="4.9166667"
inkscape:cx="24"
inkscape:cy="24"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg6" />
<path
d="m 12,38 c 0,2.21 1.79,4 4,4 h 16 c 2.21,0 4,-1.79 4,-4 V 14 H 12 Z M 38,8 H 31 L 29,6 H 19 l -2,2 h -7 v 4 h 28 z"
id="fill-edit"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -64,3 +64,8 @@ if( gstore.get.URI.length > 0 && gstore.get.menu_item.hasOwnProperty(gstore.get.
gstore.add('menu_item_active', gstore.get.menu_item[gstore.get.URI[0]].url);
else
gstore.add('menu_item_active', 'home');
gstore.add('navigate', function(uri){
console.log(uri);
});

View File

@ -22,7 +22,17 @@ export default {
data(){ return { gstore: gstore.get }; },
methods: {
navigate(uri){
document.location = '/'+uri+'/';
// if no logout -> redirect
if( uri !== 'logout' ){
document.location = '/'+uri+'/';
return;
}
// logout call
api.call('DELETE cas', {}, function(rs){ document.location = '/'; });
}
}
}