Commit 77277999 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[JM-160] Created LockOut infrastructure to allow for disabling accounts,...

[JM-160] Created LockOut infrastructure to allow for disabling accounts, associated listeners, and providers in case you want to write your own locked out accounts interface.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9903 b35dd754-fafc-0310-a699-88a17e54d16e
parent 913e32bc
......@@ -22,6 +22,17 @@ CREATE TABLE jiveUserProp (
);
CREATE TABLE jiveUserFlag (
username VARCHAR(64) NOT NULL,
name VARCHAR(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime ASC);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime ASC);
CREATE TABLE jivePrivate (
username VARCHAR(64) NOT NULL,
name VARCHAR(100) NOT NULL,
......@@ -343,7 +354,7 @@ INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 14);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 15);
-- Entry for admin user
INSERT INTO jiveUser (username, plainPassword, name, email, creationDate, modificationDate)
......
......@@ -22,6 +22,17 @@ CREATE TABLE jiveUserProp (
);
CREATE TABLE jiveUserFlag (
username VARCHAR(64) NOT NULL,
name VARCHAR(100) NOT NULL,
startTime VARCHAR(15),
endTime VARCHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime);
CREATE TABLE jivePrivate (
username VARCHAR(64) NOT NULL,
name VARCHAR(100) NOT NULL,
......@@ -330,7 +341,7 @@ INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 14);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 15);
// Entry for admin user
INSERT INTO jiveUser (username, plainPassword, name, email, creationDate, modificationDate)
......
......@@ -20,6 +20,16 @@ CREATE TABLE jiveUserProp (
PRIMARY KEY (username, name)
);
CREATE TABLE jiveUserFlag (
username VARCHAR(64) NOT NULL,
name VARCHAR(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
PRIMARY KEY (username, name),
INDEX jiveUser_sTime_idx (startTime),
INDEX jiveUser_eTime_idx (endTime)
);
CREATE TABLE jiveGroup (
groupName VARCHAR(50) NOT NULL,
description VARCHAR(255),
......@@ -319,7 +329,7 @@ INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 14);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 15);
# Entry for admin user
INSERT INTO jiveUser (username, plainPassword, name, email, creationDate, modificationDate)
......
......@@ -22,6 +22,17 @@ CREATE TABLE jiveUserProp (
);
CREATE TABLE jiveUserFlag (
username VARCHAR2(64) NOT NULL,
name VARCHAR2(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime ASC);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime ASC);
CREATE TABLE jivePrivate (
username VARCHAR2(64) NOT NULL,
name VARCHAR2(100) NOT NULL,
......@@ -326,7 +337,7 @@ INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 14);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 15);
-- Entry for admin user
INSERT INTO jiveUser (username, plainPassword, name, email, creationDate, modificationDate)
......
......@@ -24,6 +24,17 @@ CREATE TABLE jiveUserProp (
);
CREATE TABLE jiveUserFlag (
username VARCHAR(64) NOT NULL,
name VARCHAR(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime);
CREATE TABLE jivePrivate (
username VARCHAR(64) NOT NULL,
name VARCHAR(100) NOT NULL,
......@@ -335,7 +346,7 @@ INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 14);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 15);
-- Entry for admin user
INSERT INTO jiveUser (username, plainPassword, name, email, creationDate, modificationDate)
......
......@@ -22,6 +22,17 @@ CREATE TABLE jiveUserProp (
);
CREATE TABLE jiveUserFlag (
username NVARCHAR(64) NOT NULL,
name NVARCHAR(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime ASC);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime ASC);
CREATE TABLE jivePrivate (
username NVARCHAR(64) NOT NULL,
name NVARCHAR(100) NOT NULL,
......@@ -333,7 +344,7 @@ INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 14);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 15);
/* Entry for admin user */
INSERT INTO jiveUser (username, plainPassword, name, email, creationDate, modificationDate)
......
......@@ -22,6 +22,17 @@ CREATE TABLE jiveUserProp (
);
CREATE TABLE jiveUserFlag (
username NVARCHAR(64) NOT NULL,
name NVARCHAR(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime ASC);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime ASC);
CREATE TABLE jivePrivate (
username NVARCHAR(64) NOT NULL,
name NVARCHAR(100) NOT NULL,
......@@ -332,7 +343,7 @@ INSERT INTO jiveID (idType, id) VALUES (18, 1);
INSERT INTO jiveID (idType, id) VALUES (19, 1);
INSERT INTO jiveID (idType, id) VALUES (23, 1);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 14);
INSERT INTO jiveVersion (name, version) VALUES ('openfire', 15);
/* Entry for admin user */
INSERT INTO jiveUser (username, plainPassword, name, email, creationDate, modificationDate)
......
-- create table jiveUserFlag
CREATE TABLE jiveUserFlag (
username VARCHAR(64) NOT NULL,
name VARCHAR(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime ASC);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime ASC);
UPDATE jiveVersion set version=15 where name = 'openfire';
\ No newline at end of file
// create table jiveUserFlag
CREATE TABLE jiveUserFlag (
username VARCHAR(64) NOT NULL,
name VARCHAR(100) NOT NULL,
startTime VARCHAR(15),
endTime VARCHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime);
UPDATE jiveVersion set version=15 where name = 'openfire';
\ No newline at end of file
# create jiveUserFlag table
CREATE TABLE jiveUserFlag (
username VARCHAR(64) NOT NULL,
name VARCHAR(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
PRIMARY KEY (username, name),
INDEX jiveUser_sTime_idx (startTime),
INDEX jiveUser_eTime_idx (endTime)
);
UPDATE jiveVersion set version=15 where name = 'openfire';
\ No newline at end of file
-- create jiveUserFlag table
CREATE TABLE jiveUserFlag (
username VARCHAR2(64) NOT NULL,
name VARCHAR2(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime ASC);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime ASC);
UPDATE jiveVersion set version=15 where name = 'openfire';
commit;
\ No newline at end of file
-- create table jiveUserFlag
CREATE TABLE jiveUserFlag (
username VARCHAR(64) NOT NULL,
name VARCHAR(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime);
UPDATE jiveVersion set version=15 where name = 'openfire';
/* create table jiveUserFlag */
CREATE TABLE jiveUserFlag (
username NVARCHAR(64) NOT NULL,
name NVARCHAR(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime ASC);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime ASC);
UPDATE jiveVersion set version=15 where name = 'openfire';
\ No newline at end of file
/* create jiveUserFlag table */
CREATE TABLE jiveUserFlag (
username NVARCHAR(64) NOT NULL,
name NVARCHAR(100) NOT NULL,
startTime CHAR(15),
endTime CHAR(15),
CONSTRAINT jiveUserFlag_pk PRIMARY KEY (username, name)
);
CREATE INDEX jiveUserFlag_sTime_idx ON jiveUserFlag (startTime ASC);
CREATE INDEX jiveUserFlag_eTime_idx ON jiveUserFlag (endTime ASC);
UPDATE jiveVersion set version=15 where name = 'openfire';
\ No newline at end of file
......@@ -75,6 +75,8 @@ tab.tab-users.descr=Klikn\u011bte pro spr\u00e1vu u\u017eivatel\u016f a skupin
sidebar.user-properties.descr=Klikn\u011bte pro \u00fapravu vlastnost\u00ed u\u017eivatele
sidebar.user-password=Heslo
sidebar.user-password.descr=Klikn\u011bte pro zm\u011bnu hesla u\u017eivatele
sidebar.user-lockout=Lock Out
sidebar.user-lockout.descr=Click to lock out or unlock the user's account
sidebar.user-delete=Smazat u\u017eivatele
sidebar.user-delete.descr=Klikn\u011bte pro smaz\u00e1n\u00ed u\u017eivatele
sidebar.user-create=Vytvo\u0159it nov\u00e9ho u\u017eivatele
......@@ -1684,6 +1686,10 @@ user.properties.available=Dostupn\u00fd
user.properties.offline=Offline
user.properties.not_set=Nenastaveno.
user.properties.registered=Registrov\u00e1n
user.properties.locked=This account is currently locked out.
user.properties.locked_set=This account has a lockout scheduled.
user.properties.locksuccess=User locked out successfully.
user.properties.unlocksuccess=User unlocked successfully.
# User search Page
......@@ -1703,6 +1709,8 @@ user.summary.created=Vytvo\u0159eno
user.summary.last-logout=Posledn\u00ed odhl\u00e1\u0161en\u00ed
user.summary.edit=Upravit
user.summary.not_user=V syst\u00e9mu nejsou \u017e\u00e1dn\u00ed u\u017eivatel\u00e9.
user.summary.locked=This account is currently locked out.
user.summary.locked_set=This account has a lockout scheduled.
# User tabs Page
......@@ -1712,6 +1720,32 @@ user.tabs.send=Poslat zpr\u00e1vu
user.tabs.change_pwd=Zm\u011bnit heslo
user.tabs.delete_user=Smazat u\u017eivatele
# User Lockout Page
user.lockout.title=User Lock Out
user.lockout.info=Are you sure you want to lock out the user
user.lockout.info1=from the system?
user.lockout.warning=Warning! You are about to lock out your
user.lockout.warning2=own
user.lockout.warning3=user account. Are you sure you want to do this? Doing so will log you out of \
the system immediately if the lock out not set to start in the future.
user.lockout.lock=Lock Out User
user.lockout.unlock=Unlock User
user.lockout.locked=The user {0} is locked out
user.lockout.locked2=starting {0}
user.lockout.lockedand=and
user.lockout.locked3=ending {0}
user.lockout.time.startdelay=Begin the lock out:
user.lockout.time.duration=Lock out the account for the following duration:
user.lockout.time.immediate=immediately
user.lockout.time.forever=forever
user.lockout.time.1hour=one hour
user.lockout.time.1day=one day
user.lockout.time.1week=one week
user.lockout.time.in=in
user.lockout.time.for=for
user.lockout.time.minutes=minutes
# Plugins Admin Page
plugin.admin.title=Dopl\u0148ky
......
......@@ -74,6 +74,8 @@ tab.tab-users.descr=Hier klicken um Benutzer und Gruppen zu verwalten
sidebar.user-properties.descr=Hier klicken um die Einstellungen des Benutzers zu bearbeiten
sidebar.user-password=Passwort
sidebar.user-password.descr=Hier klicken um das Passwort des Benutzers zu \u00e4ndern
sidebar.user-lockout=Lock Out
sidebar.user-lockout.descr=Click to lock out or unlock the user's account
sidebar.user-delete=Benutzer l\u00f6schen
sidebar.user-delete.descr=Hier klicken um den Benutzer zu l\u00f6schen
sidebar.user-create=Neuen Benutzer anlegen
......@@ -1625,6 +1627,10 @@ user.properties.available=Verf\u00fcgbar
user.properties.offline=Offline
user.properties.not_set=Nicht gesetzt.
user.properties.registered=Registriert
user.properties.locked=This account is currently locked out.
user.properties.locked_set=This account has a lockout scheduled.
user.properties.locksuccess=User locked out successfully.
user.properties.unlocksuccess=User unlocked successfully.
# User search Page
......@@ -1643,6 +1649,8 @@ user.summary.users_per_page=Benutzer pro Seite
user.summary.created=Angelegt
user.summary.edit=Bearbeiten
user.summary.not_user=Keine Benutzer im System.
user.summary.locked=This account is currently locked out.
user.summary.locked_set=This account has a lockout scheduled.
# User tabs Page
......@@ -1652,6 +1660,32 @@ user.tabs.send=Nachricht schicken
user.tabs.change_pwd=Passwort \u00e4ndern
user.tabs.delete_user=Benutzer l\u00f6schen
# User Lockout Page
user.lockout.title=User Lock Out
user.lockout.info=Are you sure you want to lock out the user
user.lockout.info1=from the system?
user.lockout.warning=Warning! You are about to lock out your
user.lockout.warning2=own
user.lockout.warning3=user account. Are you sure you want to do this? Doing so will log you out of \
the system immediately if the lock out not set to start in the future.
user.lockout.lock=Lock Out User
user.lockout.unlock=Unlock User
user.lockout.locked=The user {0} is locked out
user.lockout.locked2=starting {0}
user.lockout.lockedand=and
user.lockout.locked3=ending {0}
user.lockout.time.startdelay=Begin the lock out:
user.lockout.time.duration=Lock out the account for the following duration:
user.lockout.time.immediate=immediately
user.lockout.time.forever=forever
user.lockout.time.1hour=one hour
user.lockout.time.1day=one day
user.lockout.time.1week=one week
user.lockout.time.in=in
user.lockout.time.for=for
user.lockout.time.minutes=minutes
# Plugins Admin Page
plugin.admin.title=Plugins
......
......@@ -313,6 +313,26 @@
## Added key: 'setup.clearspace.service.test.status-success'
## Added key: 'setup.clearspace.service.test.status-success.detail'
## Added key: 'setup.clearspace.service.test.status-error'
## Added key: 'user.properties.locked'
## Added key: 'user.properties.locked_set'
## Added key: 'user.summary.locked'
## Added key: 'user.summary.locked_set'
## Added key: 'user.lockout.title'
## Added key: 'user.lockout.info'
## Added key: 'user.lockout.info1'
## Added key: 'user.lockout.warning'
## Added key: 'user.lockout.warning2'
## Added key: 'user.lockout.warning3'
## Added key: 'user.lockout.lock'
## Added key: 'user.lockout.unlock'
## Added key: 'user.lockout.locked'
## Added key: 'user.lockout.locked2'
## Added key: 'user.lockout.lockedand'
## Added key: 'user.lockout.locked3'
## Added key: 'user.properties.locksuccess'
## Added key: 'user.properties.unlocksuccess'
## Added key: 'sidebar.user-lockout'
## Added key: 'sidebar.user-lockout.descr'
# Openfire
......@@ -389,6 +409,8 @@ tab.tab-users.descr=Click to manage users and groups
sidebar.user-roster.descr=Click to view the user's roster
sidebar.user-password=Password
sidebar.user-password.descr=Click to change the user's password
sidebar.user-lockout=Lock Out
sidebar.user-lockout.descr=Click to lock out or unlock the user's account
sidebar.user-delete=Delete User
sidebar.user-delete.descr=Click to delete the user
sidebar.user-create=Create New User
......@@ -2068,6 +2090,10 @@ user.properties.available=Available
user.properties.offline=Offline
user.properties.not_set=Not set.
user.properties.registered=Registered
user.properties.locked=This account is currently locked out.
user.properties.locked_set=This account has a lockout scheduled.
user.properties.locksuccess=User locked out successfully.
user.properties.unlocksuccess=User unlocked successfully.
# User roster Page
......@@ -2129,6 +2155,8 @@ user.summary.created=Created
user.summary.last-logout=Last Logout
user.summary.edit=Edit
user.summary.not_user=No users in the system.
user.summary.locked=This account is currently locked out.
user.summary.locked_set=This account has a lockout scheduled.
# User tabs Page
......@@ -2138,6 +2166,32 @@ user.tabs.send=Send Message
user.tabs.change_pwd=Change Password
user.tabs.delete_user=Delete User
# User Lockout Page
user.lockout.title=User Lock Out
user.lockout.info=Are you sure you want to lock out the user
user.lockout.info1=from the system?
user.lockout.warning=Warning! You are about to lock out your
user.lockout.warning2=own
user.lockout.warning3=user account. Are you sure you want to do this? Doing so will log you out of \
the system immediately if the lock out not set to start in the future.
user.lockout.lock=Lock Out User
user.lockout.unlock=Unlock User
user.lockout.locked=The user {0} is locked out
user.lockout.locked2=starting {0}
user.lockout.lockedand=and
user.lockout.locked3=ending {0}
user.lockout.time.startdelay=Begin the lock out:
user.lockout.time.duration=Lock out the account for the following duration:
user.lockout.time.immediate=immediately
user.lockout.time.forever=forever
user.lockout.time.1hour=one hour
user.lockout.time.1day=one day
user.lockout.time.1week=one week
user.lockout.time.in=in
user.lockout.time.for=for
user.lockout.time.minutes=minutes
# Plugins Admin Page
plugin.admin.title=Plugins
......
......@@ -71,6 +71,8 @@ tab.tab-users.descr=Presione para administrar usuarios y grupos
sidebar.user-properties.descr=Presione para editar las propiedades del usuario
sidebar.user-password=Contrase\u00f1a
sidebar.user-password.descr=Presione para cambiar la contrase\u00f1a del usuario
sidebar.user-lockout=Lock Out
sidebar.user-lockout.descr=Click to lock out or unlock the user's account
sidebar.user-delete=Borrar Usuario
sidebar.user-delete.descr=Presiona para borrar el usuario
sidebar.user-create=Crear Nuevo Usuario
......@@ -1681,6 +1683,10 @@ user.properties.available=Disponible
user.properties.offline=Desconectado
user.properties.not_set=No configurado.
user.properties.registered=Registrado
user.properties.locked=This account is currently locked out.
user.properties.locked_set=This account has a lockout scheduled.
user.properties.locksuccess=User locked out successfully.
user.properties.unlocksuccess=User unlocked successfully.
# User search Page
......@@ -1700,6 +1706,8 @@ user.summary.created=Creado
user.summary.last-logout=\u00daltima Salida
user.summary.edit=Editar
user.summary.not_user=No hay usuarios en el sistema.
user.summary.locked=This account is currently locked out.
user.summary.locked_set=This account has a lockout scheduled.
# User tabs Page
......@@ -1709,6 +1717,32 @@ user.tabs.send=Enviar Mensaje
user.tabs.change_pwd=Cambiar Contrase\u00f1a
user.tabs.delete_user=Borrar Usuario
# User Lockout Page
user.lockout.title=User Lock Out
user.lockout.info=Are you sure you want to lock out the user
user.lockout.info1=from the system?
user.lockout.warning=Warning! You are about to lock out your
user.lockout.warning2=own
user.lockout.warning3=user account. Are you sure you want to do this? Doing so will log you out of \
the system immediately if the lock out not set to start in the future.
user.lockout.lock=Lock Out User
user.lockout.unlock=Unlock User
user.lockout.locked=The user {0} is locked out
user.lockout.locked2=starting {0}
user.lockout.lockedand=and
user.lockout.locked3=ending {0}
user.lockout.time.startdelay=Begin the lock out:
user.lockout.time.duration=Lock out the account for the following duration:
user.lockout.time.immediate=immediately
user.lockout.time.forever=forever
user.lockout.time.1hour=one hour
user.lockout.time.1day=one day
user.lockout.time.1week=one week
user.lockout.time.in=in
user.lockout.time.for=for
user.lockout.time.minutes=minutes
# Plugins Admin Page
plugin.admin.title=Plugins
......
......@@ -58,6 +58,8 @@ sidebar.user-properties = Param\u00E9trage Utilisateur
sidebar.user-properties.descr = Cliquer pour modifier les param\u00E8tres de l'utilisateur
sidebar.user-password = Mot de passe
sidebar.user-password.descr = Cliquer pour changer le mot de passe utilisateur
sidebar.user-lockout=Lock Out
sidebar.user-lockout.descr=Click to lock out or unlock the user's account
sidebar.user-delete = Supprimer l'utilisateur
sidebar.user-delete.descr = Cliquer pour supprimer l'utilisateur
sidebar.user-create = Cr\u00E9er un nouvel utilisateur
......@@ -1357,6 +1359,10 @@ user.properties.available = Disponible
user.properties.offline = D\u00E9connect\u00E9
user.properties.not_set = Non Param\u00E9tr\u00E9.
user.properties.registered = Enregistr\u00E9
user.properties.locked=This account is currently locked out.
user.properties.locked_set=This account has a lockout scheduled.
user.properties.locksuccess=User locked out successfully.
user.properties.unlocksuccess=User unlocked successfully.
# User search Page
user.search.title = Rechercher un Utilisateur
user.search.not_found = Utilisateur non trouv\u00E9. Essayez une autre recherche.
......@@ -1372,12 +1378,38 @@ user.summary.created = Cr\u00E9er
user.summary.last-logout = Dernier Logout
user.summary.edit = Modifier
user.summary.not_user = Pas d'utilisateur dans le syst\u00E8me.
user.summary.locked=This account is currently locked out.
user.summary.locked_set=This account has a lockout scheduled.
# User tabs Page
user.tabs.properties = Propri\u00E9t\u00E9s Utilisateur
user.tabs.edit = Modifier l'Utilisateur
user.tabs.send = Envoyer un Message
user.tabs.change_pwd = Changer le mot de passe
user.tabs.delete_user = Supprimer l'Utilisateur
# User Lockout Page
user.lockout.title=User Lock Out
user.lockout.info=Are you sure you want to lock out the user
user.lockout.info1=from the system?
user.lockout.warning=Warning! You are about to lock out your
user.lockout.warning2=own
user.lockout.warning3=user account. Are you sure you want to do this? Doing so will log you out of \
the system immediately if the lock out not set to start in the future.
user.lockout.lock=Lock Out User
user.lockout.unlock=Unlock User
user.lockout.locked=The user {0} is locked out
user.lockout.locked2=starting {0}
user.lockout.lockedand=and
user.lockout.locked3=ending {0}
user.lockout.time.startdelay=Begin the lock out:
user.lockout.time.duration=Lock out the account for the following duration:
user.lockout.time.immediate=immediately
user.lockout.time.forever=forever
user.lockout.time.1hour=one hour
user.lockout.time.1day=one day
user.lockout.time.1week=one week
user.lockout.time.in=in
user.lockout.time.for=for
user.lockout.time.minutes=minutes
# Plugins Admin Page
plugin.admin.title = Plugins
plugin.admin.info = Les Plugins ajoutent de nouvelles fonctionnalit\u00E9s au serveur. La liste des plugins install\u00E9s est ci-dessous. Pour t\u00E9l\u00E9charger de nouveaux plugins, visitez la page de <a href\="available-plugins.jsp">T\u00E9l\u00E9chargement de plugin</a>.
......
......@@ -254,6 +254,8 @@ tab.tab-users.descr=\u30e6\u30fc\u30b6\u30fc\u3068\u30b0\u30eb\u30fc\u30d7\u3092
sidebar.user-properties.descr=\u30e6\u30fc\u30b6\u30fc\u306e\u5c5e\u6027\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b\u5834\u5408\u306b\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002
sidebar.user-password=\u30d1\u30b9\u30ef\u30fc\u30c9
sidebar.user-password.descr=\u30e6\u30fc\u30b6\u30fc\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5909\u66f4\u3059\u308b\u5834\u5408\u306b\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002
sidebar.user-lockout=Lock Out
sidebar.user-lockout.descr=Click to lock out or unlock the user's account
sidebar.user-delete=\u30e6\u30fc\u30b6\u30fc\u524a\u9664
sidebar.user-delete.descr=\u30e6\u30fc\u30b6\u30fc\u3092\u524a\u9664\u3059\u308b\u5834\u5408\u306b\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002
sidebar.user-create=\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u4f5c\u6210
......@@ -1854,6 +1856,10 @@ user.properties.available=\u6709\u52b9
user.properties.offline=\u30aa\u30d5\u30e9\u30a4\u30f3
user.properties.not_set=\u30bb\u30c3\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002
user.properties.registered=\u767b\u9332\u65e5
user.properties.locked=This account is currently locked out.
user.properties.locked_set=This account has a lockout scheduled.
user.properties.locksuccess=User locked out successfully.
user.properties.unlocksuccess=User unlocked successfully.
# User search Page
......@@ -1873,6 +1879,8 @@ user.summary.created=\u4f5c\u6210\u65e5
user.summary.last-logout=\u6700\u7d42\u30ed\u30b0\u30a2\u30a6\u30c8
user.summary.edit=\u7de8\u96c6
user.summary.not_user=\u30b7\u30b9\u30c6\u30e0\u306b\u30e6\u30fc\u30b6\u30fc\u304c\u3044\u307e\u305b\u3093\u3002
user.summary.locked=This account is currently locked out.
user.summary.locked_set=This account has a lockout scheduled.
# User tabs Page
......@@ -1882,6 +1890,32 @@ user.tabs.send=\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3057\u307e\u305
user.tabs.change_pwd=\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5909\u66f4\u3057\u307e\u3059\u3002
user.tabs.delete_user=\u30e6\u30fc\u30b6\u30fc\u3092\u524a\u9664\u3057\u307e\u3059\u3002
# User Lockout Page
user.lockout.title=User Lock Out
user.lockout.info=Are you sure you want to lock out the user
user.lockout.info1=from the system?
user.lockout.warning=Warning! You are about to lock out your
user.lockout.warning2=own
user.lockout.warning3=user account. Are you sure you want to do this? Doing so will log you out of \
the system immediately if the lock out not set to start in the future.
user.lockout.lock=Lock Out User
user.lockout.unlock=Unlock User
user.lockout.locked=The user {0} is locked out
user.lockout.locked2=starting {0}
user.lockout.lockedand=and
user.lockout.locked3=ending {0}
user.lockout.time.startdelay=Begin the lock out:
user.lockout.time.duration=Lock out the account for the following duration:
user.lockout.time.immediate=immediately
user.lockout.time.forever=forever
user.lockout.time.1hour=one hour
user.lockout.time.1day=one day
user.lockout.time.1week=one week
user.lockout.time.in=in
user.lockout.time.for=for
user.lockout.time.minutes=minutes
# Plugins Admin Page
plugin.admin.title=\u30d7\u30e9\u30b0\u30a4\u30f3
......
......@@ -72,6 +72,8 @@ tab.tab-users.descr=Klik hier om gebruikers en groepen te beheren
sidebar.user-properties.descr=Klik hier om de gebruikerseigenschappen te wijzigen
sidebar.user-password=Wachtwoord
sidebar.user-password.descr=Klik hier om het wachtwoord te wijzigen
sidebar.user-lockout=Lock Out
sidebar.user-lockout.descr=Click to lock out or unlock the user's account
sidebar.user-delete=Gebruiker verwijderen
sidebar.user-delete.descr=Klik hier om de gebruiker te verwijderen
sidebar.user-create=Nieuwe gebruiker toevoegen
......@@ -1625,6 +1627,10 @@ user.properties.available=Beschikbaar
user.properties.offline=Offline
user.properties.not_set=Niet opgegeven.
user.properties.registered=Geregistreerd
user.properties.locked=This account is currently locked out.
user.properties.locked_set=This account has a lockout scheduled.
user.properties.locksuccess=User locked out successfully.
user.properties.unlocksuccess=User unlocked successfully.
# User search Page
......@@ -1643,6 +1649,8 @@ user.summary.users_per_page=Gebruikers per pagina
user.summary.created=Aangemaakt
user.summary.edit=Wijzigen
user.summary.not_user=Er zijn geen gebruikers op het systeem.
user.summary.locked=This account is currently locked out.
user.summary.locked_set=This account has a lockout scheduled.
# User tabs Page
......@@ -1652,6 +1660,32 @@ user.tabs.send=Bericht sturen
user.tabs.change_pwd=Wachtwoord wijzigen
user.tabs.delete_user=Gebruiker verwijderen
# User Lockout Page
user.lockout.title=User Lock Out
user.lockout.info=Are you sure you want to lock out the user
user.lockout.info1=from the system?
user.lockout.warning=Warning! You are about to lock out your
user.lockout.warning2=own
user.lockout.warning3=user account. Are you sure you want to do this? Doing so will log you out of \
the system immediately if the lock out not set to start in the future.
user.lockout.lock=Lock Out User
user.lockout.unlock=Unlock User
user.lockout.locked=The user {0} is locked out
user.lockout.locked2=starting {0}
user.lockout.lockedand=and
user.lockout.locked3=ending {0}
user.lockout.time.startdelay=Begin the lock out:
user.lockout.time.duration=Lock out the account for the following duration:
user.lockout.time.immediate=immediately
user.lockout.time.forever=forever
user.lockout.time.1hour=one hour
user.lockout.time.1day=one day
user.lockout.time.1week=one week
user.lockout.time.in=in
user.lockout.time.for=for
user.lockout.time.minutes=minutes
# Plugins Admin Page
plugin.admin.title=Plug-ins
......
......@@ -76,6 +76,8 @@ tab.tab-users.descr=Kliknij aby zarz\u0105dza\u0107 u\u017cytkownikami i grupami
sidebar.user-properties.descr=Kliknij aby edytowa\u0107 dane u\u017cytkownika
sidebar.user-password=Has\u0142o
sidebar.user-password.descr=Kliknij aby zmieni\u0107 has\u0142o u\u017cytkownika
sidebar.user-lockout=Lock Out
sidebar.user-lockout.descr=Click to lock out or unlock the user's account
sidebar.user-delete=Usu\u0144 u\u017cytkownika
sidebar.user-delete.descr=Kliknij aby usun\u0105\u0107 u\u017cytkownika
sidebar.user-create=Utw\u00f3rz nowego u\u017cytkownika
......@@ -1604,6 +1606,10 @@ user.properties.available=Dost\u0119pny
user.properties.offline=Roz\u0142\u0105czony
user.properties.not_set=Nieustawione.
user.properties.registered=Zarejestrowano
user.properties.locked=This account is currently locked out.
user.properties.locked_set=This account has a lockout scheduled.
user.properties.locksuccess=User locked out successfully.
user.properties.unlocksuccess=User unlocked successfully.
# User search Page
......@@ -1622,6 +1628,8 @@ user.summary.users_per_page=U\u017cytkownik\u00f3w na stronie
user.summary.created=Utworzono
user.summary.edit=Edytuj
user.summary.not_user=Brak u\u017cytkownik\u00f3w w systemie.
user.summary.locked=This account is currently locked out.
user.summary.locked_set=This account has a lockout scheduled.
# User tabs Page
......@@ -1631,6 +1639,32 @@ user.tabs.send=Wy\u015blij wiadomo\u015b\u0107
user.tabs.change_pwd=Zmie\u0144 has\u0142o
user.tabs.delete_user=Usu\u0144 u\u017cytkownika
# User Lockout Page
user.lockout.title=User Lock Out
user.lockout.info=Are you sure you want to lock out the user
user.lockout.info1=from the system?
user.lockout.warning=Warning! You are about to lock out your
user.lockout.warning2=own
user.lockout.warning3=user account. Are you sure you want to do this? Doing so will log you out of \
the system immediately if the lock out not set to start in the future.
user.lockout.lock=Lock Out User
user.lockout.unlock=Unlock User
user.lockout.locked=The user {0} is locked out
user.lockout.locked2=starting {0}
user.lockout.lockedand=and
user.lockout.locked3=ending {0}
user.lockout.time.startdelay=Begin the lock out:
user.lockout.time.duration=Lock out the account for the following duration:
user.lockout.time.immediate=immediately
user.lockout.time.forever=forever
user.lockout.time.1hour=one hour
user.lockout.time.1day=one day
user.lockout.time.1week=one week
user.lockout.time.in=in
user.lockout.time.for=for
user.lockout.time.minutes=minutes
# Plugins Admin Page
plugin.admin.title=Wtyczki
......
......@@ -74,6 +74,8 @@ tab.tab-users.descr=Clique para gerenciar os usu\u00e1rios e grupos
sidebar.user-properties.descr=Clique para editar as propriedades do usu\u00e1rio
sidebar.user-password=Senha
sidebar.user-password.descr=Clique para mudar a senha do usu\u00e1rio
sidebar.user-lockout=Lock Out
sidebar.user-lockout.descr=Click to lock out or unlock the user's account
sidebar.user-delete=Apagar Usu\u00e1rio
sidebar.user-delete.descr=Clique para apagar o usu\u00e1rio
sidebar.user-create=Criar Novo Usu\u00e1rio
......@@ -1687,6 +1689,10 @@ user.properties.available=Dispon\u00edvel
user.properties.offline=Offline
user.properties.not_set=N\u00e3o configurado.
user.properties.registered=Registrado
user.properties.locked=This account is currently locked out.
user.properties.locked_set=This account has a lockout scheduled.
user.properties.locksuccess=User locked out successfully.
user.properties.unlocksuccess=User unlocked successfully.
# User search Page
......@@ -1706,6 +1712,8 @@ user.summary.created=Criado
user.summary.last-logout=\u00daltima Desconex\u00e3o
user.summary.edit=Editar
user.summary.not_user=N\u00e3o h\u00e1 usu\u00e1rios no sistema.
user.summary.locked=This account is currently locked out.
user.summary.locked_set=This account has a lockout scheduled.
# User tabs Page
......@@ -1715,6 +1723,32 @@ user.tabs.send=Enviar Mensagem
user.tabs.change_pwd=Mudar Senha
user.tabs.delete_user=Apagar Usu\u00e1rio
# User Lockout Page
user.lockout.title=User Lock Out
user.lockout.info=Are you sure you want to lock out the user
user.lockout.info1=from the system?
user.lockout.warning=Warning! You are about to lock out your
user.lockout.warning2=own
user.lockout.warning3=user account. Are you sure you want to do this? Doing so will log you out of \
the system immediately if the lock out not set to start in the future.
user.lockout.lock=Lock Out User
user.lockout.unlock=Unlock User
user.lockout.locked=The user {0} is locked out
user.lockout.locked2=starting {0}
user.lockout.lockedand=and
user.lockout.locked3=ending {0}
user.lockout.time.startdelay=Begin the lock out:
user.lockout.time.duration=Lock out the account for the following duration:
user.lockout.time.immediate=immediately
user.lockout.time.forever=forever
user.lockout.time.1hour=one hour
user.lockout.time.1day=one day
user.lockout.time.1week=one week
user.lockout.time.in=in
user.lockout.time.for=for
user.lockout.time.minutes=minutes
# Plugins Admin Page
plugin.admin.title=Plugins
......
......@@ -75,6 +75,8 @@ tab.tab-users.descr=\u5355\u51fb\u53ef\u7ba1\u7406\u7528\u6237\u548c\u7ec4
sidebar.user-properties.descr=\u5355\u51fb\u53ef\u7f16\u8f91\u7528\u6237\u5c5e\u6027
sidebar.user-password=\u5bc6\u7801
sidebar.user-password.descr=\u5355\u51fb\u53ef\u66f4\u6539\u7528\u6237\u5bc6\u7801
sidebar.user-lockout=Lock Out
sidebar.user-lockout.descr=Click to lock out or unlock the user's account
sidebar.user-delete=\u5220\u9664\u7528\u6237
sidebar.user-delete.descr=\u5355\u51fb\u53ef\u5220\u9664\u7528\u6237
sidebar.user-create=\u65b0\u5efa\u7528\u6237
......@@ -1505,6 +1507,10 @@ user.properties.available=\u53ef\u7528
user.properties.offline=\u8131\u673a
user.properties.not_set=\u672a\u8bbe\u7f6e\u3002
user.properties.registered=\u5df2\u6ce8\u518c
user.properties.locked=This account is currently locked out.
user.properties.locked_set=This account has a lockout scheduled.
user.properties.locksuccess=User locked out successfully.
user.properties.unlocksuccess=User unlocked successfully.
# User search Page
......@@ -1524,6 +1530,8 @@ user.summary.created=\u5df2\u521b\u5efa
user.summary.last-logout=\u6700\u8fd1\u4e00\u6b21\u9000\u51fa
user.summary.edit=\u7f16\u8f91
user.summary.not_user=\u7cfb\u7edf\u4e2d\u65e0\u7528\u6237\u3002
user.summary.locked=This account is currently locked out.
user.summary.locked_set=This account has a lockout scheduled.
# User tabs Page
......@@ -1533,6 +1541,32 @@ user.tabs.send=\u53d1\u9001\u6d88\u606f
user.tabs.change_pwd=\u66f4\u6539\u5bc6\u7801
user.tabs.delete_user=\u5220\u9664\u7528\u6237
# User Lockout Page
user.lockout.title=User Lock Out
user.lockout.info=Are you sure you want to lock out the user
user.lockout.info1=from the system?
user.lockout.warning=Warning! You are about to lock out your
user.lockout.warning2=own
user.lockout.warning3=user account. Are you sure you want to do this? Doing so will log you out of \
the system immediately if the lock out not set to start in the future.
user.lockout.lock=Lock Out User
user.lockout.unlock=Unlock User
user.lockout.locked=The user {0} is locked out
user.lockout.locked2=starting {0}
user.lockout.lockedand=and
user.lockout.locked3=ending {0}
user.lockout.time.startdelay=Begin the lock out:
user.lockout.time.duration=Lock out the account for the following duration:
user.lockout.time.immediate=immediately
user.lockout.time.forever=forever
user.lockout.time.1hour=one hour
user.lockout.time.1day=one day
user.lockout.time.1week=one week
user.lockout.time.in=in
user.lockout.time.for=for
user.lockout.time.minutes=minutes
# Plugins Admin Page
plugin.admin.title=\u63d2\u4ef6
......
......@@ -44,7 +44,7 @@ public class SchemaManager {
/**
* Current Openfire database schema version.
*/
private static final int DATABASE_VERSION = 13;
private static final int DATABASE_VERSION = 15;
/**
* Creates a new Schema manager.
......
......@@ -44,6 +44,7 @@ import org.jivesoftware.openfire.transport.TransportHandler;
import org.jivesoftware.openfire.update.UpdateManager;
import org.jivesoftware.openfire.user.UserManager;
import org.jivesoftware.openfire.vcard.VCardManager;
import org.jivesoftware.openfire.lockout.LockOutManager;
import org.jivesoftware.util.*;
import org.jivesoftware.util.cache.CacheFactory;
import org.xmpp.packet.JID;
......@@ -1201,6 +1202,17 @@ public class XMPPServer {
return UserManager.getInstance();
}
/**
* Returns the <code>LockOutManager</code> registered with this server. The
* <code>LockOutManager</code> was registered with the server as a module while starting up
* the server.
*
* @return the <code>LockOutManager</code> registered with this server.
*/
public LockOutManager getLockOutManager() {
return LockOutManager.getInstance();
}
/**
* Returns the <code>UpdateManager</code> registered with this server. The
* <code>UpdateManager</code> was registered with the server as a module while starting up
......
......@@ -13,6 +13,7 @@ package org.jivesoftware.openfire.auth;
import org.jivesoftware.util.*;
import org.jivesoftware.openfire.user.UserNotFoundException;
import org.jivesoftware.openfire.lockout.LockOutManager;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
......@@ -141,11 +142,16 @@ public class AuthFactory {
* @param username the username.
* @param password the password.
* @return an AuthToken token if the username and password are correct.
* @throws UnauthorizedException if the username and password do not match any existing user.
* @throws UnauthorizedException if the username and password do not match any existing user
* or the account is locked out.
*/
public static AuthToken authenticate(String username, String password)
throws UnauthorizedException
{
if (LockOutManager.getInstance().isAccountDisabled(username)) {
LockOutManager.getInstance().recordFailedLogin(username);
throw new UnauthorizedException();
}
authProvider.authenticate(username, password);
return new AuthToken(username);
}
......@@ -162,11 +168,15 @@ public class AuthFactory {
* @return an AuthToken token if the username and digest are correct for the user's
* password and given token.
* @throws UnauthorizedException if the username and password do not match any
* existing user.
* existing user or the account is locked out.
*/
public static AuthToken authenticate(String username, String token, String digest)
throws UnauthorizedException
{
if (LockOutManager.getInstance().isAccountDisabled(username)) {
LockOutManager.getInstance().recordFailedLogin(username);
throw new UnauthorizedException();
}
authProvider.authenticate(username, token, digest);
return new AuthToken(username);
}
......
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.lockout;
import org.jivesoftware.database.DbConnectionManager;
import org.jivesoftware.util.StringUtils;
import java.sql.*;
import java.util.Date;
/**
* @author Daniel Henninger
*/
public class DefaultLockOutProvider implements LockOutProvider {
private static final String FLAG_ID = "lockout";
private static final String DELETE_FLAG =
"DELETE FROM jiveUserFlag WHERE username=? AND name='"+FLAG_ID+"'";
private static final String ADD_FLAG =
"INSERT INTO jiveUserFlag VALUES(?,'"+FLAG_ID+"',?,?)";
private static final String RETRIEVE_FLAG =
"SELECT name,startTime,endTime FROM jiveUserFlag WHERE username=? AND name='"+FLAG_ID+"'";
/**
* Constructs a new DefaultLockOutProvider
*/
public DefaultLockOutProvider() {
}
/**
* Default provider retrieves disabled status from jiveUserFlag table.
* @see org.jivesoftware.openfire.lockout.LockOutProvider#getDisabledStatus(String)
*/
public LockOutFlag getDisabledStatus(String username) throws NotLockedOutException {
Connection con = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
LockOutFlag ret = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(RETRIEVE_FLAG);
pstmt.setString(1, username);
rs = pstmt.executeQuery();
if (!rs.next()) {
throw new NotLockedOutException();
}
Date startTime = null;
if (rs.getString(2) != null) {
startTime = new Date(Long.parseLong(rs.getString(2).trim()));
}
Date endTime = null;
if (rs.getString(3) != null) {
endTime = new Date(Long.parseLong(rs.getString(3).trim()));
}
ret = new LockOutFlag(username, startTime, endTime);
}
catch (Exception e) {
throw new NotLockedOutException();
}
finally {
DbConnectionManager.closeConnection(rs, pstmt, con);
}
return ret;
}
/**
* Default provider deletes existing flag, if it exists, and adds new described flag in jiveUserFlag table.
* @see org.jivesoftware.openfire.lockout.LockOutProvider#setDisabledStatus(LockOutFlag)
*/
public void setDisabledStatus(LockOutFlag flag) {
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(DELETE_FLAG);
pstmt.setString(1, flag.getUsername());
pstmt.executeUpdate();
}
catch (SQLException sqle) {
// Nothing to do.
}
finally {
DbConnectionManager.closeConnection(pstmt, con);
}
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(ADD_FLAG);
pstmt.setString(1, flag.getUsername());
if (flag.getStartTime() != null) {
pstmt.setString(2, StringUtils.dateToMillis(flag.getStartTime()));
}
else {
pstmt.setNull(2, Types.VARCHAR);
}
if (flag.getStartTime() != null) {
pstmt.setString(3, StringUtils.dateToMillis(flag.getStartTime()));
}
else {
pstmt.setNull(3, Types.VARCHAR);
}
pstmt.executeUpdate();
}
catch (SQLException sqle) {
// Nothing to do.
}
finally {
DbConnectionManager.closeConnection(pstmt, con);
}
}
/**
* Default provider deletes existing flag from jiveUserFlag table.
* @see org.jivesoftware.openfire.lockout.LockOutProvider#unsetDisabledStatus(String)
*/
public void unsetDisabledStatus(String username) {
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(DELETE_FLAG);
pstmt.setString(1, username);
pstmt.executeUpdate();
}
catch (SQLException sqle) {
// Nothing to do.
}
finally {
DbConnectionManager.closeConnection(pstmt, con);
}
}
/**
* Default provider allows editing of disabled status.
* @see org.jivesoftware.openfire.lockout.LockOutProvider#isReadOnly()
*/
public boolean isReadOnly() {
return false;
}
}
/**
* $RCSfile$
* $Revision: $
* $Date: $
*
* Copyright (C) 2008 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.lockout;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* Dispatches lockout events. The following events are supported:
* <ul>
* <li><b>accountLocked</b> --> An account has been disabled/locked out.</li>
* <li><b>accountUnlocked</b> --> An account has been enabled/unlocked.</li>
* <li><b>lockedAccountDenied</b> --> A locked out account has been denied login.</li>
* </ul>
* Use {@link #addListener(LockOutEventListener)} and {@link #removeListener(LockOutEventListener)}
* to add or remove {@link LockOutEventListener}.
*
* @author Daniel Henninger
*/
public class LockOutEventDispatcher {
private static List<LockOutEventListener> listeners =
new CopyOnWriteArrayList<LockOutEventListener>();
/**
* Registers a listener to receive events.
*
* @param listener the listener.
*/
public static void addListener(LockOutEventListener listener) {
if (listener == null) {
throw new NullPointerException();
}
listeners.add(listener);
}
/**
* Unregisters a listener to receive events.
*
* @param listener the listener.
*/
public static void removeListener(LockOutEventListener listener) {
listeners.remove(listener);
}
/**
* Notifies the listeners that an account was just set to be disabled/locked out.
*
* @param flag The LockOutFlag that was set, which includes the username of the account and start/end times.
*/
public static void accountLocked(LockOutFlag flag) {
if (!listeners.isEmpty()) {
for (LockOutEventListener listener : listeners) {
listener.accountLocked(flag);
}
}
}
/**
* Notifies the listeners that an account was just enabled (lockout removed).
*
* @param username The username of the account that was enabled.
*/
public static void accountUnlocked(String username) {
if (!listeners.isEmpty()) {
for (LockOutEventListener listener : listeners) {
listener.accountUnlocked(username);
}
}
}
/**
* Notifies the listeners that a locked out account attempted to log in.
*
* @param username The username of the account that tried to log in.
*/
public static void lockedAccountDenied(String username) {
if (!listeners.isEmpty()) {
for (LockOutEventListener listener : listeners) {
listener.lockedAccountDenied(username);
}
}
}
}
/**
* $RCSfile$
* $Revision: $
* $Date: $
*
* Copyright (C) 2008 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.lockout;
/**
* Interface to listen for lockout events. Use the
* {@link LockOutEventDispatcher#addListener(LockOutEventListener)}
* method to register for events.
*
* @author Daniel Henninger
*/
public interface LockOutEventListener {
/**
* Notifies the listeners that an account was just set to be disabled/locked out.
*
* @param flag The LockOutFlag that was set, which includes the username of the account and start/end times.
*/
public void accountLocked(LockOutFlag flag);
/**
* Notifies the listeners that an account was just enabled (lockout removed).
*
* @param username The username of the account that was enabled.
*/
public void accountUnlocked(String username);
/**
* Notifies the listeners that a locked out account attempted to log in.
*
* @param username The username of the account that tried to log in.
*/
public void lockedAccountDenied(String username);
}
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.lockout;
import org.jivesoftware.util.cache.Cacheable;
import org.jivesoftware.util.cache.CacheSizes;
import org.jivesoftware.util.cache.ExternalizableUtil;
import java.util.Date;
import java.io.Externalizable;
import java.io.ObjectOutput;
import java.io.IOException;
import java.io.ObjectInput;
/**
* A LockOutFlag represents the current disabled status set on a particular user account.
* It can have a start and end time (a period of time in which the disabled status is active).
*
* @author Daniel Henninger
*/
public class LockOutFlag implements Cacheable, Externalizable {
private String username;
private Date startTime = null;
private Date endTime = null;
/**
* Constructor added for Externalizable. Do not use this constructor.
*/
public LockOutFlag() {
}
/**
* Creates a representation of a lock out flag, including which user it is attached to
* and an optional start and end time.
*
* @param username User the flag is attached to.
* @param startTime Optional start time for the disabled status to start.
* @param endTime Optional end time for the disabled status to end.
*/
public LockOutFlag(String username, Date startTime, Date endTime) {
this.username = username;
this.startTime = startTime;
this.endTime = endTime;
}
/**
* Retrieves the username that this lock out flag is attached to.
*
* @return Username the flag is attached to.
*/
public String getUsername() {
return username;
}
/**
* Retrieves the date/time at which the account this flag references will begin having a disabled status.
* This can be null if there is no start time set, meaning that the start time is immediate.
*
* @return The Date when the disabled status will start, or null for immediately.
*/
public Date getStartTime() {
return startTime;
}
/**
* Sets the start time for when the account will be disabled, or null if immediate.
*
* @param startTime Date when the disabled status will start, or null for immediately.
*/
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
/**
* Retrieves the date/time at which the account this flag references will stop having a disabled status.
* This can be null if the disabled status is to continue until manually disabled.
*
* @return The Date when the disabled status will end, or null for "forever".
*/
public Date getEndTime() {
return endTime;
}
/**
* Sets the end time for when the account will be reenabled, or null if manual reenable required.
*
* @param endTime Date when the disabled status will end, or null for forever.
*/
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public int getCachedSize() {
// Approximate the size of the object in bytes by calculating the size
// of each field.
int size = 0;
size += CacheSizes.sizeOfObject(); // overhead of object
size += CacheSizes.sizeOfString(username);
size += CacheSizes.sizeOfDate();
size += CacheSizes.sizeOfDate();
return size;
}
public void writeExternal(ObjectOutput out) throws IOException {
ExternalizableUtil.getInstance().writeSafeUTF(out, username);
ExternalizableUtil.getInstance().writeLong(out, startTime != null ? startTime.getTime() : -1);
ExternalizableUtil.getInstance().writeLong(out, endTime != null ? endTime.getTime() : -1);
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
username = ExternalizableUtil.getInstance().readSafeUTF(in);
long st = ExternalizableUtil.getInstance().readLong(in);
startTime = st != -1 ? new Date(st) : null;
long et = ExternalizableUtil.getInstance().readLong(in);
endTime = et != -1 ? new Date(et) : null;
}
}
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.lockout;
import org.jivesoftware.util.*;
import org.jivesoftware.util.cache.Cache;
import org.jivesoftware.util.cache.CacheFactory;
import java.util.Map;
import java.util.Date;
/**
* @author Daniel Henninger
*/
public class LockOutManager {
// Wrap this guy up so we can mock out the UserManager class.
private static final class LockOutManagerContainer {
private static final LockOutManager instance = new LockOutManager();
}
/**
* Returns the currently-installed LockOutProvider. <b>Warning:</b> in virtually all
* cases the lockout provider should not be used directly. Instead, the appropriate
* methods in LockOutManager should be called. Direct access to the lockout provider is
* only provided for special-case logic.
*
* @return the current LockOutProvider.
*/
public static LockOutProvider getLockOutProvider() {
return provider;
}
/**
* Returns a singleton instance of LockOutManager.
*
* @return a LockOutManager instance.
*/
public static LockOutManager getInstance() {
return LockOutManagerContainer.instance;
}
/* Cache of locked out accounts */
private Cache<String,LockOutFlag> lockOutCache;
private static LockOutProvider provider = null;
private LockOutManager() {
// Initialize the lockout cache.
lockOutCache = CacheFactory.createCache("Locked Out Accounts");
// Load an lockout provider.
initProvider();
// Detect when a new lockout provider class is set
PropertyEventListener propListener = new PropertyEventListener() {
public void propertySet(String property, Map params) {
//Ignore
}
public void propertyDeleted(String property, Map params) {
//Ignore
}
public void xmlPropertySet(String property, Map params) {
if ("provider.lockout.className".equals(property)) {
initProvider();
}
}
public void xmlPropertyDeleted(String property, Map params) {
//Ignore
}
};
PropertyEventDispatcher.addListener(propListener);
}
private static void initProvider() {
String className = JiveGlobals.getXMLProperty("provider.lockout.className",
"org.jivesoftware.openfire.lockout.DefaultLockOutProvider");
// Check if we need to reset the provider class
if (provider == null || !className.equals(provider.getClass().getName())) {
try {
Class c = ClassUtils.forName(className);
provider = (LockOutProvider) c.newInstance();
}
catch (Exception e) {
Log.error("Error loading lockout provider: " + className, e);
provider = new DefaultLockOutProvider();
}
}
}
/**
* Returns a LockOutFlag for a given username, which contains information about the time
* period that the specified account is going to be disabled.
*
* @param username Username of account to request status of.
* @return The LockOutFlag instance describing the accounts disabled status.
* @throws NotLockedOutException if user account specified is not currently locked out (disabled).
*/
public LockOutFlag getDisabledStatus(String username) throws NotLockedOutException {
LockOutFlag flag = lockOutCache.get(username);
// If ID wan't found in cache, load it up and put it there.
if (flag == null) {
synchronized (username.intern()) {
flag = lockOutCache.get(username);
// If group wan't found in cache, load it up and put it there.
if (flag == null) {
flag = provider.getDisabledStatus(username);
lockOutCache.put(username, flag);
}
}
}
return flag;
}
/**
* Returns true or false if an account is currently locked out.
*
* @param username Username of account to check on.
* @return True or false if the account is currently locked out.
*/
public boolean isAccountDisabled(String username) {
try {
LockOutFlag flag = getDisabledStatus(username);
if (flag == null) {
return false;
}
Date curDate = new Date();
if (flag.getStartTime() != null && curDate.before(flag.getStartTime())) {
return false;
}
if (flag.getEndTime() != null && curDate.after(flag.getEndTime())) {
return false;
}
return true;
}
catch (NotLockedOutException e) {
return false;
}
}
/**
* Sets an account to disabled, starting at an optional time and ending at an optional time.
* If either times are set to null, the lockout is considered "forever" in that direction.
* For example, if you had a start time of 2 hours from now, and a null end time, then the account
* would be locked out in two hours, and never unlocked until someone manually unlcoked the account.
*
* @param username User whose account will be disabled.
* @param startTime When to start the lockout, or null if immediately.
* @param endTime When to end the lockout, or null if forever.
* @throws UnsupportedOperationException if the provider is readonly.
*/
public void disableAccount(String username, Date startTime, Date endTime) throws UnsupportedOperationException {
if (provider.isReadOnly()) {
throw new UnsupportedOperationException();
}
LockOutFlag flag = new LockOutFlag(username, startTime, endTime);
provider.setDisabledStatus(flag);
// Add lockout data to cache.
lockOutCache.put(username, flag);
// Fire event.
LockOutEventDispatcher.accountLocked(flag);
}
/**
* Enables an account that may or may not have previously been disabled. This erases any
* knowledge of a lockout, including one that wasn't necessarily in effect at the time the
* method was called.
*
* @param username User to enable.
* @throws UnsupportedOperationException if the provider is readonly.
*/
public void enableAccount(String username) throws UnsupportedOperationException {
if (provider.isReadOnly()) {
throw new UnsupportedOperationException();
}
provider.unsetDisabledStatus(username);
// Remove lockout data from cache.
lockOutCache.remove(username);
// Fire event.
LockOutEventDispatcher.accountUnlocked(username);
}
/**
* "Records" (notifies all listeners) that a failed login occurred.
*
* @param username Locked out user that attempted to login.
*/
public void recordFailedLogin(String username) {
// Fire event.
LockOutEventDispatcher.lockedAccountDenied(username);
}
}
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.lockout;
/**
* A LockOutProvider handles storage of information about disabled accounts, and requests for
* whether an account is currently disabled. If set read-only, only requests for disabled
* status are expected to work.
*
* @author Daniel Henninger
*/
public interface LockOutProvider {
/**
* Returns a LockOutFlag for a given username, which contains information about the time
* period that the specified account is going to be disabled.
*
* @param username Username of account to request status of.
* @return The LockOutFlag instance describing the accounts disabled status.
* @throws NotLockedOutException if user account specified is not currently locked out (disabled).
*/
public LockOutFlag getDisabledStatus(String username) throws NotLockedOutException;
/**
* Sets the locked out (disabled) status of an account according to a LockOutFlag.
*
* @param flag A LockOutFlag instance to describe the disabled status of a user.
*/
public void setDisabledStatus(LockOutFlag flag);
/**
* Unsets the locked out (disabled) status of an account, thereby enabling it/cancelling the disable.
*
* @param username User to enable.
*/
public void unsetDisabledStatus(String username);
/**
* Returns true if this LockOutProvider is read-only. When read-only,
* disabled status of accounts can not be changed via Openfire.
*
* @return true if the lock out provider is read-only.
*/
public boolean isReadOnly();
}
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2008 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.lockout;
/**
* Thrown if a username is queried for lockout status that is not locked out.
*
* @author Daniel Henninger
*/
public class NotLockedOutException extends Exception {
public NotLockedOutException() {
super();
}
public NotLockedOutException(String message) {
super(message);
}
public NotLockedOutException(Throwable cause) {
super(cause);
}
public NotLockedOutException(String message, Throwable cause) {
super(message, cause);
}
}
\ No newline at end of file
......@@ -17,6 +17,7 @@ import org.dom4j.Namespace;
import org.dom4j.QName;
import org.jivesoftware.openfire.Connection;
import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.lockout.LockOutManager;
import org.jivesoftware.openfire.auth.AuthFactory;
import org.jivesoftware.openfire.auth.AuthToken;
import org.jivesoftware.openfire.auth.AuthorizationManager;
......@@ -551,6 +552,12 @@ public class SASLAuthentication {
private static void authenticationSuccessful(LocalSession session, String username,
byte[] successData) {
if (LockOutManager.getInstance().isAccountDisabled(username)) {
// Interception! This person is locked out, fail instead!
LockOutManager.getInstance().recordFailedLogin(username);
authenticationFailed(session);
return;
}
StringBuilder reply = new StringBuilder(80);
reply.append("<success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"");
if (successData != null) {
......
......@@ -12,6 +12,7 @@
package org.jivesoftware.util;
import org.jivesoftware.openfire.*;
import org.jivesoftware.openfire.lockout.LockOutManager;
import org.jivesoftware.openfire.auth.AuthToken;
import org.jivesoftware.openfire.group.GroupManager;
import org.jivesoftware.openfire.muc.MultiUserChatServer;
......@@ -73,6 +74,10 @@ public class WebManager extends WebBean {
return GroupManager.getInstance();
}
public LockOutManager getLockOutManager() {
return LockOutManager.getInstance();
}
public RosterManager getRosterManager() {
return getXMPPServer().getRosterManager();
}
......
......@@ -83,6 +83,7 @@ public class CacheFactory {
cacheNames.put("Remote Users Existence", "remoteUsersCache");
cacheNames.put("Roster", "username2roster");
cacheNames.put("User", "userCache");
cacheNames.put("Locked Out Accounts", "lockOutCache");
cacheNames.put("VCard", "vcardCache");
cacheNames.put("File Transfer Cache", "fileTransfer");
cacheNames.put("File Transfer", "transferProxy");
......@@ -119,6 +120,8 @@ public class CacheFactory {
cacheProps.put("cache.transferProxy.maxLifetime", 1000 * 60 * 10l);
cacheProps.put("cache.group.size", 1024 * 1024l);
cacheProps.put("cache.group.maxLifetime", JiveConstants.MINUTE * 15);
cacheProps.put("cache.lockOutCache.size", 1024 * 1024l);
cacheProps.put("cache.lockOutCache.maxLifetime", JiveConstants.MINUTE * 15);
cacheProps.put("cache.groupMeta.size", 512 * 1024l);
cacheProps.put("cache.groupMeta.maxLifetime", JiveConstants.MINUTE * 15);
cacheProps.put("cache.javascript.size", 128 * 1024l);
......
......@@ -178,6 +178,11 @@
url="user-password.jsp"
description="${sidebar.user-password.descr}"/>
<!-- Lock Out -->
<item id="user-lockout" name="${sidebar.user-lockout}"
url="user-lockout.jsp"
description="${sidebar.user-lockout.descr}"/>
<!-- Delete User -->
<item id="user-delete" name="${sidebar.user-delete}"
url="user-delete.jsp"
......
<%--
- $Revision$
- $Date$
-
- Copyright (C) 2008 Jive Software. All rights reserved.
-
- This software is published under the terms of the GNU Public License (GPL),
- a copy of which is included in this distribution.
--%>
<%@ page import="org.jivesoftware.openfire.session.ClientSession"
errorPage="error.jsp"
%>
<%@ page import="org.jivesoftware.util.ParamUtils" %>
<%@ page import="org.xmpp.packet.JID" %>
<%@ page import="org.xmpp.packet.StreamError" %>
<%@ page import="java.net.URLEncoder" %>
<%@ page import="java.util.Date" %>
<%@ page import="org.jivesoftware.openfire.lockout.LockOutManager" %>
<%@ page import="org.jivesoftware.openfire.lockout.LockOutFlag" %>
<%@ page import="org.jivesoftware.openfire.lockout.NotLockedOutException" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<% webManager.init(request, response, session, application, out ); %>
<% // Get parameters //
boolean cancel = request.getParameter("cancel") != null;
boolean unlock = request.getParameter("unlock") != null;
boolean lock = request.getParameter("lock") != null;
String username = ParamUtils.getParameter(request,"username");
Integer startdelay = ParamUtils.getIntParameter(request,"startdelay",-1); // -1 is immediate, -2 custom
Integer duration = ParamUtils.getIntParameter(request,"duration",-1); // -1 is infinite, -2 custom
if (startdelay == -2) {
startdelay = ParamUtils.getIntParameter(request,"startdelay_custom", -1);
}
if (duration == -2) {
duration = ParamUtils.getIntParameter(request,"duration_custom", -1);
}
// Handle a cancel
if (cancel) {
response.sendRedirect("user-properties.jsp?username=" + URLEncoder.encode(username, "UTF-8"));
return;
}
// Handle a user lockout:
if (lock) {
Date startTime = null;
if (startdelay != -1) {
startTime = new Date(new Date().getTime() + startdelay*60000);
}
Date endTime = null;
if (duration != -1) {
if (startTime != null) {
endTime = new Date(startTime.getTime() + duration*60000);
}
else {
endTime = new Date(new Date().getTime() + duration*60000);
}
}
// Lock out the user
webManager.getLockOutManager().disableAccount(username, startTime, endTime);
// Close the user's connection if the lockout is immedate
if (webManager.getLockOutManager().isAccountDisabled(username)) {
final StreamError error = new StreamError(StreamError.Condition.not_authorized);
for (ClientSession sess : webManager.getSessionManager().getSessions(username) )
{
sess.deliverRawText(error.toXML());
sess.close();
}
// Disabled your own user account, force login
if (username.equals(webManager.getAuthToken().getUsername())){
session.removeAttribute("jive.admin.authToken");
response.sendRedirect("login.jsp");
return;
}
}
// Done, so redirect
response.sendRedirect("user-properties.jsp?username=" + URLEncoder.encode(username, "UTF-8") + "&locksuccess=1");
return;
}
// Handle a user unlock:
if (unlock) {
// Unlock the user's account
webManager.getLockOutManager().enableAccount(username);
// Done, so redirect
response.sendRedirect("user-properties.jsp?username=" + URLEncoder.encode(username, "UTF-8") + "&unlocksuccess=1");
return;
}
%>
<html>
<head>
<title><fmt:message key="user.lockout.title"/></title>
<meta name="subPageID" content="user-lockout"/>
<meta name="extraParams" content="<%= "username="+URLEncoder.encode(username, "UTF-8") %>"/>
</head>
<body>
<% if (LockOutManager.getLockOutProvider().isReadOnly()) { %>
<div class="error">
<fmt:message key="user.read_only"/>
</div>
<% } %>
<%
try {
LockOutFlag flag = LockOutManager.getInstance().getDisabledStatus(username);
%>
<p>
<fmt:message key="user.lockout.locked">
<fmt:param value="<%= "<b><a href='user-properties.jsp?username="+URLEncoder.encode(username, "UTF-8")+"'>"+JID.unescapeNode(username)+"</a></b>" %>"/>
</fmt:message>
<% if (flag.getStartTime() != null) { %><fmt:message key="user.lockout.locked2"><fmt:param value="<%= flag.getStartTime().toString() %>"/></fmt:message> <% } %>
<% if (flag.getStartTime() != null && flag.getEndTime() != null) { %> <fmt:message key="user.lockout.lockedand" /> <% } %>
<% if (flag.getEndTime() != null) { %><fmt:message key="user.lockout.locked3"><fmt:param value="<%= flag.getEndTime().toString() %>"/></fmt:message> <% } %>
</p>
<form action="user-lockout.jsp">
<input type="hidden" name="username" value="<%= username %>">
<input type="submit" name="unlock" value="<fmt:message key="user.lockout.unlock" />">
<input type="submit" name="cancel" value="<fmt:message key="global.cancel" />">
</form>
<%
}
catch (NotLockedOutException e) {
%>
<p>
<fmt:message key="user.lockout.info" />
<b><a href="user-properties.jsp?username=<%= URLEncoder.encode(username, "UTF-8") %>"><%= JID.unescapeNode(username) %></a></b>
<fmt:message key="user.lockout.info1" />
</p>
<c:if test="${admin.user.username == param.username}">
<p class="jive-warning-text">
<fmt:message key="user.lockout.warning" /> <b><fmt:message key="user.lockout.warning2" /></b> <fmt:message key="user.lockout.warning3" />
</p>
</c:if>
<form action="user-lockout.jsp">
<b><fmt:message key="user.lockout.time.startdelay" /></b><br />
<input type="radio" name="startdelay" value="-1" checked="checked" /> <fmt:message key="user.lockout.time.immediate" /><br />
<input type="radio" name="startdelay" value="60" /> <fmt:message key="user.lockout.time.in" /> <fmt:message key="user.lockout.time.1hour" /><br />
<input type="radio" name="startdelay" value="1440" /> <fmt:message key="user.lockout.time.in" /> <fmt:message key="user.lockout.time.1day" /><br />
<input type="radio" name="startdelay" value="10080" /> <fmt:message key="user.lockout.time.in" /> <fmt:message key="user.lockout.time.1week" /><br />
<input type="radio" name="startdelay" value="-2" /> <fmt:message key="user.lockout.time.in" /> <input type="text" size="5" maxlength="10" name="starydelay_custom" /> <fmt:message key="user.lockout.time.minutes"/><br />
<br />
<b><fmt:message key="user.lockout.time.duration" /></b><br />
<input type="radio" name="duration" value="-1" checked="checked" /> <fmt:message key="user.lockout.time.forever" /><br />
<input type="radio" name="duration" value="60" /> <fmt:message key="user.lockout.time.for" /> <fmt:message key="user.lockout.time.1hour" /><br />
<input type="radio" name="duration" value="1440" /> <fmt:message key="user.lockout.time.for" /> <fmt:message key="user.lockout.time.1day" /><br />
<input type="radio" name="duration" value="10080" /> <fmt:message key="user.lockout.time.for" /> <fmt:message key="user.lockout.time.1week" /><br />
<input type="radio" name="duration" value="-2" /> <fmt:message key="user.lockout.time.for" /> <input type="text" size="5" maxlength="10" name="duration_custom" /> <fmt:message key="user.lockout.time.minutes"/><br />
<br />
<input type="hidden" name="username" value="<%= username %>">
<input type="submit" name="lock" value="<fmt:message key="user.lockout.lock" />">
<input type="submit" name="cancel" value="<fmt:message key="global.cancel" />">
</form>
<%
}
%>
<% // Disable the form if a read-only user provider.
if (LockOutManager.getLockOutProvider().isReadOnly()) { %>
<script language="Javascript" type="text/javascript">
function disable() {
var limit = document.forms[0].elements.length;
for (i=0;i<limit;i++) {
document.forms[0].elements[i].disabled = true;
}
}
disable();
</script>
<% } %>
</body>
</html>
......@@ -19,8 +19,8 @@
<%@ page import="org.xmpp.packet.Presence"%>
<%@ page import="java.net.URLEncoder"%>
<%@ page import="java.util.Collection"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="org.jivesoftware.openfire.user.UserManager"%><%@ page import="org.xmpp.packet.JID"%>
<%@ page import="org.jivesoftware.openfire.lockout.NotLockedOutException" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
......@@ -29,7 +29,6 @@
<% // Get parameters //
boolean cancel = request.getParameter("cancel") != null;
boolean delete = request.getParameter("delete") != null;
boolean email = request.getParameter("email") != null;
boolean password = request.getParameter("password") != null;
String username = ParamUtils.getParameter(request,"username");
......@@ -60,6 +59,20 @@
}
PresenceManager presenceManager = webManager.getPresenceManager();
Boolean lockedOut = false;
Boolean pendingLockOut = false;
try {
webManager.getLockOutManager().getDisabledStatus(username);
if (webManager.getLockOutManager().isAccountDisabled(username)) {
lockedOut = true;
}
else {
pendingLockOut = true;
}
}
catch (NotLockedOutException e) {
// Nothing, we're good.
}
%>
<html>
......@@ -80,7 +93,7 @@
<div class="jive-success">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0" alt=""></td>
<td class="jive-icon-label">
<fmt:message key="user.properties.created" />
</td></tr>
......@@ -88,12 +101,38 @@
</table>
</div><br>
<% } else if (request.getParameter("locksuccess") != null) { %>
<div class="jive-success">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0" alt=""></td>
<td class="jive-icon-label">
<fmt:message key="user.properties.locksuccess" />
</td></tr>
</tbody>
</table>
</div><br>
<% } else if (request.getParameter("unlocksuccess") != null) { %>
<div class="jive-success">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0" alt=""></td>
<td class="jive-icon-label">
<fmt:message key="user.properties.unlocksuccess" />
</td></tr>
</tbody>
</table>
</div><br>
<% } else if (request.getParameter("editsuccess") != null) { %>
<div class="jive-success">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0" alt=""></td>
<td class="jive-icon-label">
<fmt:message key="user.properties.update" />
</td></tr>
......@@ -139,6 +178,8 @@
</td>
<td>
<%= JID.unescapeNode(user.getUsername()) %>
<% if (lockedOut) { %><img src="/images/forbidden-16x16.gif" align="top" height="16" width="16" alt="<fmt:message key='user.properties.locked'/>" title="<fmt:message key='user.properties.locked'/>"/><% } %>
<% if (pendingLockOut) { %><img src="/images/warning-16x16.gif" align="top" height="16" width="16" alt="<fmt:message key='user.properties.locked_set'/>" title="<fmt:message key='user.properties.locked_set'/>"/><% } %>
</td>
</tr>
<tr>
......@@ -220,7 +261,7 @@
</td>
<td>
<%
Collection groups = webManager.getGroupManager().getGroups(user);
Collection<Group> groups = webManager.getGroupManager().getGroups(user);
if (groups.isEmpty()) {
%>
<i>None</i>
......@@ -228,13 +269,12 @@
}
else {
int count = 0;
for (Iterator it=groups.iterator();it.hasNext();) {
Group group = (Group) it.next();
for (Group group : groups) {
if (count != 0) {
out.print(", ");
}
out.print(group.getName());
count ++;
count++;
}
}
%>
......
......@@ -20,6 +20,7 @@
<%@ page import="org.xmpp.packet.Presence" %>
<%@ page import="java.net.URLEncoder" %>
<%@ page import="java.util.Collection" %>
<%@ page import="org.jivesoftware.openfire.lockout.NotLockedOutException" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
......@@ -71,7 +72,7 @@
<div class="jive-success">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0" alt=""></td>
<td class="jive-icon-label">
<fmt:message key="user.summary.deleted" />
</td></tr>
......@@ -96,12 +97,13 @@
-- <fmt:message key="user.summary.users_per_page" />:
<select size="1" onchange="location.href='user-summary.jsp?start=0&range=' + this.options[this.selectedIndex].value;">
<% for (int i=0; i<RANGE_PRESETS.length; i++) { %>
<% for (int aRANGE_PRESETS : RANGE_PRESETS) { %>
<option value="<%= RANGE_PRESETS[i] %>"
<%= (RANGE_PRESETS[i] == range ? "selected" : "") %>><%= RANGE_PRESETS[i] %></option>
<option value="<%= aRANGE_PRESETS %>"
<%= (aRANGE_PRESETS == range ? "selected" : "") %>><%= aRANGE_PRESETS %>
</option>
<% } %>
<% } %>
</select>
</p>
......@@ -125,7 +127,7 @@
<%
}
int i = 0;
int i;
for (i=s; i<numPages && i<num; i++) {
String sep = ((i+1)<numPages) ? " " : "";
boolean isCurrent = (i+1) == curPage;
......@@ -182,6 +184,20 @@
int i = start;
for (User user : users) {
i++;
Boolean lockedOut = false;
Boolean pendingLockOut = false;
try {
webManager.getLockOutManager().getDisabledStatus(user.getUsername());
if (webManager.getLockOutManager().isAccountDisabled(user.getUsername())) {
lockedOut = true;
}
else {
pendingLockOut = true;
}
}
catch (NotLockedOutException e) {
// Nothing, we're good.
}
%>
<tr class="jive-<%= (((i%2)==0) ? "even" : "odd") %>">
<td width="1%">
......@@ -215,6 +231,8 @@
</td>
<td width="23%">
<a href="user-properties.jsp?username=<%= URLEncoder.encode(user.getUsername(), "UTF-8") %>"><%= JID.unescapeNode(user.getUsername()) %></a>
<% if (lockedOut) { %><img src="/images/forbidden-16x16.gif" height="16" width="16" align="top" alt="<fmt:message key='user.properties.locked'/>" title="<fmt:message key='user.properties.locked'/>"/><% } %>
<% if (pendingLockOut) { %><img src="/images/warning-16x16.gif" height="16" width="16" align="top" alt="<fmt:message key='user.properties.locked_set'/>" title="<fmt:message key='user.properties.locked_set'/>"/><% } %>
</td>
<td width="33%">
<%= user.getName() %> &nbsp;
......@@ -272,7 +290,6 @@
<%
}
i = 0;
for (i=s; i<numPages && i<num; i++) {
String sep = ((i+1)<numPages) ? " " : "";
boolean isCurrent = (i+1) == curPage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment