]> source.dussan.org Git - archiva.git/commitdiff
prevent StringIndexOutOfBoundsException on AuditEvent creation
authorOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 07:19:20 +0000 (07:19 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 07:19:20 +0000 (07:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308257 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/artifacts-management.js

index 49c9bdbb14c8719c7f9e13cf1f3ef3006fa181f9..bd9372bb3d37dda1457d5cf03c4f0c020130442e 100644 (file)
@@ -147,10 +147,7 @@ public abstract class AbstractRestService
 
     protected void triggerAuditEvent( String repositoryId, String filePath, String action )
     {
-        AuditEvent auditEvent = new AuditEvent( action, repositoryId );
-        auditEvent.setAction( action );
-        auditEvent.setRepositoryId( repositoryId );
-        auditEvent.setResource( filePath );
+        AuditEvent auditEvent = new AuditEvent( repositoryId, getPrincipal(), filePath, action );
         AuditInformation auditInformation = getAuditInformation();
         auditEvent.setUserId( auditInformation.getUser() == null ? "" : auditInformation.getUser().getUsername() );
         auditEvent.setRemoteIP( auditInformation.getRemoteAddr() );
index 5ef5b34fdf431a14b42bac3ef21ca296e75ffd93..53e5880aeee1ad4f5a76426baebe47db502470ee 100644 (file)
@@ -101,6 +101,9 @@ define("archiva.artifacts-management",["jquery","i18n","order!utils","order!jque
                 $('#fileupload').bind('fileuploadsubmit', function (e, data) {
                   var pomFile = data.context.find('#pomFile' ).attr("checked");
                   var classifier = data.context.find('#classifier' ).val();
+                  if (!data.formData){
+                    data.formData={};
+                  }
                   data.formData.pomFile = pomFile;
                   data.formData.classifier = classifier;
                 });