3 * see AUTHORS for the list of contributors
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package org.sonews.acl;
21 * Represents users (clients) accessing our service through NNTP protocol.
23 * This class can be extended by your plugin
24 * to describe additional information, that was gained during login process.
26 * When User object is created, default authentication status is false.
28 * @author František Kučera (frantovo.cz)
32 private String userName;
33 private boolean authenticated = false;
35 public String getUserName() {
39 public void setUserName(String userName) {
40 this.userName = userName;
44 * In some configurations users don't have to use their password –
45 * they can just tell us their name and we will trust them –
46 * in this case User object will exist end user name will be filled, but this method will return false.
48 * @return true if user was succesfully authenticated (has provided correct password).
50 public boolean isAuthenticated() {
55 * This method is to be called from AUTHINFO PASS Command implementation.
57 * @param authenticated true if user has provided right password in AUTHINFO PASS password.
58 * @see #isAuthenticated()
60 public void setAuthenticated(boolean authenticated) {
61 this.authenticated = authenticated;
67 public User(String userName) {
68 this.userName = userName;
71 public User(String userName, boolean authenticated) {
72 this.userName = userName;
73 this.authenticated = authenticated;