Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OF-1838 XEP-0157: Improve support #1468

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion distribution/src/database/openfire_db2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ CREATE INDEX ofUserFlag_sTime_idx ON ofUserFlag (startTime ASC);
CREATE INDEX ofUserFlag_eTime_idx ON ofUserFlag (endTime ASC);


CREATE TABLE ofUserContactAddress (
cID INTEGER NOT NULL,
cType VARCHAR(20) NOT NULL,
cAddressType VARCHAR(20) NOT NULL,
cAddress VARCHAR(100) NOT NULL,
cDesciption VARCHAR(3000),
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);


CREATE TABLE ofOffline (
username VARCHAR(64) NOT NULL,
messageID INTEGER NOT NULL,
Expand Down Expand Up @@ -386,7 +396,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 30);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 31);

-- Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
12 changes: 11 additions & 1 deletion distribution/src/database/openfire_hsqldb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ CREATE INDEX ofUserFlag_sTime_idx ON ofUserFlag (startTime);
CREATE INDEX ofUserFlag_eTime_idx ON ofUserFlag (endTime);


CREATE TABLE ofUserContactAddress (
cID BIGINT NOT NULL,
cType VARCHAR(20) NOT NULL,
cAddressType VARCHAR(20) NOT NULL,
cAddress VARCHAR(100) NOT NULL,
cDesciption VARCHAR(3000) ,
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);


CREATE TABLE ofOffline (
username VARCHAR(64) NOT NULL,
messageID BIGINT NOT NULL,
Expand Down Expand Up @@ -372,7 +382,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 30);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 31);

// Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
11 changes: 10 additions & 1 deletion distribution/src/database/openfire_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ CREATE TABLE ofUserFlag (
INDEX ofUserFlag_eTime_idx (endTime)
);

CREATE TABLE ofUserContactAddress (
cID BIGINT NOT NULL,
cType VARCHAR(20) NOT NULL,
cAddressType VARCHAR(20) NOT NULL,
cAddress VARCHAR(100) NOT NULL,
cDesciption VARCHAR(3000) NOT NULL,
PRIMARY KEY (cID)
);

CREATE TABLE ofOffline (
username VARCHAR(64) NOT NULL,
messageID BIGINT NOT NULL,
Expand Down Expand Up @@ -362,7 +371,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 30);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 31);

# Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
10 changes: 9 additions & 1 deletion distribution/src/database/openfire_oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ CREATE TABLE ofUserFlag (
CREATE INDEX ofUserFlag_sTime_idx ON ofUserFlag (startTime ASC);
CREATE INDEX ofUserFlag_eTime_idx ON ofUserFlag (endTime ASC);

CREATE TABLE ofUserContactAddress (
cID INTEGER NOT NULL,
cType VARCHAR(20) NOT NULL,
cAddressType VARCHAR(20) NOT NULL,
cAddress VARCHAR(100) NOT NULL,
cDesciption VARCHAR(3000) ,
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);

CREATE TABLE ofOffline (
username VARCHAR2(64) NOT NULL,
Expand Down Expand Up @@ -370,7 +378,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 30);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 31);

-- Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
13 changes: 12 additions & 1 deletion distribution/src/database/openfire_postgresql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ CREATE INDEX ofUserFlag_sTime_idx ON ofUserFlag (startTime);
CREATE INDEX ofUserFlag_eTime_idx ON ofUserFlag (endTime);


CREATE TABLE ofUserContactAddress (
cID INTEGER NOT NULL,
cType VARCHAR(20) NOT NULL,
cAddressType VARCHAR(20) NOT NULL,
cAddress VARCHAR(100) NOT NULL,
cDesciption VARCHAR(3000) ,
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);



CREATE TABLE ofOffline (
username VARCHAR(64) NOT NULL,
messageID INTEGER NOT NULL,
Expand Down Expand Up @@ -378,7 +389,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 30);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 31);

-- Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
13 changes: 12 additions & 1 deletion distribution/src/database/openfire_sqlserver.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ CREATE INDEX ofUserFlag_sTime_idx ON ofUserFlag (startTime ASC);
CREATE INDEX ofUserFlag_eTime_idx ON ofUserFlag (endTime ASC);


