Index: admin/globalsettings.php =================================================================== --- admin/globalsettings.php (revision 11133) +++ admin/globalsettings.php (working copy) @@ -95,6 +95,7 @@ setGlobalSetting('ipInfoDbAPIKey',$_POST['ipInfoDbAPIKey']); setGlobalSetting('googleMapsAPIKey',$_POST['googleMapsAPIKey']); setGlobalSetting('force_ssl',$_POST['force_ssl']); + setGlobalSetting('allowedtemplateuploads',strip_tags(returnglobal('allowedtemplateuploads'))); setGlobalSetting('surveyPreview_require_Auth',strip_tags($_POST['surveyPreview_require_Auth'])); $savetime=trim(strip_tags((float) $_POST['timeadjust']).' hours'); //makes sure it is a number, at least 0 if ((substr($savetime,0,1)!='-') && (substr($savetime,0,1)!='+')) { $savetime = '+'.$savetime;} @@ -391,6 +392,10 @@ $editsurvey .= ">".$clang->gT("No")."\n" . "\t\t\n"; + //Allowed template uploads + $editsurvey .= "\t
  • \n" + . "\t\t
  • \n"; + $thisusercontrolSameGroupPolicy=getGlobalSetting('usercontrolSameGroupPolicy'); $editsurvey .= "\t
  • \n" . "\t\t\n" .makeoptions($cssfiles, "name", "name", $editfile) . "\n" - + ."\n" ."
    " ."\n" @@ -1129,7 +1134,7 @@ $graph.='$(document).ready(function() { $("div.ui-progressbar-value").removeClass("ui-corner-left"); $("div.ui-progressbar-value").addClass("ui-corner-right"); - });'; + });'; } $graph.=' @@ -1165,7 +1170,7 @@ '; } @@ -1216,12 +1221,22 @@ return $return; } -function multiarray_search($arrayVet, $campo, $valor){ - while(isset($arrayVet[key($arrayVet)])){ - if($arrayVet[key($arrayVet)][$campo] == $valor){ - return key($arrayVet); +/** + * Returns true when a nested array has the given key/value pair + * + * Usage: multiarray_search($cssfiles, 'name', 'template.css') + * returns true when cssfiles contains an array with name=>template.css + * + * @param type $arrayVet Array of arrays + * @param type $key The key to search for + * @param type $value The value to check + * @return boolean + */ +function multiarray_search($arrayVet, $key, $value){ + foreach($arrayVet as $index => $element) { + if (isset($element[$key]) && $element[$key] == $value) { + return true; } - next($arrayVet); } return false; }