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.

admindomains.php 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?PHP
  2. if (!defined('ADMIN') || !ADMIN) { die('Admins only'); }
  3. ?>
  4. <div class="block" id="domains">
  5. <h2>ADMIN: All domains</h2>
  6. <table class="innerblock">
  7. <tr><th>&nbsp;</th><th>Domain</th><th>User</th><th>Site</th>
  8. <th>DNS</th>
  9. <th>Enabled?</td></tr>
  10. <?PHP
  11. $sql = 'SELECT domain_id, domain_name, domain_enabled, domains.user_id, user_name FROM domains NATURAL JOIN users ORDER BY user_name, domain_name';
  12. $res = mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  13. $i = 0;
  14. while ($row = mysql_fetch_array($res)) {
  15. $sql2 = 'SELECT r.record_value, s.site_name, s.site_id 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';
  16. $res2 = mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  17. if (mysql_num_rows($res2) > 0) {
  18. $row2 = mysql_fetch_array($res2);
  19. $asite = $row2['site_name'];
  20. $asiteid = $row2['site_id'];
  21. } else {
  22. $asite = '';
  23. }
  24. ?>
  25. <tr class="<?PHP echo ($i == 0) ? 'even' : 'odd'; ?>">
  26. <td><?PHP echo h($row['domain_id']); ?></td>
  27. <td><?PHP echo h($row['domain_name']); ?></td>
  28. <td><a href="<?PHP echo CP_PATH.'checkuser/'.$row['user_id']; ?>"><?PHP echo h($row['user_name']); ?></a></td>
  29. <td><?PHP if ($asite != '') { ?>
  30. <a href="<?PHP echo CP_PATH; ?>editsite/<?PHP echo $asiteid; ?>"><?PHP echo h($asite); ?></a>
  31. </td>
  32. <?PHP } else { ?>None</td><?PHP } ?><td>
  33. <?PHP if (gethostbyname($row['domain_name']) != '63.246.141.80') { ?>
  34. <a href="<?PHP echo CP_PATH; ?>support/017" style="color: red;">Error</a>
  35. <?PHP } else { echo 'OK'; } ?>
  36. </td><td>
  37. <?PHP if ($row['domain_enabled'] != '1') { ?>
  38. <a href="<?PHP echo CP_PATH; ?>enabledomain/<?PHP echo $row['domain_id']; ?>">Enable</a>
  39. <?PHP } else { echo 'Enabled'; } ?>
  40. </td>
  41. </tr>
  42. <?PHP
  43. $i = 1 - $i;
  44. }
  45. ?>
  46. </table>
  47. </div>
  48. </div>