svn commit: samba r9610 - in branches/SAMBA_4_0/swat/scripting: .

tridge at samba.org tridge at samba.org
Thu Aug 25 08:22:42 GMT 2005


Author: tridge
Date: 2005-08-25 08:22:42 +0000 (Thu, 25 Aug 2005)
New Revision: 9610

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9610

Log:

use a list of allowable extensions for unauthenticated access rather than
a list of file names

Modified:
   branches/SAMBA_4_0/swat/scripting/common.js


Changeset:
Modified: branches/SAMBA_4_0/swat/scripting/common.js
===================================================================
--- branches/SAMBA_4_0/swat/scripting/common.js	2005-08-25 07:31:14 UTC (rev 9609)
+++ branches/SAMBA_4_0/swat/scripting/common.js	2005-08-25 08:22:42 UTC (rev 9610)
@@ -73,15 +73,15 @@
   This allows the login page to use the same style sheets and images
 */
 function always_allowed(uri) {
-	var allowed = new Array("/images/favicon.ico", 
-				"/images/linkpad.gif",
-				"/images/logo.png",
-				"/images/stripes.png",
-				"/style/columns.css",
-				"/style/swat.css",
-				"/style/common.css");
+	var str = string_init();
+	var s = str.split('.', uri);
+	if (s.length < 2) {
+		return false;
+	}
+	var ext = s[s.length-1];
+	var allowed = new Array("ico", "gif", "png","css", "js");
 	for (i in allowed) {
-		if (allowed[i] == uri) {
+		if (allowed[i] == ext) {
 			return true;
 		}
 	}



More information about the samba-cvs mailing list