All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.edit_password_policy_assignments.jsp Maven / Gradle / Ivy

There is a newer version: 5.0.66
Show newest version
<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
--%>

<%@ include file="/init.jsp" %>

<%
String tabs1 = ParamUtil.getString(request, "tabs1");
String tabs2 = ParamUtil.getString(request, "tabs2", "users");

String redirect = ParamUtil.getString(request, "redirect");

long passwordPolicyId = ParamUtil.getLong(request, "passwordPolicyId");

PasswordPolicy passwordPolicy = PasswordPolicyLocalServiceUtil.fetchPasswordPolicy(passwordPolicyId);

String displayStyle = ParamUtil.getString(request, "displayStyle");

if (Validator.isNull(displayStyle)) {
	displayStyle = portalPreferences.getValue(PasswordPoliciesAdminPortletKeys.PASSWORD_POLICIES_ADMIN, "display-style", "list");
}
else {
	portalPreferences.setValue(PasswordPoliciesAdminPortletKeys.PASSWORD_POLICIES_ADMIN, "display-style", displayStyle);

	request.setAttribute(WebKeys.SINGLE_PAGE_APPLICATION_CLEAR_CACHE, Boolean.TRUE);
}

PortletURL portletURL = renderResponse.createRenderURL();

portletURL.setParameter("mvcPath", "/edit_password_policy_assignments.jsp");
portletURL.setParameter("tabs1", tabs1);
portletURL.setParameter("tabs2", tabs2);
portletURL.setParameter("redirect", redirect);
portletURL.setParameter("passwordPolicyId", String.valueOf(passwordPolicy.getPasswordPolicyId()));

portletDisplay.setShowBackIcon(true);
portletDisplay.setURLBack(redirect);

renderResponse.setTitle(passwordPolicy.getName());

String[] orderColumns = new String[] {"first-name", "screen-name"};
RowChecker rowChecker = new DeleteUserPasswordPolicyChecker(renderResponse, passwordPolicy);
PortletURL searchURL = PortletURLUtil.clone(portletURL, renderResponse);
SearchContainer searchContainer = new UserSearch(renderRequest, searchURL);

if (tabs2.equals("organizations")) {
	orderColumns = new String[] {"name", "type"};
	searchContainer = new OrganizationSearch(renderRequest, searchURL);
	rowChecker = new DeleteOrganizationPasswordPolicyChecker(renderResponse, passwordPolicy);
}

PortletURL homeURL = renderResponse.createRenderURL();

homeURL.setParameter("mvcPath", "/view.jsp");

PortalUtil.addPortletBreadcrumbEntry(request, LanguageUtil.get(request, "password-policies"), homeURL.toString());
PortalUtil.addPortletBreadcrumbEntry(request, passwordPolicy.getName(), null);
%>


	

		<%
		PortletURL usersURL = PortletURLUtil.clone(portletURL, renderResponse);

		usersURL.setParameter("tabs2", "users");
		%>

		

		<%
		PortletURL userGroupsURL = PortletURLUtil.clone(portletURL, renderResponse);

		userGroupsURL.setParameter("tabs2", "organizations");
		%>

		
	

	
		
			
		
	



	
		

		
	

	
		
	

	

		<%
		String taglibURL = "javascript:;";

		if (tabs2.equals("users")) {
			taglibURL = "javascript:" + renderResponse.getNamespace() + "deleteUsers();";
		}
		else if (tabs2.equals("organizations")) {
			taglibURL = "javascript:" + renderResponse.getNamespace() + "deleteOrganizations();";
		}
		%>

		
	





	
	
	
	

	

	
		
			
			

			

				<%
				UserSearchTerms searchTerms = (UserSearchTerms)userSearchContainer.getSearchTerms();

				LinkedHashMap userParams = new LinkedHashMap();

				userParams.put("usersPasswordPolicies", Long.valueOf(passwordPolicy.getPasswordPolicyId()));
				%>

				<%@ include file="/user_search_columns.jspf" %>

				
			
		
		
			
			

			

				<%
				OrganizationSearchTerms searchTerms = (OrganizationSearchTerms)organizationSearchContainer.getSearchTerms();

				LinkedHashMap organizationParams = new LinkedHashMap();

				organizationParams.put("organizationsPasswordPolicies", Long.valueOf(passwordPolicy.getPasswordPolicyId()));
				%>

				<%@ include file="/organization_search_columns.jspf" %>

				
			
		
	



	



	var Util = Liferay.Util;

	var $ = AUI.$;

	var form = $(document.fm);

	
		
		
		
		
	

	$('#addMembers').on(
		'click',
		function(event) {
			event.preventDefault();

			var itemSelectorDialog = new A.LiferayItemSelectorDialog(
				{
					eventName: 'selectMember',
					on: {
						selectedItemChange: function(event) {
							var result = event.newVal;

							if (result && result.item) {
								if (result.memberType == 'users') {
									form.fm('addUserIds').val(result.item);
								}
								else if (result.memberType == 'organizations') {
									form.fm('addOrganizationIds').val(result.item);
								}

								submitForm(form);
							}
						}
					},
					title: '',
					url: '<%= selectMembersURL %>'
				}
			);

			itemSelectorDialog.open();
		}
	);

	window.deleteOrganizations = function() {
		if (confirm('')) {
			form.fm('removeOrganizationIds').val(Util.listCheckedExcept(form, 'allRowIds'));

			submitForm(form);
		}
	};

	window.deleteUsers = function() {
		if (confirm('')) {
			form.fm('removeUserIds').val(Util.listCheckedExcept(form, 'allRowIds'));

			submitForm(form);
		}
	};




© 2015 - 2025 Weber Informatics LLC | Privacy Policy