Пример #1
0
  protected boolean logUserStoreLogin(
      User user,
      AdminService admin,
      String remoteIP,
      String remoteHost,
      UserStoreKey userStoreKey) {

    try {
      Document doc = XMLTool.createDocument("logentry");
      Element rootElement = doc.getDocumentElement();
      // UserStoreKey userStoreKey = user.getUserStoreKey();
      if (userStoreKey != null) {
        rootElement.setAttribute("userstorekey", String.valueOf(userStoreKey));
      }
      rootElement.setAttribute("sitekey", String.valueOf(0));
      rootElement.setAttribute("typekey", String.valueOf(LogType.LOGIN_USERSTORE.asInteger()));
      rootElement.setAttribute("inetaddress", remoteIP);
      XMLTool.createElement(doc, rootElement, "data");

      admin.createLogEntries(user, XMLTool.documentToString(doc));
    } catch (VerticalSecurityException vse) {
      String message = "Failed to create log entry because of security error: %t";
      VerticalAdminLogger.error(this.getClass(), 1, message, vse);
      return false;
    }

    return true;
  }
Пример #2
0
  protected String buildAccessRightsXML(String key, ExtendedMap formItems, int accessrightsType) {

    Document doc = buildAccessRightsXML(null, key, formItems, accessrightsType);
    if (doc != null) {
      return XMLTool.documentToString(doc);
    }

    return null;
  }
Пример #3
0
 public Object getDataFromXML(Node node) {
   Document tmpDoc = XMLTool.createDocument();
   tmpDoc.appendChild(tmpDoc.importNode(node, true));
   return XMLTool.documentToString(tmpDoc);
 }
Пример #4
0
 public String toString() {
   return XMLTool.documentToString(toXML());
 }