<?php
 include("fotoweb19.php"); $loginAdmin = getValeurIni("loginAdministrateur"); $queryTheme = "SELECT codeTheme,repertoire FROM theme"; $resultTheme = mysql_query ($queryTheme) or die ("La requête de sélection des code theme a échoué"); while ($lineCodeTheme = mysql_fetch_row($resultTheme)) { $codeTheme = $lineCodeTheme[0]; $repertoire = $lineCodeTheme[1]; $queryRelation = "SELECT nomPers,niveau FROM relationthemepersonne WHERE codeTheme='$codeTheme'"; $resultRelation = mysql_query ($queryRelation) or die ("La requête de sélection des noms a échoué"); $strUserPrive = $loginAdmin . " "; $strUserVip =  $loginAdmin . " "; while ($lineRelation = mysql_fetch_row($resultRelation)) { $participant = $lineRelation[0]; $niveau = $lineRelation[1]; if ($participant != 'public') if ($niveau == 1) { $strUserPrive .= $participant . " "; } else if ($niveau == 2) { $strUserPrive .= $participant . " "; $strUserVip .= $participant . " "; } } mysql_free_result($resultRelation);  writeIndexPHP("../../".$repertoire);   $pathFilePrive = "../../".$repertoire."/prive"; if (file_exists($pathFilePrive)) { writeIndexPHP($pathFilePrive);  $nomFichierAccess = getValeurIni("nomFichierAccess"); $nomFichierPwd = getValeurIni("nomFichierPwd"); $pathFilePrive = "../../".$repertoire."/prive/$nomFichierAccess"; if ($fp = fopen($pathFilePrive, "w-")) { if (getValeurIni("evt") == "local") $str = "AuthUserFile ".getPathBaseApplication()."application\access\\$nomFichierPwd\n"; else $str = getValeurIni("htAccessKey")." application/access/$nomFichierPwd\n"; $str .= "AuthName fotoweb\n"; $str .= "AuthType Basic\n"; $str .= "<limit GET>\n"; $str .= "	require user ".$strUserPrive."\n"; $str .= "</Limit>";  fwrite($fp,$str); fclose($fp); } } else { }  $pathFileVip = "../../".$repertoire."/vip"; if (file_exists($pathFileVip)) { writeIndexPHP($pathFileVip);  $nomFichierAccess = getValeurIni("nomFichierAccess"); $nomFichierPwd = getValeurIni("nomFichierPwd"); $pathFileVip = "../../".$repertoire."/vip/$nomFichierAccess"; if ($fp = fopen($pathFileVip, "w-")) { if (getValeurIni("evt") == "local") $str = "AuthUserFile ".getPathBaseApplication()."application\access\\$nomFichierPwd\n"; else $str = getValeurIni("htAccessKey")." application/access/$nomFichierPwd\n"; $str .= "AuthName fotoweb\n"; $str .= "AuthType Basic\n"; $str .= "<limit GET>\n"; $str .= "	require user ".$strUserVip."\n"; $str .= "</Limit>";  fwrite($fp,$str); fclose($fp); } } else { } }  if($modif == "true") { echo "parent.frames['basAdmin'].location.replace('fotoweb44.html');"; } else { $queryMax = "SELECT MAX(codeTheme) FROM theme"; $resultMax = mysql_query ($queryMax) or die ("La requête de sélection du Max theme a échoué"); $lineMax = mysql_fetch_row($resultMax); $idMax = $lineMax[0];  $queryDernierTheme = "SELECT nomTheme,repertoire FROM theme WHERE codeTheme='$idMax'"; $resultDernierTheme = mysql_query ($queryDernierTheme) or die ("La requête de sélection du dernier thème a échoué"); $lineDernierTheme = mysql_fetch_row($resultDernierTheme); $theme = $lineDernierTheme[0]; $repertoire = $lineDernierTheme[1];   $pathAdmin= "fotoweb38.php?codeTheme=".$idMax."&theme=".$theme."&repertoire=".$repertoire;  echo " parent.frames['basAdmin'].location.replace('".$pathAdmin."');";  } mysql_free_result($resultTheme);  ?> 