/** * @see org.opencms.security.CmsPrincipal#setDescription(java.lang.String) */ @Override public void setDescription(String description) { setAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_DESCRIPTION, description); }
/** * Sets the address line of this user.<p> * * @param address the address line to set */ public void setAddress(String address) { setAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_ADDRESS, address); }
/** * Sets the country information of this user.<p> * * @param country the city information to set */ public void setCountry(String country) { setAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_COUNTRY, country); }
/** * @see org.opencms.security.CmsPrincipal#setDescription(java.lang.String) */ @Override public void setDescription(String description) { setAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_DESCRIPTION, description); }
/** * Sets the city information of this user.<p> * * @param city the city information to set */ public void setCity(String city) { setAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_CITY, city); }
/** * Sets the institution information of this user.<p> * * @param institution the institution information to set */ public void setInstitution(String institution) { setAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_INSTITUTION, institution); }
/** * Sets the address line of this user.<p> * * @param address the address line to set */ public void setAddress(String address) { setAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_ADDRESS, address); }
/** * Sets the city information of this user.<p> * * @param city the city information to set */ public void setCity(String city) { setAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_CITY, city); }
/** * Sets the country information of this user.<p> * * @param country the city information to set */ public void setCountry(String country) { setAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_COUNTRY, country); }
/** * Sets the zip code information of this user.<p> * * @param zipcode the zip code information to set */ public void setZipcode(String zipcode) { checkZipCode(zipcode); if (zipcode != null) { zipcode = zipcode.toUpperCase(); } setAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_ZIPCODE, zipcode); }
/** * Sets the zip code information of this user.<p> * * @param zipcode the zip code information to set */ public void setZipcode(String zipcode) { checkZipCode(zipcode); if (zipcode != null) { zipcode = zipcode.toUpperCase(); } setAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_ZIPCODE, zipcode); }
/** * Sets the show editor help flag.<p> * * @param cms the cms context * @param showHelp the show help flag * @throws CmsException if writing the user info fails */ public void setShowEditorHelp(CmsObject cms, boolean showHelp) throws CmsException { CmsUser user = cms.getRequestContext().getCurrentUser(); user.setAdditionalInfo(ADDINFO_ADE_SHOW_EDITOR_HELP, String.valueOf(showHelp)); cms.writeUser(user); }
/** * Creates a new token for the given user and stores it in the user's additional info.<p> * * @param cms the CMS context * @param user the user * @param currentTime the current time * @return the authorization token * @throws CmsException if something goes wrong */ public static String createToken(CmsObject cms, CmsUser user, long currentTime) throws CmsException { String randomKey = RandomStringUtils.randomAlphanumeric(8); String value = CmsEncoder.encodeStringsAsBase64Parameter(Arrays.asList(randomKey, "" + currentTime)); user.setAdditionalInfo(ADDINFO_KEY, value); cms.writeUser(user); return CmsEncoder.encodeStringsAsBase64Parameter(Arrays.asList(user.getName(), randomKey)); }
/** * @see org.opencms.ade.galleries.shared.rpc.I_CmsGalleryService#saveResultViewType(java.lang.String) */ public void saveResultViewType(String resultViewType) { CmsUser user = getCmsObject().getRequestContext().getCurrentUser(); user.setAdditionalInfo(RESULT_VIEW_TYPE_ADD_INFO_KEY, resultViewType); try { getCmsObject().writeUser(user); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } }
user.setAdditionalInfo(listKey, data.toString()); cms.writeUser(user);
/** * Writes the id of the last used workflow to the current user.<p> * * @param workflowId the workflow id * * @throws CmsException if something goes wrong writing the user object */ private void setLastWorkflowForUser(String workflowId) throws CmsException { CmsUser user = getCmsObject().getRequestContext().getCurrentUser(); user.setAdditionalInfo(PARAM_WORKFLOW_ID, workflowId); getCmsObject().writeUser(user); } }
/** * Writes the user quick launch apps setting to the user additional info.<p> * * @param cms the cms context * @param apps the app ids * * @throws CmsException in case writing the user fails */ protected void setUserQuickLaunchApps(CmsObject cms, List<String> apps) throws CmsException { JSONArray appIds = new JSONArray(apps); CmsUser user = cms.getRequestContext().getCurrentUser(); user.setAdditionalInfo(QUICK_LAUCH_APPS_KEY, appIds.toString()); cms.writeUser(user); }
/** * Stores the folder filters for the current site.<p> * * @param folders the folder filters */ private void storeFolderFilter(Set<String> folders) { JSONObject storedFilters = readUserFolderFilters(); try { storedFilters.put(getCmsObject().getRequestContext().getSiteRoot(), folders); CmsUser user = getCmsObject().getRequestContext().getCurrentUser(); user.setAdditionalInfo(FOLDER_FILTER_ADD_INFO_KEY, storedFilters.toString()); getCmsObject().writeUser(user); } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); } }
/** * Stores the information about the accepted user agreement in the current users additional info.<p> */ public void acceptAgreement() { // store accepted flag in current users settings getSettings().setUserAgreementAccepted(true); // check accepted agreement version if (getAcceptedVersion() < getRequiredVersion()) { // a new (higher) version was accepted, increase version to store and reset accepted count setAcceptedVersion(getRequiredVersion()); setAcceptedCount(0); } // increase accepted count setAcceptedCount(getAcceptedCount() + 1); // create the JSON data structure that is stored in the additional info JSONObject jsonData = new JSONObject(); try { jsonData.put(KEY_ACCEPTED_VERSION, getRequiredVersion()); jsonData.put(KEY_ACCEPTED_COUNT, m_acceptedCount); // store accepted data in users additional information CmsUser user = getCms().getRequestContext().getCurrentUser(); user.setAdditionalInfo(CmsUserSettings.LOGIN_USERAGREEMENT_ACCEPTED, jsonData.toString()); // write the changed user getCms().writeUser(user); } catch (Exception e) { LOG.error(e); } }
if (info.isEditable()) { if (info.isAdditionalInfo()) { m_user.setAdditionalInfo(info.getAddInfoKey(), m_infos.getItemProperty(info).getValue()); } else { propUtils.setProperty(