<?
require_once("../include/varsfuncs.php");
if($ac=="Changer"){
include("$instp/skins/$sk/_pl_options/_pwd.php");
if($old==base64_decode($bonpass)&&$new==$new2){
$g=fopen($instp.'/include/psw.php','w+'); fputs($g,"<? \$bonpass=\"".base64_encode($new)."\"; ?>"); fclose($g);
print("<Script>alert('Le mot de passe a été changé !'); if(opener.opener) opener.opener.window.location.href='$path"."login.php?logout=1&sup=C'; opener.window.close(); window.close();</Script>");
}
exit();}else if($ac=="Enregistrer"&&!$pubopt){
if($setinstp&&$settmpd&&$setpath&&$setskin_defaut){
$fp=fopen("$instp/include/config.php","w+"); fputs($fp,"<?\r\n");
fputs($fp,"\$instp=\"$setinstp\";\r\n\$tmpd=\"$settmpd\";\r\n\$path=\"$setpath\";\r\n\$skin_defaut=\"$setskin_defaut\";\r\n");
if($use_supersec) $putss="1"; else $putss="0"; $setx=intval($setx); $sety=intval($sety);
fputs($fp,"\$supersecu=$putss;\r\n\$posx=$setx;\r\n\$posy=$sety;\r\n?>");
fclose($fp); header("Location: $PHP_SELF?saved=1"); exit();
}else{
die("<Script>alert('Vous n\\'avez pas rempli tous les champs !');window.location.href='$PHP_SELF';</Script>");}
}
if(!$pubopt){
include("$instp/skins/$sk/_pl_options/_m.php");
}else{
include_once("pub/config.php");
if($ac){
if($newp&&(@is_dir($newd)||@mkdir($newd,0777))){ $_anonymous[]=$newd; $_pubpass[]=$newp;}
$fp=fopen("$instp/modules/pub/config.php","w+");
if(intval($_maxt)!=$_maxt) $_maxt=$maxt;
if(intval($_maxfs)!=$_maxfs) $_maxfs=$maxfs;
fputs($fp,"<? \r\n");
for($i=0;isset($_pubpass[$i]);$i++){
if($_pubpass[$i]&&$_anonymous[$i]&&!$del[$i]&&(@is_dir($_anonymous[$i])||@mkdir($_anonymous[$i],0777)))
fputs($fp,"\$anonymous[$i]=\"".$_anonymous[$i]."\";\r\n\$pubpass[$i]=\"".$_pubpass[$i]."\";\r\n");
}
fputs($fp,"\$instp=\"$instp\";\r\n\$pathp=\"$pathp\";\r\n");
fputs($fp,"\$maxt=\"$_maxt\";\r\n\$maxfs=\"$_maxfs\";\r\n?>");
fclose($fp);
die("<html><Script>alert('La configuration a été modifiée');window.close();</Script></html>");
}
include("$instp/skins/$sk/_pl_options/_pub.php");
}
?>