// Security.java

package ed.security;

import ed.js.engine.*;

public class Security {
    
    final static String SECURE[] = new String[]{ 
        Convert.DEFAULT_PACKAGE + "._data_corejs_" , 
        Convert.DEFAULT_PACKAGE + "._data_sites_admin_" , 
        Convert.DEFAULT_PACKAGE + "._data_sites_www_" , 
        Convert.DEFAULT_PACKAGE + ".lastline" 
    };
    
    public static boolean isCoreJS(){
        String topjs = getTopJS();
        if ( topjs == null )
            return false;
        
        for ( int i=0; i<SECURE.length; i++ )
            if ( topjs.startsWith( SECURE[i] ) )
                return true;
        
        return false;
    }
    
    public static String getTopJS(){
        
        StackTraceElement[] st = Thread.currentThread().getStackTrace();
        
        for ( int i=0; i<st.length; i++ ){
            StackTraceElement e = st[i];
            if ( e.getClassName().startsWith( Convert.DEFAULT_PACKAGE + "." ) )
                return e.getClassName();
        }

        return null;
    }
    
    
}

@@ -80,16 +80,92 @@
 curity %7B
+%0A%0A    public final static boolean OFF = Boolean.getBoolean( %22NO-SECURITY%22 );
 %0A    %0A  
@@ -475,24 +475,69 @@
 isCoreJS()%7B%0A
+        if ( OFF )%0A            return true;%0A%0A
         Stri

NO-SECURITY option -DNO-SECURITY=true