commit | author | age
|
f13c4c
|
1 |
/*
|
JM |
2 |
* Copyright 2011 gitblit.com.
|
|
3 |
*
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
6 |
* You may obtain a copy of the License at
|
|
7 |
*
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9 |
*
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13 |
* See the License for the specific language governing permissions and
|
|
14 |
* limitations under the License.
|
|
15 |
*/
|
1f9dae
|
16 |
package com.gitblit.wicket.pages;
|
87cc1e
|
17 |
|
JM |
18 |
import org.apache.wicket.markup.html.WebPage;
|
85c2e6
|
19 |
import org.apache.wicket.protocol.http.WebResponse;
|
JM |
20 |
|
|
21 |
import com.gitblit.GitBlit;
|
ea094a
|
22 |
import com.gitblit.models.UserModel;
|
85c2e6
|
23 |
import com.gitblit.wicket.GitBlitWebSession;
|
87cc1e
|
24 |
|
JM |
25 |
public class LogoutPage extends WebPage {
|
|
26 |
|
|
27 |
public LogoutPage() {
|
ea094a
|
28 |
GitBlitWebSession session = GitBlitWebSession.get();
|
JM |
29 |
UserModel user = session.getUser();
|
88598b
|
30 |
GitBlit.self().setCookie((WebResponse) getResponse(), null);
|
ea094a
|
31 |
GitBlit.self().logout(user);
|
JM |
32 |
session.invalidate();
|
87cc1e
|
33 |
setRedirect(true);
|
JM |
34 |
setResponsePage(getApplication().getHomePage());
|
|
35 |
}
|
|
36 |
} |