Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Stuff
Friday, July 14th, 2006 at 5:06:33am MDT 

  1. <?php
  2. $files = array(
  3.         array('filename' => '../includes/config.php', 'required_perms' => '777'),
  4.         array('filename' => '../uploadimages', 'required_perms' => '777'),
  5.         array('filename' => '../templates', 'required_perms' => '755'),
  6.         array('filename' => '../cache', 'required_perms' => '755'),
  7. );
  8.  
  9. $valid = true;
  10.  
  11. foreach ($files as $file) {
  12.   //echo $filename;
  13.   $required_perms = str_pad($file['required_perms'], 4, '0');
  14.   $file_perms = substr(sprintf('%o', fileperms($file['filename'])), -4);
  15.   $file['perms'] = substr(sprintf('%o', fileperms($file['filename'])), -4);
  16.   if ($file['perms'] != $required_perms)
  17.     $valid = false;
  18. }
  19. ?>
  20. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  21. <html xmlns="http://www.w3.org/1999/xhtml">
  22. <head>
  23. <title>1Line Business Directory 1.1 | Step 2 - Configuration</title>
  24. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  25. <script language="JavaScript" type="text/javascript" src="overlib.js"></script>
  26. <link href="style.css" rel="stylesheet" type="text/css" />
  27. </head>
  28. <body bgcolor="#FFFFFF" text="#000000">
  29. <?php
  30. function check_perms($path,$perm)
  31. {
  32. $pathlocation = "../";
  33. $configmod = substr(sprintf('%o', fileperms($pathlocation . $path)), -4);
  34. $trcss = (($configmod != $perm) ? "<img src=\"error.gif\">" : "<img src=\"checkbox_green.gif\">");
  35. echo "<table width=\"50%\" border=\"0\" cellspacing=\"5\" cellpadding=\"0\" align=\"center\">";
  36. echo "<tr valign=\"middle\">";
  37. echo "<td nowrap=\"nowrap\" width=\"170\"><div align=\"left\">";
  38. echo "  <ul>";
  39. echo "    <li class=\"popupCaption\"><b>$path</b></li>";
  40. echo "  </ul>";
  41. echo "</div></td>";
  42. echo "<td nowrap=\"nowrap\" width=\"40\"><img src=\"i_01.jpg\" alt=\"Line\" width=\"40\" height=\"30\" /></td>";
  43. echo "<td width=\"100\"><div align=\"center\">$perm</div></td>";
  44. echo "<td width=\"100\"><div align=\"center\">$configmod</div></td>";
  45. echo "<td width=\"50\"><div align=\"center\">$trcss</div></td>";
  46. echo "</tr>";
  47. echo "</table>";
  48. }
  49. if(isset($_POST['send']))
  50. {
  51.     if($configmod == $perm)
  52.     {
  53.         $errmsg = '<div align="center" class="error-message">File or Folder permissions not set correctly.</div>';
  54.     }
  55. }
  56. ?>
  57. <div id="header">
  58.   <table width="100%" border="0" cellpadding="0" cellspacing="0">
  59.      <tr>
  60.        <td width="200" valign="top" ><div align="center"><img src="logo.jpg" alt="1Line Design" width="148" height="92" title="1Line Business Directory 1.1" /></div></td>
  61.      </tr>
  62.   </table>
  63. </div>
  64. <br /><table width="50%" border="0" cellspacing="5" cellpadding="0" align="center" class="stage-bg">
  65.   <tr>
  66.     <td width="48"><img src="database.gif" alt="Settings" width="48" height="48" title="Settings" /></td>
  67.     <td width="100%" height="48" class="popupCaption"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  68.       <tr>
  69.         <td><div align="left" class="stage-text">
  70.           Step 1 - Permissions
  71.         </div></td>
  72.         <td>&nbsp;</td>
  73.       </tr>
  74.       <tr>
  75.         <td><div align="left" class="stage-text">Step 2 - Configuration</div></td>
  76.         <td>&nbsp;</td>
  77.       </tr>
  78.       <tr>
  79.         <td><div align="left" class="stage-text">Step 3 - Database Installation</div></td>
  80.         <td>&nbsp;</td>
  81.       </tr>
  82.     </table>    </td>
  83.   </tr>
  84. </table>
  85. <table width="50%" border="0" align="center" cellpadding="0" cellspacing="5">
  86.   <tr>
  87.     <td><div align="center">
  88.     <?=$errmsg;?></div></td>
  89.   </tr>
  90. </table>
  91. <div class="oneline">
  92. <i><b>
  93. </b></i>
  94. <table width="50%" border="0" align="center" cellpadding="0" cellspacing="5">
  95.   <tr>
  96.     <td class="popupCaption"><div align="left">
  97.       <h3>File Permissions: </h3>
  98.     </div></td>
  99.   </tr>
  100.   <tr>
  101.     <td><div align="justify">Please ensure that all of the file permissions are set correctly to the guidelines below, if you do not complete this step you won't be able to go to the next step. When you have set the file permissions please click on refresh to  re-validate the permissions. [<a href="index.php"><span class="stage-text">refresh</span></a>] </div></td>
  102.   </tr>
  103. </table>
  104. <br />
  105. <table width="50%" border="0" align="center" cellpadding="0" cellspacing="5" class="stage-bg">
  106. <tr valign="middle">
  107. <td nowrap="nowrap" width="170"><div align="left" class="stage-text">File / Folder </div></td>
  108. <td width="40" nowrap="nowrap">&nbsp;</td>
  109. <td width="100"><div align="center" class="stage-text">Needed CHMOD </div></td>
  110. <td width="100"><div align="center" class="stage-text">Current CHMOD </div></td>
  111. <td width="50"><div align="center"></div></td>
  112. </tr>
  113. </table>
  114. <br />
  115. <?php
  116. check_perms("includes/config.php","0777");
  117. check_perms("uploadimages/","0777");
  118. check_perms("templates/","0755");
  119. check_perms("cache/","0755");
  120. ?>
  121. </t>
  122. <form action="<?php $_SERVER['REQUEST_URI']; ?>" method="post" id="form" name="form">
  123. <table width="50%" border="0" cellspacing="5" cellpadding="0" align="center">
  124. <tr>
  125. <td class="foot-bg" width="100%" height="29">&nbsp;</td>
  126. <td height="29">
  127. <input type="submit" name="send" value="Next Step" title="Go To Step 2" /></td>
  128. </tr>
  129. </table>
  130. </form>
  131. </div>
  132. <div id="footer">
  133. <p align="right">Powered by:<a href="http://www.1LineDesign.com" target="_blank" style="color:#da2e2c" title="1Line Business Directory"><br />
  134. 1Line Business Directory 1.1</a></p></div>
  135. <?php
  136.         if($errmsg =='' && $_POST['send'])
  137.         {
  138.                 echo '<script language="javascript">
  139.                 document.form.action="install.php";
  140.                 document.form.submit();
  141.                 </script>';
  142.         }       
  143. ?>
  144. </body>
  145. </html>

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right