home *** CD-ROM | disk | FTP | other *** search
/ Freelog 70 / Freelog070.iso / Internet / EasyPHP / easyphp1-8_setup.exe / {app} / home / index.php < prev    next >
Encoding:
PHP Script  |  2005-02-28  |  12.8 KB  |  345 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>[EasyPHP] - Administration</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <link rel="stylesheet" href="styles.css" type="text/css">
  7. </head>
  8.  
  9. <body>
  10.  
  11. <?php
  12. $langFile = "";
  13. include("i18n_en.php");    // une premiere fois pour la langue par dΘfaut
  14.  
  15. $browser_languages = explode(",", getenv("HTTP_ACCEPT_LANGUAGE"));
  16. $nb_browser_languages = sizeof($browser_languages);
  17. $browser_lang = "";    // ne pas initialiser
  18.  
  19. for ($niI = 0; $langFile=="" && $niI < $nb_browser_languages; $niI++)
  20. {
  21.     $lg = explode("-", $browser_languages[$niI]);
  22.     switch ($lg[0])
  23.     {
  24.     case "fr" : $langFile = "i18n_fr.php"; break;
  25.     case "es" : $langFile = "i18n_sp.php"; break;
  26.     case "en" : $langFile = "i18n_en.php"; break;    
  27.     }
  28. }
  29. if ($langFile=="")
  30.     $langFile = "i18n_en.php";
  31.  
  32. @include($langFile);    // Langue selectionnΘ"
  33. include("ver_strings.php");
  34.  
  35. if (isset($HTTP_GET_VARS)){
  36.     while(list($name, $value) = each($HTTP_GET_VARS)){
  37.         $$name = $value;
  38.     }
  39. }
  40.     
  41. if (!isset($to)) $to = '';
  42. if (!isset($_POST['to'])) $_POST['to'] = '';
  43. if (!isset($exts)) $exts = '';
  44. if (!isset($exts)) $do = '';
  45. if (!isset($exts)) $directory = '';
  46.  
  47. function bouton($word, $lien, $cible){
  48.     $lenght=strlen($word);
  49.     $start = 0;
  50.     print("<table border='0' cellspacing='0' cellpadding='0'>");
  51.     print("<tr><td><img src='images_easyphp/bouton_gauche.gif' width='4' height='26'></td><td background='images_easyphp/bouton_fond.gif'>");
  52.     print("<a href=$lien $cible>");  
  53.     while($start<$lenght){
  54.         $car=substr($word,$start,1);
  55.         print("<img src='images_easyphp/lettre_".$car.".gif' border='0'>");
  56.         $start++;
  57.     }
  58.     print("</a>");  
  59.     print("</td><td><img src='images_easyphp/bouton_droit.gif' width='4' height='26'></td></tr></table>");
  60. }
  61.  
  62. function bouton_fleche($word,$lien, $cible){
  63.     $lenght=strlen($word);
  64.     $start = 0;
  65.     print("<table border='0' cellspacing='0' cellpadding='0'>");
  66.     print("<tr><td><img src='images_easyphp/bouton_fleche_gauche.gif' width='4' height='26'></td><td background='images_easyphp/bouton_fleche_fond.gif'>");
  67.     print("<a href=$lien $cible>");   
  68.     while($start<$lenght){
  69.         $car=substr($word,$start,1);
  70.         print("<img src='images_easyphp/lettre_".$car.".gif' border='0'>");
  71.         $start++;
  72.     }
  73.     print("</a>");   
  74.     print("</td><td><img src='images_easyphp/bouton_fleche_droit.gif' width='4' height='26'></td></tr></table>");
  75. }
  76.  
  77. function num_version($num){
  78.     $lenght=strlen($num);
  79.     $start = 0;
  80.     while($start<$lenght){
  81.         $chiffre=substr($num,$start,1);
  82.         print("<img src='images_easyphp/chiffre_".$chiffre.".gif' border='0'>");
  83.         $start++;
  84.     }
  85. }
  86. ?>
  87. <div align="center">
  88. <table width="400" cellspacing="0" cellpadding="0" border="0" align="center">
  89. <tr>
  90. <td>
  91. <a href="index.php"><img src="images_easyphp/titre_easyphp_admin.gif" width="387" height="116" border="0"></a>
  92. </td>
  93. </tr>
  94. <tr>
  95. </table>
  96. </div>
  97.  
  98.  
  99.  
  100. <div align="center">
  101. <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
  102. <tr> 
  103. <td class="text1">
  104. <?php printf($accueilMsg, "<a href=\"accueil.html\"><img src=\"images_easyphp/accueil.gif\" width=\"60\" height=\"12\" border=\"0\" align=\"absbottom\"></a>"); ?>
  105. </td>
  106. </tr>
  107. </table>
  108. </div>
  109.  
  110. <br><br>
  111.  
  112. <div align="center">
  113. <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
  114. <tr> 
  115. <td width="200" nowrap> <img src="images_easyphp/cube_rouge.gif" width="18" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><img src="images_easyphp/apache.gif" width="74" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26">
  116. <?php num_version($version_apache) ?>
  117. </td>
  118. <td>
  119.  
  120. <table border="0" cellpadding="0" cellspacing="5">
  121. <tr>
  122. <td bgcolor="#666666"><?php bouton_fleche($bouton_alias, "index.php", "") ?></td>
  123. <td><img src="images_easyphp/1x1.gif" width="20" height="26"></td>
  124. <td><?php bouton($licence, "licence_apache.php", "") ?></td>
  125. </tr>
  126. </table>
  127. </td>
  128. </tr>
  129. <tr> 
  130. <td> </td>
  131. <td class="text1"> 
  132.  
  133. <?php
  134. //===================================================================================================
  135. function read_alias(){
  136.     global $alias, $directory, $httpd, $httpd_1, $n, $httpd_2, $httpd_3, $nb_alias, $source;
  137.     $source = "../conf_files/httpd.conf";
  138.     $fp = fopen($source, "r");
  139.     $httpd = "";
  140.     while (!feof($fp)){
  141.         $conf = fgets($fp, 4096);
  142.         $httpd = $httpd.$conf;
  143.     }
  144.     fclose($fp);
  145.     $exp1 = explode("#alias",$httpd);
  146.     $httpd_1 = $exp1[0];
  147.     $httpd_2 = $exp1[1];
  148.     $httpd_3 = $exp1[2];
  149.     $exp2 = explode("Alias",$httpd_2);
  150.     
  151.     $n = 1;
  152.     $nb_alias = count($exp2)-1;
  153.     while($n<=$nb_alias){
  154.         $exp3 = explode("<Directory",$exp2[$n]);
  155.         $alias[$n] = "Alias".$exp3[0];
  156.         $directory[$n] = "<Directory".$exp3[1];
  157.         $n++;
  158.     }
  159. }
  160.  
  161. function list_alias(){
  162.     global $inc, $alias, $nb_alias, $exp4, $exp5, $alias_link, $nb_alias, $alias_name;
  163.     $inc = 1;
  164.     while($inc <= $nb_alias){
  165.         $exp4 = explode("\"",$alias[$inc]);
  166.         $exp5 = explode("/",$exp4[1]);
  167.         $alias_link = $exp4[3];
  168.         $alias_name = $exp5[1];
  169.         $alias_link = str_replace("/","\\", $alias_link);
  170.         print("<table border='0' cellspacing='0' cellpadding='0'>");
  171.         print("<tr>");
  172.         print("<td class='text1' valign='top'>");
  173.         print("<img src='images_easyphp/1x1.gif' width='10' height='16' align='absbottom'><img src='images_easyphp/dossier_alias.gif' width='23' height='16' align='absbottom'> ");
  174.         print("</td>");
  175.         print("<td class='text1'>");
  176.         print("<a href='../$alias_name/' target='_blank' class='text1'>$alias_name</a>    [ $alias_link ]    ");
  177.         print("[ <a href='index.php?to=del_alias&num_alias=$inc' class=text2>supprimer</a> ]<br>");
  178.         print("</td>");
  179.         print("</tr>");
  180.         print("</table>");
  181.         $inc++;
  182.     }
  183.     print("<img src='images_easyphp/1x1.gif' width='10' height='16' align='absbottom'><img src='images_easyphp/dossier_alias.gif' width='23' height='16' align='absbottom'> ");
  184.     print("...    ");
  185.     printf("[ <a href='index.php?to=add_alias_1' class=text2>%s</a> ]<br><br>", $GLOBALS['addAlias']);
  186. }        
  187.  
  188. if ($to == "add_alias_1"){
  189. ?>
  190. <form method="post" action="index.php">
  191. Les alias permettent de placer vos développements dans un ou plusieurs répertoires indépendamment du répertoire racine d'apache (www).
  192. <br><br>
  193. <img src="images_easyphp/num_1.gif" width="14" height="18" align="absbottom"> créer votre répertoire (ex.: C:\weblocal\sites\site1) <br>
  194. <img src="images_easyphp/num_2.gif" width="14" height="18" align="absbottom"> saisir un nom pour l'alias (ex.: site1)<br>
  195. <img src="images_easyphp/1x1.gif" width="14" height="18" align="absbottom"><input type="text" name="alias_name" size="50"><br>
  196. <img src="images_easyphp/num_3.gif" width="14" height="18" align="absbottom"> saisir le chemin du répertoire créé (ex.: C:\weblocal\sites\site1)<br>
  197. <img src="images_easyphp/1x1.gif" width="14" height="18" align="absbottom"><input type="text" name="alias_link" size="50"><br>
  198. <img src="images_easyphp/num_4.gif" width="14" height="18" align="absbottom"> paramètres par défaut du répertoire<br>
  199. <img src="images_easyphp/1x1.gif" width="14" height="18" align="absbottom"><textarea name="dir" cols="45" rows="4" wrap="virtual">Options Indexes FollowSymLinks Includes
  200. AllowOverride All
  201. #Order allow,deny
  202. Allow from all
  203. </textarea>
  204. <br>
  205. <img src="images_easyphp/num_5.gif" width="14" height="18" align="absbottom"> valider ("OK")<br>
  206. <img src="images_easyphp/num_6.gif" width="14" height="18" align="absbottom"> cliquer sur redémarrer et attendre que apache et mysql repassent au vert dans le statut.
  207. <br><br>
  208. <input type="hidden" name="to" value="add_alias_2">
  209. <input type="image" src="images_easyphp/bouton_valider.gif" border="0" width="38" height="18" alt="envoyer">
  210. <br><br>
  211. rq : il existe une copie de secours du fichier httpd.conf dans le rΘpertoire "safe" : httpd-safe.conf
  212. </form>
  213.              
  214. <?php
  215. }elseif ($_POST['to'] == "add_alias_2"){
  216.         if ($_POST['alias_name'] == "" | $_POST['alias_link'] == "" | !is_dir($_POST['alias_link'])){
  217.             if ($_POST['alias_name'] == ""){print("  <img src='images_easyphp/exclam.gif' width='10' height='18' align='absbottom'> le champ 2 est vide.<br>");}
  218.             if ($_POST['alias_link'] == ""){print("  <img src='images_easyphp/exclam.gif' width='10' height='18' align='absbottom'> le champ 3 est vide.<br>");}
  219.             if ($_POST['alias_link'] != "" & !is_dir($_POST['alias_link'])){print("  <img src='images_easyphp/exclam.gif' width='10' height='18' align='absbottom'> le répertoire correspondant au chemin que vous avez saisi n'existe pas.<br>");}
  220.             print("  [ <a href=\"javascript:history.back()\" class=\"text2\">retour</a> ]<br><br>");
  221.             clearstatcache();
  222.         }else{
  223.             read_alias();
  224.             $dir = ereg_replace("\r\n","\n",$_POST['dir']);
  225.             //$alias_link = stripslashes($_POST['alias_link']);
  226.             $alias_link = str_replace("\\","/", $_POST['alias_link']);
  227.             
  228.             if (substr($alias_link, -1) == "/"){$alias_link = substr($alias_link,0,strlen($alias_link)-1);}
  229.             $new_alias = "Alias \"/";
  230.             $new_alias .= $_POST['alias_name'];
  231.             $new_alias .= "\" \"";
  232.             $new_alias .= $alias_link;
  233.             $new_alias .= "/\"\n";
  234.             $new_alias .= "<Directory \"$alias_link\">\n".$dir."</Directory>\n\n";
  235.             $conf = $httpd_1."#alias".$httpd_2.$new_alias."#alias\n".$httpd_3;
  236.             $fp2 = fopen($source, "w");
  237.             fputs($fp2,$conf);
  238.             fclose($fp2);
  239.             read_alias();
  240.             list_alias();
  241.         }
  242. }elseif ($to == "del_alias"){
  243.         read_alias();
  244.         $conf_del_alias = $httpd_1."#alias\n";
  245.         $x = 1;
  246.         while($x<=$nb_alias){
  247.             if ($x != $num_alias){$conf_del_alias = $conf_del_alias.$alias[$x].$directory[$x];}
  248.             $x++;
  249.         }
  250.         $conf_del_alias = $conf_del_alias."#alias\n".$httpd_3;
  251.         $fp3 = fopen($source, "w");
  252.         fputs($fp3,$conf_del_alias);
  253.         fclose($fp3);
  254.         read_alias();
  255.         list_alias();
  256. }else{
  257.         read_alias();
  258.         list_alias();
  259. }
  260. //===========================================================================================
  261. ?>
  262.  
  263. </td>
  264. </tr>
  265.  
  266.  
  267. <tr> 
  268. <td nowrap><img src="images_easyphp/cube_rouge.gif" width="18" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><img src="images_easyphp/php.gif" width="38" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><?php num_version($version_php) ?></td>
  269. <td>
  270.  
  271. <table border="0" cellpadding="0" cellspacing="5">
  272. <tr>
  273. <td bgcolor="#666666"><?php bouton_fleche($ext, "index.php", "") ?></td>
  274. <td><img src="images_easyphp/1x1.gif" width="20" height="26"></td>
  275. <td><?php bouton($phpinfo, "phpinfo.php", "") ?></td>
  276. <td><?php bouton($licence, "licence_php.php", "") ?></td>
  277. <td> </td>
  278. </tr>
  279. </table>
  280. </td>
  281.  
  282. <tr>
  283. <td></td>
  284. <td class="text1">
  285.  
  286. <?php
  287. //===========================================================================================
  288. $extensions = @get_loaded_extensions();
  289. printf("   ".$nbExtensions." ", count($extensions));
  290. printf("[ <a href='index.php?to=ext' class=text2>%s</a> ]<br>", $afficherExtensions);
  291. if ($to=="ext"){
  292.     @sort($extensions);
  293.     foreach($extensions as $extension){
  294.         print("      <img src='/images_easyphp/carre_jaune.gif' width='10' height='10' align='absbottom'> $extension  [ <a href='index.php?to=ext&exts=$extension' class=text2>fonctions</a> ]<br>");
  295.         if ($extension==$exts){
  296.             $functions = @get_extension_funcs($exts);
  297.             @sort($functions);
  298.             foreach($functions as $function){print("                • $function<br>");}
  299.         }
  300.     }
  301. }
  302. print("<br>");
  303. //===========================================================================================
  304. ?>
  305.  
  306. </td>
  307. </tr>
  308. <tr> 
  309. <td nowrap><img src="images_easyphp/cube_rouge.gif" width="18" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><img src="images_easyphp/phpmyadmin.gif" width="128" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><?php num_version($version_phpmyadmin) ?></td>
  310. <td>
  311.  
  312. <table border="0" cellpadding="0" cellspacing="5">
  313. <tr>
  314. <td><?php bouton($gestion_bdd, "/mysql/", "target='_blank'") ?></td>
  315. <td><?php bouton($licence, "licence_phpmyadmin.php", "") ?></td>
  316. <td> </td>
  317. </tr>
  318. </table>
  319.  
  320. </td>
  321. </tr>
  322.  
  323.  
  324.  
  325. <tr> 
  326. <td nowrap>
  327. <img src="images_easyphp/cube_rouge.gif" width="18" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><img src="images_easyphp/mysql.gif" width="68" height="26"><img src="images_easyphp/1x1.gif" width="5" height="26"><?php num_version($version_mysql) ?>
  328. </td>
  329. <td>
  330.  
  331. <table border="0" cellpadding="0" cellspacing="5">
  332. <tr>
  333. <td><?php bouton($licence, "licence_mysql.php", "") ?></td>
  334. <td> </td>
  335. </tr>
  336. </table>
  337.  
  338. </td>
  339. </tr>
  340.  
  341. </table>
  342. </div>
  343.  
  344. </body>
  345. </html>