home *** CD-ROM | disk | FTP | other *** search
- <?php
- include("i18n.inc.php");
- ?>
-
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html>
- <head>
- <link rel="shortcut icon" href="images_easyphp/easyphp_favicon.ico" />
- <title>[EasyPHP] - <?php echo $administration ?></title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <link rel="stylesheet" href="styles.css" type="text/css" />
- </head>
-
- <body>
-
- <?php
- include("functions.inc.php");
- include("versions.inc.php");
-
- if (isset($HTTP_GET_VARS))
- {
- while(list($name, $value) = each($HTTP_GET_VARS))
- {
- $$name = $value;
- }
- }
-
- if (!isset($_GET['to'])) $_GET['to'] = '';
- if (!isset($_POST['to'])) $_POST['to'] = '';
- if (!isset($_GET['exts'])) $_GET['exts'] = '';
- if (!isset($_GET['exts'])) $directory = '';
-
- include("header.inc.php");
- ?>
-
-
- <div id="body">
- <div class="container">
- <div class="content_left">
- <img src="images_easyphp/apache.gif" width="74" height="18" alt="Apache" border="0" />
- <?php version($version_apache) ?>
- </div>
- <div class="content_right">
- <?php
- button($alias_title, "index.php", "", "#7F7767", 1);
- button($licence, "licence_apache.php", "", "#7F7F7F", 0);
- echo "<br />";
-
- //===================================================================================================
- function read_alias()
- {
- global $alias, $directory, $httpd, $httpd_1, $n, $httpd_2, $httpd_3, $nb_alias, $source;
- $source = "../conf_files/httpd.conf";
- $fp = fopen($source, "r");
- $httpd = "";
- while (!feof($fp))
- {
- $conf = fgets($fp, 4096);
- $httpd = $httpd.$conf;
- }
- fclose($fp);
- $exp1 = explode("#alias",$httpd);
- $httpd_1 = $exp1[0];
- $httpd_2 = $exp1[1];
- $httpd_3 = $exp1[2];
- $exp2 = explode("Alias",$httpd_2);
-
- $n = 1;
- $nb_alias = count($exp2)-1;
- while($n<=$nb_alias)
- {
- $exp3 = explode("<Directory",$exp2[$n]);
- $alias[$n] = "Alias".$exp3[0];
- $directory[$n] = "<Directory".$exp3[1];
- $n++;
- }
- }
-
- function list_alias()
- {
- global $inc, $alias, $nb_alias, $exp4, $exp5, $alias_link, $nb_alias, $alias_name, $alias_add, $alias_delete;
- $inc = 1;
- echo "<table class='alias'>";
- while($inc <= $nb_alias)
- {
- $exp4 = explode("\"",$alias[$inc]);
- $exp5 = explode("/",$exp4[1]);
- $alias_link = $exp4[3];
- $alias_name = $exp5[1];
- $alias_link = str_replace("/","\\", $alias_link);
- echo "<tr>";
- echo "<td><img src='images_easyphp/alias.gif' width='16' height='11' alt='alias' /></td>";
- echo "<td class='alias_name'><a href='../$alias_name/' target='_blank'>$alias_name</a></td>";
- echo "<td class='alias_path'> <img src='images_easyphp/alias_path.gif' width='16' height='11' alt='alias path' border='0' />$alias_link</td>";
- echo "<td> [<a href='index.php?to=del_alias&num_alias=$inc'>$alias_delete</a>]</td>";
- echo "</tr>";
- $inc++;
- }
- echo "<tr>";
- echo "<td><img src='images_easyphp/alias_add.gif' width='16' height='11' alt='add alias' border='0' /></td>";
- echo "<td colspan='3'>";
- echo "[<a href='index.php?to=add_alias_1'>$alias_add</a>]";
- echo "</td>";
- echo "</tr>";
- echo "</table>";
- }
-
- if ($_GET['to'] == "add_alias_1")
- {
- ?>
- <form method="post" action="index.php">
- <?php echo $alias_intro ?>
- <br />
- <img src="images_easyphp/num_1.gif" width="14" height="18" alt="1." class="alias_img" /><?php echo $alias_1 ?>
- <br />
- <img src="images_easyphp/num_2.gif" width="14" height="18" alt="2." class="alias_img" /><?php echo $alias_2 ?>
- <br />
- <input type="text" name="alias_name" size="50" /><br />
- <img src="images_easyphp/num_3.gif" width="14" height="18" alt="3." class="alias_img" /><?php echo $alias_3 ?>
- <br />
- <input type="text" name="alias_link" size="50" /><br />
- <img src="images_easyphp/num_4.gif" width="14" height="18" alt="4." class="alias_img" /><?php echo $alias_4 ?>
- <br />
- <?php
- $textarea = "Options FollowSymLinks Indexes\r\nAllowOverride None\r\nOrder deny,allow\r\nAllow from 127.0.0.1\r\ndeny from all\r\n";
- ?>
- <textarea name="dir" cols="40" rows="5"><?php echo $textarea ?></textarea>
- <br />
- <img src="images_easyphp/num_5.gif" width="14" height="18" alt="5." class="alias_img" /><?php echo $alias_5 ?>
- <br />
- <img src="images_easyphp/num_6.gif" width="14" height="18" alt="6." class="alias_img" /><?php echo $alias_6 ?>
- <br /><br />
- <input type="hidden" name="to" value="add_alias_2" />
- <input type="image" src="images_easyphp/ok.gif" />
- <br /><br />
- <?php echo $alias_rem ?>
- </form>
-
- <?php
- }
- elseif ($_POST['to'] == "add_alias_2")
- {
- /* alias name tests */
- read_alias();
- $name_test = TRUE;
- $inc = 1;
- while($inc <= $nb_alias)
- {
- $exp4 = explode("\"",$alias[$inc]);
- $exp5 = explode("/",$exp4[1]);
- $alias_name = $exp5[1];
- if (stristr($_POST['alias_name'], $alias_name) !== FALSE)
- {
- $name_test = FALSE;
- }
- $inc++;
- }
-
- $banned = array("alias", "directory", "home", "error", "icons", "manual");
- foreach ($banned as $value) {
- if (stristr($_POST['alias_name'], $value) !== FALSE)
- {
- $name_test = FALSE;
- }
- }
-
- if ($_POST['alias_name'] == "")
- {
- echo "<img src='images_easyphp/exclam.gif' width='8' height='14' alt='warning' />$alias_warning_1<br />";
- echo "[ <a href=\"javascript:history.back()\">$alias_back</a> ]";
- }
- elseif ($_POST['alias_link'] == "")
- {
- echo "<img src='images_easyphp/exclam.gif' width='8' height='14' alt='warning' />$alias_warning_2<br />";
- echo "[ <a href=\"javascript:history.back()\">$alias_back</a> ]";
- }
- elseif ($_POST['alias_link'] != "" & !is_dir($_POST['alias_link']))
- {
- echo "<img src='images_easyphp/exclam.gif' width='8' height='14' alt='warning' />$alias_warning_3<br />";
- echo "[ <a href=\"javascript:history.back()\">$alias_back</a> ]";
- }
- elseif ($name_test == FALSE)
- {
- echo "<img src='images_easyphp/exclam.gif' width='8' height='14' alt='warning' />$alias_warning_4<br />";
- echo "[ <a href=\"javascript:history.back()\">$alias_back</a> ]";
- }
- else
- {
- read_alias();
- $dir = ereg_replace("\r\n","\n",$_POST['dir']);
- $alias_link = str_replace("\\","/", $_POST['alias_link']);
-
- if (substr($alias_link, -1) == "/"){$alias_link = substr($alias_link,0,strlen($alias_link)-1);}
- $new_alias = "Alias \"/";
- $new_alias .= $_POST['alias_name'];
- $new_alias .= "\" \"";
- $new_alias .= $alias_link;
- $new_alias .= "/\"\n";
- $new_alias .= "<Directory \"$alias_link\">\n".$dir."</Directory>\r\n";
- $conf = $httpd_1."#alias".$httpd_2.$new_alias."#alias".$httpd_3;
- $fp2 = fopen($source, "w");
- fputs($fp2,$conf);
- fclose($fp2);
- read_alias();
- list_alias();
- }
- }
- elseif ($_GET['to'] == "del_alias")
- {
- read_alias();
- $conf_del_alias = $httpd_1."#alias\n";
- $x = 1;
- while($x<=$nb_alias)
- {
- if ($x != $_GET['num_alias'])
- {
- $conf_del_alias = $conf_del_alias.$alias[$x].$directory[$x];
- }
- $x++;
- }
- $conf_del_alias = $conf_del_alias."#alias".$httpd_3;
- $fp3 = fopen($source, "w");
- fputs($fp3,$conf_del_alias);
- fclose($fp3);
- read_alias();
- list_alias();
- }
- else
- {
- read_alias();
- list_alias();
- }
- //===========================================================================================
- ?>
- </div>
-
- <div class="content_left">
- <img src="images_easyphp/php.gif" width="38" height="18" alt="PHP" border="0" />
- <?php version($version_php) ?>
- </div>
- <div class="content_right">
- <?php
- button($extensions_title, "index.php", "", "#7F7767", 1);
- button($phpinfo, "phpinfo.php", "", "#7F7767", 0);
- button($licence, "licence_php5.php", "", "#7F7F7F", 0);
-
- //===========================================================================================
- echo "<div class='extensions'>";
- $extensions = @get_loaded_extensions();
- printf($extensions_nb . " ", count($extensions));
- printf("[<a href='index.php?to=ext'>%s</a>]<br />", $extensions_show);
- if ($_GET['to']=="ext")
- {
- @sort($extensions);
- foreach($extensions as $extension)
- {
- echo "<div><img src='/images_easyphp/extension.gif' width='16' height='11' alt='extension' border='0' /><span class='extension_name'>$extension</span> [<a href='index.php?to=ext&exts=$extension'>$extensions_functions</a>]</div>";
- if ($_GET['exts']==$extension)
- {
- $functions = @get_extension_funcs($_GET['exts']);
- @sort($functions);
- foreach($functions as $function)
- {
- echo "<div class='function_name'><img src='images_easyphp/function.gif' width='16' height='11' alt='function' border='0' />" . $function . "</div>";
- }
- echo "<br />";
- }
- }
- }
- echo "</div>";
- //===========================================================================================
- ?>
- </div>
-
-
- <div class="content_left">
- <img src="images_easyphp/phpmyadmin.gif" width="128" height="18" alt="PhpMyAdmin" border="0" />
- <?php version($version_phpmyadmin) ?>
- </div>
- <div class="content_right">
- <?php
- button($mysql_manager, "mysql", "target='_blank'", "#7F7767", 0);
- button($licence, "licence_phpmyadmin.php", "", "#7F7F7F", 0);
- ?>
- </div>
-
-
- <div class="content_left">
- <img src="images_easyphp/sqlitemanager.gif" width="158" height="18" alt="SQLite" border="0" />
- <?php version($version_sqlitemanager) ?>
- </div>
- <div class="content_right">
- <?php
- button($sqlite_manager, "sqlite", "target='_blank'", "#7F7767", 0);
- button($licence, "licence_sqlitemanager.php", "", "#7F7F7F", 0)
- ?>
- </div>
-
-
- <div class="content_left">
- <img src="images_easyphp/mysql.gif" width="68" height="18" alt="MySQL" border="0" />
- <?php version($version_mysql) ?>
- </div>
- <div class="content_right">
- <?php button($licence, "licence_mysql.php", "", "#7F7F7F", 0) ?>
- </div>
-
- </div>
- </div>
-
- </body>
- </html>