CREATE TABLE ofUserContactAddress (
cID INTEGER NOT NULL,
cType NVARCHAR(20) NOT NULL,
cAddressType NVARCHAR(20) NOT NULL,
cAddress NVARCHAR(100) NOT NULL,
cDesciption NVARCHAR(3000) ,
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);



CREATE TABLE ofOffline (
username NVARCHAR(64) NOT NULL,
messageID INTEGER NOT NULL,
Expand Down Expand Up @@ -375,7 +386,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);

INSERT INTO ofVersion (name, version) VALUES ('openfire', 30);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 31);

/* Entry for admin user */
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
12 changes: 11 additions & 1 deletion distribution/src/database/openfire_sybase.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ CREATE INDEX ofUserFlag_sTime_idx ON ofUserFlag (startTime ASC)
CREATE INDEX ofUserFlag_eTime_idx ON ofUserFlag (endTime ASC)


CREATE TABLE ofUserContactAddress (
cID INTEGER NOT NULL,
cType NVARCHAR(20) NOT NULL,
cAddressType NVARCHAR(20) NOT NULL,
cAddress NVARCHAR(100) NOT NULL,
cDesciption NVARCHAR(3000) ,
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);


CREATE TABLE ofOffline (
username NVARCHAR(64) NOT NULL,
messageID INTEGER NOT NULL,
Expand Down Expand Up @@ -375,7 +385,7 @@ INSERT INTO ofID (idType, id) VALUES (23, 1)
INSERT INTO ofID (idType, id) VALUES (26, 2)
INSERT INTO ofID (idType, id) VALUES (27, 1)

INSERT INTO ofVersion (name, version) VALUES ('openfire', 30)
INSERT INTO ofVersion (name, version) VALUES ('openfire', 31)

/* Entry for admin user */
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand Down
10 changes: 10 additions & 0 deletions distribution/src/database/upgrade/31/openfire_db2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE ofUserContactAddress (
cID INTEGER NOT NULL,
cType VARCHAR(20) NOT NULL,
cAddressType VARCHAR(20) NOT NULL,
cAddress VARCHAR(100) NOT NULL,
cDesciption VARCHAR(3000),
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);

UPDATE ofVersion SET version = 31 WHERE name = 'openfire';
10 changes: 10 additions & 0 deletions distribution/src/database/upgrade/31/openfire_hsqldb.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE ofUserContactAddress (
cID BIGINT NOT NULL,
cType VARCHAR(20) NOT NULL,
cAddressType VARCHAR(20) NOT NULL,
cAddress VARCHAR(100) NOT NULL,
cDesciption VARCHAR(3000) ,
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);

UPDATE ofVersion SET version = 31 WHERE name = 'openfire';
10 changes: 10 additions & 0 deletions distribution/src/database/upgrade/31/openfire_mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE ofUserContactAddress (
cID BIGINT NOT NULL,
cType VARCHAR(20) NOT NULL,
cAddressType VARCHAR(20) NOT NULL,
cAddress VARCHAR(100) NOT NULL,
cDesciption VARCHAR(3000) NOT NULL,
PRIMARY KEY (cID)
);

UPDATE ofVersion SET version = 31 WHERE name = 'openfire';
12 changes: 12 additions & 0 deletions distribution/src/database/upgrade/31/openfire_oracle.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE ofUserContactAddress (
cID INTEGER NOT NULL,
cType VARCHAR(20) NOT NULL,
cAddressType VARCHAR(20) NOT NULL,
cAddress VARCHAR(100) NOT NULL,
cDesciption VARCHAR(3000) ,
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);

UPDATE ofVersion SET version = 31 WHERE name = 'openfire';

commit;
10 changes: 10 additions & 0 deletions distribution/src/database/upgrade/31/openfire_postgresql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE ofUserContactAddress (
cID INTEGER NOT NULL,
cType VARCHAR(20) NOT NULL,
cAddressType VARCHAR(20) NOT NULL,
cAddress VARCHAR(100) NOT NULL,
cDesciption VARCHAR(3000) ,
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);

UPDATE ofVersion SET version = 31 WHERE name = 'openfire';
10 changes: 10 additions & 0 deletions distribution/src/database/upgrade/31/openfire_sqlserver.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE ofUserContactAddress (
cID INTEGER NOT NULL,
cType NVARCHAR(20) NOT NULL,
cAddressType NVARCHAR(20) NOT NULL,
cAddress NVARCHAR(100) NOT NULL,
cDesciption NVARCHAR(3000) ,
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);

UPDATE ofVersion SET version = 31 WHERE name = 'openfire';
10 changes: 10 additions & 0 deletions distribution/src/database/upgrade/31/openfire_sybase.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE ofUserContactAddress (
cID INTEGER NOT NULL,
cType NVARCHAR(20) NOT NULL,
cAddressType NVARCHAR(20) NOT NULL,
cAddress NVARCHAR(100) NOT NULL,
cDesciption NVARCHAR(3000) ,
CONSTRAINT ofContact_pk PRIMARY KEY (cID)
);

UPDATE ofVersion SET version = 31 WHERE name = 'openfire'
28 changes: 28 additions & 0 deletions i18n/src/main/resources/openfire_i18n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,8 @@ tab.tab-users.descr=Click to manage users and groups
sidebar.user-create.descr=Click to add a new user to the system
sidebar.user-search=User Search
sidebar.user-search.descr=Click to search for a particular user
sidebar.user-contact-addresses=Contact Addresses
sidebar.user-contact-addresses.descr=Click to manage contact addresses
sidebar.sidebar-groups=Groups
sidebar.group-summary=Group Summary
sidebar.group-summary.descr=Click to see a list of groups in the system
Expand Down Expand Up @@ -2809,6 +2811,32 @@ user.groups.member.info=Below is a list of groups for user
user.groups.name=Group Name
user.groups.form.update=User groups edited successfully.


# User Contact Adresses Page

user.contact_addresses.title=Contact Addresses
user.contact_addresses.info=Below is a list of the contact adresses.click the edit icon next to the contact to edit.
user.contact_addresses.info_create=Use the form below to create a new contact address.
user.contact_addresses.contact_type=Contact Type
user.contact_addresses.address_type=Address Type
user.contact_addresses.address_value=Address Value
user.contact_addresses.description=Description
user.contact_addresses.edit=Edit
user.contact_addresses.search_all=All
user.contact_addresses.search_admin=Admin
user.contact_addresses.search_abuse=Abuse
user.contact_addresses.search_feedback=Feedback
user.contact_addresses.search_sales=Sales
user.contact_addresses.search_security=Security
user.contact_addresses.search_support=Support
user.contact_addresses.search_xmpp=xmpp
user.contact_addresses.search_mail=mail
user.contact_addresses.search_url=url
user.contact_addresses.edit_contact_title=Edit contact
user.contact_addresses.new_contact=Add new contact



# PubSub Admin page

pubsub.node.summary.title=PubSub Nodes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package org.jivesoftware.admin.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jivesoftware.util.ParamUtils;

@SuppressWarnings("serial")
public class UserContactAddressesServlet extends HttpServlet {

private static final String[] SEARCH_FIELDS = {"searchContactType", "searchAddressType", "searchValue", "searchDescription"};

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.getRequestDispatcher("user-contact-addresses.jsp").forward(request, response);
}


/**
* Represents the contact addresses being searched for
*/
public static final class Search {

private final String contactType;
private final String addressType;
private final String value;
private final String description;


public Search(final HttpServletRequest request) {
this.contactType = ParamUtils.getStringParameter(request, "searchContactType", "").trim();
this.addressType= ParamUtils.getStringParameter(request, "searchAddressType", "").trim();
this.value = ParamUtils.getStringParameter(request, "searchValue", "").trim();
this.description = ParamUtils.getStringParameter(request, "searchDescription", "").trim();
}

public String getContactType() {
return contactType;
}

public String getaddressType() {
return addressType;
}

public String getValue() {
return value;
}

public String getDescription() {
return description;
}
}
}
5 changes: 5 additions & 0 deletions xmppserver/src/main/resources/admin-sidebar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,11 @@
<item id="user-search" name="${sidebar.user-search}"
url="user-search.jsp"
description="${sidebar.user-search.descr}"/>

<!-- User Contact Adresses -->
<item id="user-contact-addresses" name="${sidebar.user-contact-addresses}"
url="user-contact.jsp"
description="${sidebar.user-contact-addresses.descr}"/>
</sidebar>

<!-- Groups -->
Expand Down
Loading