Unsupported scripts and control panel web app for a hosting company
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

editsite.php 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?PHP
  2. if (!isset($error)) {
  3. if (!defined('SUSER')) { define('SUSER', USER); define('SUID', UID); }
  4. ?>
  5. <div class="block">
  6. <h2>General settings and tools</h2>
  7. <table class="innerblock righthead">
  8. <tr>
  9. <th>Site name</th>
  10. <td><?PHP echo h(SITE_NAME); ?></td>
  11. </tr>
  12. <tr>
  13. <th>Document root</th>
  14. <td><?PHP echo h(substr(SITE_DOCROOT,strlen('/home/'.SUSER))); ?></td>
  15. </tr>
  16. </table>
  17. </div>
  18. <div class="block">
  19. <h2>Webserver settings</h2>
  20. <table class="innerblock righthead">
  21. <tr>
  22. <th>Enable .htaccess files</th>
  23. <td><input type="checkbox" name="htaccess"></td>
  24. </tr>
  25. <tr>
  26. <th>Allow directory indexing</th>
  27. <td><input type="checkbox" name="override"></td>
  28. </tr>
  29. <tr>
  30. <th>PHP Version</th>
  31. <td>
  32. <?PHP
  33. $targets = array('stable', 'dev', 'legacy');
  34. foreach ($targets as $php) {
  35. $binary = '/usr/local/php-'.$php.'/bin/php';
  36. if (!file_exists($binary)) { continue; }
  37. echo '<label><input type="radio" name="php" value="'.$php.'">'.ucfirst($php);
  38. echo '</label>';
  39. }
  40. ?>
  41. </td>
  42. </tr>
  43. </table>
  44. </div>
  45. <div class="block">
  46. <h2>Domain associations</h2>
  47. <div class="innerblock">
  48. <p class="blurb">
  49. To view this website, you must associate it with at least one domain name.
  50. You will then be able to view the site simply by typing the domain name
  51. in your browser.
  52. </p>
  53. <form action="<?PHP echo CP_PATH; ?>editsite" method="POST">
  54. <input type="hidden" name="task" value="domains">
  55. <input type="hidden" name="site" value="<?PHP echo SITE_ID; ?>">
  56. <table class="form">
  57. <?PHP
  58. $sql = 'SELECT domain_id, domain_name FROM domains WHERE domain_enabled = 1 AND user_id = '.SUID;
  59. $res = mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  60. while ($row = mysql_fetch_array($res)) {
  61. $sql2 = 'SELECT r.record_value, s.site_name FROM records AS r, sites AS s WHERE r.domain_id = '.$row['domain_id'].' AND r.record_type = \'UTD\' AND s.site_id = r.record_value';
  62. $res2 = mysql_query($sql2) or mf(__FILE__, __LINE__, $sql2);
  63. if (mysql_num_rows($res2) > 0) {
  64. $row2 = mysql_fetch_array($res2);
  65. $asite = $row2['site_name'];
  66. } else {
  67. $asite = '';
  68. }
  69. ?>
  70. <tr>
  71. <td><input type="checkbox" id="domain<?PHP echo $row['domain_id']; ?>" name="domain<?PHP echo $row['domain_id']; ?>"<?PHP if ($asite == SITE_NAME) { echo " checked=\"checked\""; } elseif ($asite != '') { echo " disabled=\"disabled\""; } ?>></td>
  72. <td><?PHP echo h($row['domain_name']); ?></td>
  73. <td><?PHP if ($asite != '' && $asite != SITE_NAME) { ?>
  74. Already associated with <?PHP echo h($asite); ?>.
  75. <?PHP } ?>
  76. </td>
  77. </tr>
  78. <?PHP
  79. }
  80. ?>
  81. <tr><td colspan="2" style="text-align: right"><input type="submit" value="Save"></td></tr>
  82. </table>
  83. </form>
  84. </div>
  85. </div>
  86. <?PHP
  87. } else {
  88. echo '<div id="message"><div>'.$error.'</div></div>';
  89. }
  90. ?>