Re: Problems & solutions IG 2.9.6.3

"Bogeblad Mattias" <[email protected]>
Newsgroups gmane.comp.cms.infoglue.devel
Message-ID <[email protected]>
Hi Sito,

I'm going to do this.

1. We cannot remove the usedEntities-tags as they are needed for selective cache updates. But we can comment them. So if the content type of the page is set to text/css or text/javascript the section will be /*<usedEntities>content_100715,contentVersion_100583,contentVersion_100570,contentVersion_100581,</usedEntities>*/ and otherwise it will be <!--<usedEntities>content_100715,contentVersion_100583,contentVersion_100570,contentVersion_100581,</usedEntities>-->. OK for you?

2. I will add the proposed method and logic but I will add a setting which controls if forwarded addresses are ok and default is no.

Regards
Mattias Bogeblad

-----Original Message-----
From: sito [mailto:[email protected]] 
Sent: den 15 januari 2009 09:44
To: [email protected]
Subject: [Infoglue-developer] Problems & solutions IG 2.9.6.3

In InfoGlue version 2.9.6.3 ...

Developer members,Could you make the following changes in the next 
version of IG?

------------------------------------------------------------------------------ 

PROBLEM:
When we create an URL of a CSS (that includes images as assets) with the 
tag pageAsDigitalAssetUrl:
<structure:pageAsDigitalAssetUrl id="cssUrl" fileSuffix="css" 
useInheritance="false" siteNodeId="${cssPage.siteNodeId}"  />

It is generated correctly, but the contents of the CSS, in addition to 
the content includes the following information that should be deleted of 
the CSS to remain valid
<usedEntities>content_100715,contentVersion_100583,contentVersion_100570,contentVersion_100581,</usedEntities> 


SOLUTION: Delete substring of usedEntities

Package: org.infoglue.deliver.controllers.kernel.impl.simple
Class: NodeDeliveryController.java

**** At line 1440 INSERT:

//DELETE LIST OF USED ENTITIES
pageContent = pageContent.substring(0,usedEntitiesIndex -1);
------------------------------------------------------------------------------ 

------------------------------------------------------------------------------ 

PROBLEM: Incorrect IP origin with intermediated PROXY(s) as Apache Httpd 
(ProxyPass)

SOLUTION:
Package org.infoglue.cms.controllers.kernel.impl.simple

*** At line 255 INSERT:

//  Restricted by the origin of IP in forwarded PROXYs

public boolean getIsIPAllowed(HttpServletRequest request, String ip){
       boolean isIPAllowed = false;              String ipRemote = null;
       String ipRequest = null;
       if (request != null) {
           ipRequest = request.getRemoteAddr();
           ipRemote = request.getHeader("X-Forwarded-For");
           //System.out.println("Request: "+ipRequest+", Remote: 
"+ipRemote+", Ip:"+ip);
           if (ip.equals(ipRequest)){
                   isIPAllowed=true;
           }else if (ipRemote.indexOf(",") > 0){
               String[] ips = ipRemote.split(",");
               //The first IP is the origin, other IPs added by 
forward                              if ((ips.length>0) && 
(ip.equals(ips[0].trim()))){
                    isIPAllowed=true;                       
               }                                            }else{
               if (ip.equals(ipRemote)) isIPAllowed=true;
           }
       }
       return isIPAllowed;
   }

**** At line 356 MODIFY line with code:

           if(remoteIP.startsWith(allowedIP) || 
getIsIPAllowed(request,allowedIP))

------------------------------------------------------------------------------ 

------------------------------------------------------------------------------    



Thanks in advance
Regards

-- 
-------------======ooOO000OOoo======--------------
Vicente Javier Rosselló Ferrer
E-mail: vrossello [arroba] uib.es
Tel: 971 17 2884
Centre de Tecnologies de la Informació a la UIB

Edifici Anselm Turmeda - CTI
Ctra. Valldemossa 7.5km
Universitat de les Illes Balears
================================================== 



------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Infoglue-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/infoglue-developer

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.