Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
10d14c5c
Commit
10d14c5c
authored
Nov 06, 2014
by
Roman S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-250: Allow to configure the groups of a user from the user profile
parent
127e53e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
207 additions
and
0 deletions
+207
-0
openfire_i18n_en.properties
src/i18n/openfire_i18n_en.properties
+19
-0
admin-sidebar.xml
src/resources/jar/admin-sidebar.xml
+5
-0
user-groups.jsp
src/web/user-groups.jsp
+183
-0
No files found.
src/i18n/openfire_i18n_en.properties
View file @
10d14c5c
...
...
@@ -538,6 +538,13 @@
##
## 3.10.0
## Added key: 'user.properties.additional_propertie'
## Added key: 'user.groups.title'
## Added key: 'user.groups.info'
## Added key: 'user.groups.name'
## Added key: 'user.groups.none'
## Added key: 'user.groups.member'
## Added key: 'user.groups.admin'
## Added key: 'user.groups.form.update'
# Openfire
...
...
@@ -615,6 +622,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-groups
=
User Groups
sidebar.user-groups.descr
=
Click to change user groups
sidebar.user-lockout
=
Lock Out
sidebar.user-lockout.descr
=
Click to lock out or unlock the user's account
sidebar.user-delete
=
Delete User
...
...
@@ -2555,6 +2564,16 @@ user.lockout.time.in=in
user.lockout.time.for
=
for
user.lockout.time.minutes
=
minutes
# User Groups page
user.groups.title
=
User Groups
user.groups.info
=
Below is a list of groups available for the user
user.groups.name
=
Group Name
user.groups.none
=
None
user.groups.member
=
Member
user.groups.admin
=
Admin
user.groups.form.update
=
User groups edited successfully.
# Plugins Admin Page
plugin.admin.title
=
Plugins
...
...
src/resources/jar/admin-sidebar.xml
View file @
10d14c5c
...
...
@@ -177,6 +177,11 @@
<item
id=
"user-roster"
name=
"${sidebar.user-roster}"
url=
"user-roster.jsp"
description=
"${sidebar.user-roster.descr}"
/>
<!-- User Groups -->
<item
id=
"user-groups"
name=
"${sidebar.user-groups}"
url=
"user-groups.jsp"
description=
"${sidebar.user-groups.descr}"
/>
<!-- Password -->
<item
id=
"user-password"
name=
"${sidebar.user-password}"
...
...
src/web/user-groups.jsp
0 → 100644
View file @
10d14c5c
<%--
- $Revision$
- $Date$
-
- Copyright (C) 2005-2008 Jive Software. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--%>
<%@ page
import=
"org.jivesoftware.openfire.PresenceManager,
org.jivesoftware.openfire.group.Group,
org.jivesoftware.openfire.group.GroupManager,
org.jivesoftware.openfire.security.SecurityAuditManager,
org.jivesoftware.openfire.user.User,
org.jivesoftware.openfire.user.UserManager,
org.jivesoftware.openfire.user.UserNotFoundException"
%>
<%@ page
import=
"gnu.inet.encoding.Stringprep"
%>
<%@ page
import=
"org.jivesoftware.util.LocaleUtils"
%>
<%@ page
import=
"org.jivesoftware.util.Log"
%>
<%@ page
import=
"org.jivesoftware.util.ParamUtils"
%>
<%@ page
import=
"org.jivesoftware.util.StringUtils"
%>
<%@ page
import=
"org.xmpp.packet.JID"
%>
<%@ page
import=
"org.xmpp.packet.Presence"
%>
<%@ page
import=
"java.io.UnsupportedEncodingException"
%>
<%@ page
import=
"java.net.URLDecoder"
%>
<%@ page
import=
"java.net.URLEncoder"
%>
<%@ page
import=
"java.util.*"
%>
<%@ taglib
uri=
"http://java.sun.com/jstl/core_rt"
prefix=
"c"
%>
<%@ taglib
uri=
"http://java.sun.com/jstl/fmt_rt"
prefix=
"fmt"
%>
<!-- Define Administration Bean -->
<jsp:useBean
id=
"webManager"
class=
"org.jivesoftware.util.WebManager"
/>
<%
webManager
.
init
(
pageContext
);
%>
<%
// Get parameters
boolean
cancel
=
request
.
getParameter
(
"cancel"
)
!=
null
;
boolean
update
=
request
.
getParameter
(
"update"
)
!=
null
;
boolean
success
=
ParamUtils
.
getBooleanParameter
(
request
,
"updatesuccess"
);
String
username
=
ParamUtils
.
getParameter
(
request
,
"username"
);
Map
<
String
,
String
>
errors
=
new
HashMap
<
String
,
String
>
();
JID
jid
=
webManager
.
getXMPPServer
().
createJID
(
username
,
null
);
GroupManager
groupManager
=
webManager
.
getGroupManager
();
Collection
<
Group
>
groups
=
webManager
.
getGroupManager
().
getGroups
();
// Handle a cancel
if
(
cancel
)
{
response
.
sendRedirect
(
"user-properties.jsp?username="
+
URLEncoder
.
encode
(
username
,
"UTF-8"
));
return
;
}
if
(
success
)
{
%>
<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.groups.form.update"
/>
</td></tr>
</tbody>
</table>
</div><br>
<%
}
// Handle a save/update
if
(
update
)
{
for
(
Group
group
:
groups
)
{
String
role
=
ParamUtils
.
getParameter
(
request
,
URLEncoder
.
encode
(
group
.
getName
(),
"UTF-8"
));
if
(
"admin"
.
equals
(
role
))
{
if
(!
group
.
getAdmins
().
contains
(
jid
))
{
group
.
getAdmins
().
add
(
jid
);
}
}
else
if
(
"member"
.
equals
(
role
))
{
if
(!
group
.
getMembers
().
contains
(
jid
))
{
group
.
getMembers
().
add
(
jid
);
}
}
else
{
if
(
group
.
getMembers
().
contains
(
jid
))
{
group
.
getMembers
().
remove
(
jid
);
}
if
(
group
.
getAdmins
().
contains
(
jid
))
{
group
.
getAdmins
().
remove
(
jid
);
}
}
}
response
.
sendRedirect
(
"user-groups.jsp?username="
+
URLEncoder
.
encode
(
username
,
"UTF-8"
)
+
"&updatesuccess=true"
);
return
;
}
%>
<html>
<head>
<title><fmt:message
key=
"user.groups.title"
/></title>
<meta
name=
"subPageID"
content=
"user-groups"
/>
<meta
name=
"extraParams"
content=
"
<%=
"username="
+
URLEncoder
.
encode
(
username
,
"UTF-8"
)
%>
"
/>
</head>
<body>
<p>
<fmt:message
key=
"user.groups.info"
/>
<b><%=
username
%>
.
</b>
</p>
<form
action=
"user-groups.jsp"
method=
"post"
name=
"main"
>
<div
class=
"jive-table"
>
<table
cellpadding=
"0"
cellspacing=
"0"
border=
"0"
width=
"100%"
>
<thead>
<tr>
<th>
</th>
<th
nowrap
><fmt:message
key=
"user.groups.name"
/></th>
<th
nowrap
><fmt:message
key=
"user.groups.none"
/></th>
<th
nowrap
><fmt:message
key=
"user.groups.member"
/></th>
<th
nowrap
><fmt:message
key=
"user.groups.admin"
/></th>
</tr>
</thead>
<tbody>
<%
// Print the list of groups
if
(
groups
.
isEmpty
())
{
%>
<tr>
<td
align=
"center"
colspan=
"6"
><fmt:message
key=
"group.summary.no_groups"
/></td>
</tr>
<%
}
int
i
=
0
;
for
(
Group
group
:
groups
)
{
String
groupName
=
URLEncoder
.
encode
(
group
.
getName
(),
"UTF-8"
);
i
++;
%>
<tr
class=
"jive-
<%=
(((
i
%
2
)
==
0
)
?
"even"
:
"odd"
)
%>
"
>
<td
width=
"1%"
valign=
"top"
><%=
i
%></td>
<td
width=
"40%"
><a
href=
"group-edit.jsp?group=
<%=
groupName
%>
"
><%=
StringUtils
.
escapeHTMLTags
(
group
.
getName
())
%></a>
<%
if
(
group
.
getDescription
()
!=
null
)
{
%>
<br>
<span
class=
"jive-description"
>
<%=
StringUtils
.
escapeHTMLTags
(
group
.
getDescription
())
%>
</span>
<%
}
%></td>
<td
width=
"10%"
><input
type=
"radio"
name=
"
<%=
groupName
%>
"
value=
"none"
<%
if
(!
group
.
isUser
(
jid
))
{
%>
checked
<%
}
%>>
</td>
<td
width=
"10%"
><input
type=
"radio"
name=
"
<%=
groupName
%>
"
value=
"member"
<%
if
(
group
.
getMembers
().
contains
(
jid
))
{
%>
checked
<%
}
%>>
</td>
<td
width=
"10%"
><input
type=
"radio"
name=
"
<%=
groupName
%>
"
value=
"admin"
<%
if
(
group
.
getAdmins
().
contains
(
jid
))
{
%>
checked
<%
}
%>>
</td>
</tr>
<%
}
%>
</tbody>
</table>
</div>
<br
/>
<input
type=
"hidden"
name=
"username"
value=
"
<%=
StringUtils
.
escapeForXML
(
username
)
%>
"
>
<input
type=
"submit"
name=
"update"
value=
"
<fmt:message
key=
"global.save_changes"
/>
"
>
<input
type=
"submit"
name=
"cancel"
value=
"
<fmt:message
key=
"global.cancel"
/>
"
>
</form>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment