added logout method

This commit is contained in:
Sebastian Sdorra
2010-10-15 23:03:00 +02:00
parent 89debd70c7
commit 198a2c372a
6 changed files with 71 additions and 3 deletions

View File

@@ -76,6 +76,22 @@ Ext.onReady(function(){
addTabPanel('t_config', 'configPanel', 'Repository Config');
}
function logout(){
Ext.Ajax.request({
url: restUrl + 'authentication/logout.json',
method: 'GET',
success: function(response){
tabPanel.removeAll();
Ext.getCmp('west').removeAll();
var loginWin = new Sonia.login.Window();
loginWin.show();
},
failure: function(){
alert("logout failed");
}
});
}
function createMainMenu(){
var panel = Ext.getCmp('west');
panel.addSections([{
@@ -96,6 +112,12 @@ Ext.onReady(function(){
label: 'Server',
fn: function(){ console.debug( 'Server Config' ); }
}]
},{
title: 'Abmelden',
items: [{
label: 'Abmelden',
fn: logout
}]
}]);
}