home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2005 June / PCpro_2005_06.ISO / files / opensource / xamp / xampp-win32.exe / xampp / security.php < prev    next >
Encoding:
Text File  |  2004-12-04  |  8.5 KB  |  303 lines

  1. <html>
  2. <head>
  3. <meta name="author" content="Kai Oswald Seidler">
  4. <link href="xampp.css" rel="stylesheet" type="text/css">
  5. </head>
  6.  
  7. <body>
  8. <? include("lang/".file_get_contents("lang.tmp").".php"); ?>
  9.  <br>
  10.  
  11. <h1><?=$TEXT['security-head']?>  <?include(".secureversion")?></h1>
  12.  
  13.  
  14. <?=$TEXT['security-text1']?><p>
  15.  
  16.  
  17. <?
  18.  
  19.     
  20.     $i=0;
  21.  
  22.     function line($head,$textok,$info,$running,$notonload,$command)
  23.     {
  24.         $host="127.0.0.1";
  25.         $timeout="1";
  26.         global $i,$TEXT;
  27.         $curdir = getcwd();
  28. list ($partwampp, $directorwampp) = spliti ('\\\htdocs', $curdir);
  29. $htaccess=".htaccess";
  30. $configinc="config.inc.php";
  31. global $htxampp;
  32. global $phpmyadminconf;
  33.  
  34. $htxampp=$partwampp."\htdocs\\xampp\\".$htaccess;
  35.  
  36. $phpmyadminconf=$partwampp."\phpmyadmin\\".$configinc;
  37.  
  38. if ($command=="phpmyadmin")
  39.         {
  40.     if (file_exists($phpmyadminconf)) 
  41.     {
  42.     $datei = fopen($phpmyadminconf,'r');
  43.     $status=1;
  44.  
  45.     while(!feof($datei)) 
  46.     {
  47.     $zeile = fgets($datei,255);
  48.     list ($left, $right) = split ('=', $zeile);
  49.     if (preg_match("/'auth_type'/i", $left))
  50.         { 
  51.         if (preg_match("/'http'/i", $right))
  52.             { $newstatus[]="ok"; } 
  53.         elseif (preg_match("/'cookie'/i", $right))
  54.             { $newstatus[]="ok"; } 
  55.         if ($newstatus[0]=="ok")
  56.             { $status=0; } else { $status=1; }
  57.         $bla=count($newstatus);
  58.         }
  59.         
  60.  
  61.  
  62.     
  63.     }
  64.     fclose($datei); 
  65.     }
  66.     else
  67.             {
  68.         $notrun=1;
  69.             }
  70.     }
  71.  
  72.  
  73. if ($command=="mysqlroot")
  74.         {
  75. if (($handle = @fsockopen($host,"3306",$errno, $errstr,$timeout)) == true)
  76.     {
  77. @fclose($handle);
  78.     if(@mysql_connect($host,"root",""))
  79.     {
  80.         $status=1;
  81.     }
  82.     else
  83.     {
  84.         $status=0;
  85.     }
  86.     }
  87.     else
  88.             {
  89.         $notrun=1;
  90.             }
  91.  
  92.     }
  93.  
  94.         if ($command=="xampp")
  95.         {    
  96.         if (file_exists($htxampp)) 
  97.             {
  98.             $status=0;
  99.             }
  100.             else
  101.             {
  102.         $status=1;
  103.             }
  104.         }
  105.  
  106.         if ($command=="php")
  107.         {    
  108.         if(ini_get('safe_mode'))
  109.             {
  110.             $status=0;
  111.             }
  112.             else
  113.             {
  114.             $status=1;
  115.             }
  116.         }
  117.     
  118.  
  119. if ($command=="ftp")
  120.     {
  121.     if (($handle = @fsockopen($host,"21",$errno, $errstr,$timeout)) == true)
  122.     {
  123. @fclose($handle);
  124.  
  125.     $conn_id = ftp_connect("127.0.0.1"); 
  126.     $login_result = ftp_login($conn_id, "newuser", "wampp"); 
  127.     if ((!$conn_id) || (!$login_result)) 
  128.     { 
  129.        $status=0;
  130.         // die; 
  131.         } 
  132.         else {
  133.         $status=1;
  134.         ftp_quit($conn_id); 
  135.         
  136.         }
  137.     }
  138.  
  139.     else
  140.         { $notrun=1; }
  141.     
  142.     }
  143.  
  144. if (extension_loaded("imap"))
  145. {
  146. if ($command=="pop")
  147.     {
  148.     if (($handle = @fsockopen($host,"110",$errno, $errstr,$timeout)) == true)
  149.     {
  150.     @fclose($handle);
  151.     If ($mbox = imap_open ("{localhost/pop3:110}INBOX", "newuser", "wampp")) 
  152.     // $folders = imap_listmailbox ($mbox, "{127.0.0.1:110}", "*");
  153.     // if ($folders == false)
  154.         { $status=1; imap_close ($mbox); }
  155.     else
  156.         { $status=0; }
  157.     }
  158.  
  159.     else
  160.     { $notrun=1; }
  161.     
  162.     }
  163. } else
  164.     { $notload=1;}
  165.  
  166.         // system("/opt/lampp/share/lampp/$command check",$status);
  167.         if($i>0)
  168.                 {
  169.                         echo "<tr valign=bottom>";                    
  170.                         echo "<td bgcolor=#ffffff background='img/strichel.gif' colspan=4><img src=img/blank.gif width=1 height=1></td>";
  171.                         echo "</tr>";
  172.                 }
  173.  
  174.         echo "<tr bgcolor=#ffffff valign=middle><td><img src=img/blank.gif width=1 height=20></td><td class=tabval>";
  175.         if ($notload==1)
  176.         { echo $notonload; } 
  177.         if ($status==0 && ($notrun=="" || $notrun < 1))
  178.         { echo $textok; }
  179.         elseif ($notrun==1)
  180.         { echo $running; }
  181.  
  182.         else
  183.         { echo $head; }
  184.  
  185.         echo "</td>";
  186.         if($status==0 && $notrun!=1){ echo "<td>  <span class=green> ".$TEXT['security-ok']." </span></td>"; }
  187.         elseif ($status==1) { echo "<td>  <span class=red> ".$TEXT['security-nok']." </span></td>"; }
  188.         elseif($notrun==1) { echo "<td>  <span class=yellow> ".$TEXT['security-noidea']." </span></td>"; }
  189.         else { echo "<td><span class=yellow> ".$TEXT['security-noidea']." </span></td>"; }
  190.         echo "<td> </td></tr>";
  191.         
  192.         if ($notrun==1)
  193.         {echo "<tr bgcolor=#ffffff><td></td><td colspan=1 class=small>$running<br><img src=img/blank.gif width=10 height=10 border=0></td><td></td><td></td></tr>";}
  194.         
  195.  
  196.         elseif($status)
  197.         {    echo "<tr bgcolor=#ffffff><td></td><td colspan=1 class=small>$info<br><img src=img/blank.gif width=10 height=10 border=0></td><td></td><td></td></tr>"; }
  198.  
  199.         /* else if($notload!="")
  200.         {    echo "<tr bgcolor=#ffffff><td></td><td colspan=1 class=small>$notload<br><img src=img/blank.gif width=10 height=10 border=0></td><td></td><td></td></tr>"; } */
  201.         $i++;
  202.         }
  203.  
  204.  
  205.  
  206.  
  207.     echo '<table border=0 cellpadding=0 cellspacing=0>';
  208.         echo "<tr valign=top>";
  209.         echo "<td bgcolor=#fb7922 valign=top><img src=img/blank.gif width=10 height=0></td>";
  210.         echo "<td bgcolor=#fb7922 class=tabhead><img src=img/blank.gif width=250 height=6><br>".$TEXT['security-tab1']."</td>";
  211.         echo "<td bgcolor=#fb7922 class=tabhead><img src=img/blank.gif width=100 height=6><br>".$TEXT['security-tab2']."</td>";
  212.         echo "<td bgcolor=#fb7922 valign=top><br><img src=img/blank.gif width=1 height=10></td>";
  213.         echo "</tr>";
  214.  
  215.     
  216.     
  217.  
  218.     
  219.      line($TEXT['security-checkapache-nok'],$TEXT['security-checkapache-ok'],$TEXT['security-checkapache-text'],"","","xampp");
  220.      
  221. /*    line($TEXT['security-checkmysqlport-nok'],$TEXT['security-checkmysqlport-ok'],$TEXT['security-checkmysqlport-text'],"checkmysqlport"); */
  222.     /* line($TEXT['security-checkpmamysqluser-nok'],$TEXT['security-checkpmamysqluser-ok'],$TEXT['security-checkpmamysqluser-text'],"mysqlroot"); */
  223.      line($TEXT['security-checkmysql-nok'],$TEXT['security-checkmysql-ok'],$TEXT['security-checkmysql-text'],$TEXT['security-checkmysql-out'],"","mysqlroot");
  224.     
  225.      line($TEXT['security-phpmyadmin-nok'],$TEXT['security-phpmyadmin-ok'],$TEXT['security-phpmyadmin-text'],$TEXT['security-phpmyadmin-out'],"","phpmyadmin");
  226.      
  227.      line($TEXT['security-checkftppassword-nok'],$TEXT['security-checkftppassword-ok'],$TEXT['security-checkftppassword-text'],$TEXT['security-checkftppassword-out'],"","ftp"); 
  228.     
  229.     line($TEXT['security-checkphp-nok'],$TEXT['security-checkphp-ok'],$TEXT['security-checkphp-text'],$TEXT['security-checkphp-out'],"","php"); 
  230.     
  231. if (extension_loaded("imap"))
  232. { line($TEXT['security-pop-nok'],$TEXT['security-pop-ok'],$TEXT['security-pop-text'],$TEXT['security-pop-out'],$TEXT['security-pop-notload'],"pop"); }
  233.  
  234.     echo "<tr valign=bottom>";
  235.         echo "<td bgcolor=#fb7922></td>";
  236.         echo "<td bgcolor=#fb7922 colspan=3><img src=img/blank.gif width=1 height=8></td>";
  237.         echo "<td bgcolor=#fb7922></td>";
  238.         echo "</tr>";
  239.  
  240.  
  241.     echo "</table>";
  242.     echo "<p>";
  243.  
  244. ?>
  245. <?=$TEXT['security-text2']?><p>
  246. <?=$TEXT['security-text3']?><br> <p>
  247. <?=$TEXT['security-text4']?>
  248.  
  249.  
  250. <p>
  251. <table border="0">
  252. <tr>
  253. <td>ftp</td><td> </td><td><B>21</B>/tcp</td><td> </td>  
  254. <td># File Transfer [Control] (XAMPP: FTP Default Port)</td>
  255. </tr>
  256. <tr>
  257. <td>smtp</td><td> </td><td><B>25</B>/tcp</td><td> </td>  
  258. <td>mail # Simple Mail Transfer (XAMPP: SMTP Default Port)</td>
  259. </tr>
  260. <tr>
  261. <td>http</td><td> </td><td><B>80</B>/tcp</td><td> </td>  
  262. <td># World Wide Web HTTP (XAMPP: Apache Default Port)</td>
  263. </tr>
  264. <tr>
  265. <td>pop3</td><td> </td><td><B>110</B>/tcp</td><td> </td>  
  266. <td># Post Office Protocol - Version 3 (XAMPP: POP3 Default Port)</td>
  267. </tr>
  268. <tr>
  269. <td>imap</td><td> </td><td><B>143</B>/tcp</td><td> </td>  
  270. <td>imap2    # Internet Message Access Protocol (XAMPP: IMAP Default Port)</td>
  271. </tr>
  272.  
  273. <tr>
  274. <td>https</td><td> </td><td><B>443</B>/tcp</td><td> </td>  
  275. <td># http protocol over TLS/SSL (XAMPP: Apache SSL Port)</td>
  276. </tr>
  277. <tr>
  278. <td>mysql</td><td> </td><td><B>3306</B>/tcp</td><td> </td>  
  279. <td># MySQL (XAMPP: MySQL Default Port)</td>
  280. </tr>
  281. <tr>
  282. <td>AJP/1.3</td><td> </td><td><B>8009</B></td><td> </td>  
  283. <td># AJP/1.3 (XAMPP: Tomcat AJP/1.3 Port)</td>
  284. </tr>
  285. <tr>
  286. <td>http-alt</td><td> </td><td><B>8080</B>/tcp</td><td> </td>  
  287. <td># HTTP Alternate (see port 80) (XAMPP: Tomcat Default Port)</td>
  288. </tr>
  289. </table>
  290. <!-- 
  291. smtp             25/tcp    mail        # Simple Mail Transfer (XAMPP: SMTP Default Port)
  292. http             80/tcp    # World Wide Web HTTP (XAMPP: Apache Default Port)
  293. pop3            110/tcp    # Post Office Protocol - Version 3 (XAMPP: POP3 Default Port)
  294. imap            143/tcp    imap2    # Internet Message Access Protocol (XAMPP: IMAP Default Port)
  295. https           443/tcp    # http protocol over TLS/SSL (XAMPP: Apache SSL Port)
  296. mysql        3306/tcp   # MySQL (XAMPP: MySQL Default Port)
  297. AJP/1.3        8009/tcp   # AJP/1.3 (XAMPP: Tomcat AJP/1.3 Port)
  298. http-alt    8080/tcp   # HTTP Alternate (see port 80) (XAMPP: Tomcat Default Port)
  299.  -->
  300. <p> <p>
  301. </body>
  302. </html>
  303.