PageRenderTime 58ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/rev3/roots.php

https://gitlab.com/BGCX261/zombiecms-svn-to-git
PHP | 97 lines | 97 code | 0 blank | 0 comment | 16 complexity | 8ece85deef0d3c852ebe3e60d3b8e31a MD5 | raw file
  1. <?php ob_start(); ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  3. <?php
  4. include("functions.inc.php");
  5. include("user_settings.inc.php");
  6. if(!isset($_SESSION["admin_rights"]) || $_SESSION["admin_rights"] < 5) send_to_notify("error", 3);
  7. $con = connect_and_select($GLOBALS["db_name"]);
  8. ?>
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11. <meta http-equiv="Content-Type" content="html/xml; charset=ISO-8859-1"/>
  12. <meta name="author" content="" />
  13. <meta name="description" content="" />
  14. <meta name="keywords" content="" />
  15. <title>Roots - ZombieCMS</title>
  16. <script type="text/javascript" src="lib/js/prototype.js"></script>
  17. <script type="text/javascript" src="lib/js/scriptaculous.js?load=effects,dragdrop,builder,controls"></script>
  18. <script type="text/javascript" src="lib/js/rounded_corners_lite.inc.js"></script>
  19. <script type="text/javascript" src="lib/js/scripts.js"></script>
  20. <?php if($GLOBALS["enable_contextmenu"]) { ?><script type="text/javascript" src="lib/js/context.js"></script><?php } ?>
  21. <link rel="shortcut icon" href="images/favicon.ico" />
  22. <link rel="stylesheet" type="text/css" media="screen" href="lib/css/<?php echo $GLOBALS["theme"] ?>/divs.css" />
  23. <link rel="stylesheet" type="text/css" media="screen" href="lib/css/<?php echo $GLOBALS["theme"] ?>/styles.css" />
  24. <link rel="stylesheet" type="text/css" media="screen" href="lib/css/<?php echo $GLOBALS["theme"] ?>/menu.css" />
  25. <link rel="stylesheet" type="text/css" media="screen" href="lib/css/<?php echo $GLOBALS["theme"] ?>/links.css" />
  26. </head>
  27. <body id="roots">
  28. <div id="top"><img src="images/logo.png" alt="logo" id="logo" /><div id="quickboard"><a href="#search" id="show_search"><img src="images/icons/search.png" alt="search" /></a><a href="settings.php"><img src="images/icons/settings.png" alt="settings" /></a><a href="#empty"><img src="images/icons/about.png" alt="about" /></a><a href="log.php?dir=out"><img src="images/icons/logout.png" alt="logout" /></a></div>
  29. <div id="menu"><?php include ("zombie_menu.inc.php"); ?></div></div>
  30. <div id="main">
  31. <?php include("searchbox.inc.php"); ?>
  32. <?php if($GLOBALS["enable_notifications"] == true) include ("notification_system.inc.php"); ?>
  33. <div class="col">
  34. <div class="listview"> <!-- roots -->
  35. <img src="images/icons/roots.png" alt="roots"/> <strong>Top Roots</strong>
  36. <table cellspacing="0"><tr class="light_blue"><th>Name</th><th>Rights</th><th>PM</th><th>Del</th></tr>
  37. <?php
  38. $roots = mysql_query("SELECT name, rights, id FROM zombie_roots ORDER BY rights DESC LIMIT 10");
  39. $i = 1;
  40. while($row = mysql_fetch_array($roots)) {
  41. if($i % 2 == 0) echo "<tr class=\"light_blue\">";
  42. else echo "<tr class=\"dark_blue\">";
  43. echo "<td style=\"width: 60%\"><a href=\"roots.php?id=".$row["id"]."\">",$row["name"],"</a></td><td style=\"width: 20%\">",$row["rights"],"/5</td><td style=\"width: 10%\"><img src=\"images/icons/pm.png\" alt=\"pm\" /></td><td style=\"width: 10%\">"; if($row['rights'] < 5 || $row["id"] == 1) { echo "<a href=\"engine.php?action=del_root&amp;id=".$row["id"]."\"><img src=\"images/icons/inline/trash.png\" alt=\"trash\"/></a>";} echo "</td></tr>";
  44. $i++; }
  45. ?>
  46. </table>
  47. </div>
  48. </div>
  49. <div class="col">
  50. <h2>Root Management</h2>
  51. <ul class="tabs" title="blue">
  52. <?php if(isset($_GET["id"])) { ?><li class="tab blue"><a href="#empty" id="mod_tab"><img src="images/icons/inline/modify.png" alt="modify"/>Modify</a></li><?php } ?>
  53. <li class="tab blue"><a href="#empty" id="add_tab"><img src="images/icons/inline/add.png" alt="add"/>Add</a></li>
  54. <li class="tab blue"><a href="#empty" id="search_tab"><img src="images/icons/inline/find.png" alt="search"/>Search</a></li>
  55. </ul>
  56. <?php if(isset($_GET["id"])) { ?><div class="tabbed_content back_blue" id="content_mod_tab">
  57. <form method="post" class="root_form" action="engine.php?action=mod_root&amp;id=<?php echo $_GET["id"]; ?>" enctype="plain/text">
  58. <h2>Modify Root-User</h2>
  59. <?php $root = get_entities("zombie_roots", $_GET["id"], array("name", "mail", "rights"));?>
  60. <p>Name: <strong><?php echo $root["name"]; ?></strong><br />
  61. Mail: <strong><?php echo $root["mail"]; ?></strong></p>
  62. <p>
  63. <label for="mod_rights">Rights</label><select name="mod_rights" id="mod_rights"><option value="<?php echo $root["rights"]; ?>"><?php echo $root["rights"];?></option>
  64. <option>----------------------------</option>
  65. <?php for($i = 1; $i<=5; $i++) echo "<option value=\"$i\">$i</option>"; ?></select>
  66. <input type="submit" class="btn" value="Redeploy" id="mod_root_btn"/><img src="images/btn_right.png" class="btn_right" alt="btn_right"/>
  67. </p>
  68. </form>
  69. </div><?php } ?>
  70. <div class="tabbed_content back_blue" id="content_add_tab">
  71. <form method="post" class="root_form" action="engine.php?action=add_root" enctype="plain/text" id="add_root_form">
  72. <h2>Add a root-user</h2>
  73. <p>
  74. <label for="add_name">Username</label> <input type="text" id="add_name" name="add_name" />
  75. <label for="add_pass">Password</label> <input type="password" id="add_pass" name="add_pass" />
  76. <label for="add_repass">Re-type Password</label> <input type="password" id="add_repass" name="add_repass" />
  77. <label for="add_mail">E-Mail</label> <input type="text" id="add_mail" name="add_mail" />
  78. <label for="add_rights">Rights</label> <select id="add_rights" name="add_rights">
  79. <?php for($i = 1; $i<=5; $i++) echo "<option value=\"$i\">$i</option>"; ?></select>
  80. <input type="button" value="Call for reinforcements" class="btn" id="add_root_btn"/><img src="images/btn_right.png" class="btn_right" alt="btn_right"/>
  81. </p>
  82. </form>
  83. </div>
  84. <div class="tabbed_content back_blue" id="content_search_tab">
  85. <form method="get" class="root_form" action="search.php?type=root" enctype="plain/text" id="search_root_form">
  86. <h2>Find a Root-User</h2>
  87. <p>
  88. <label for="search_query">Name or Mail</label> <input type="text" name="search_query" id="search_query" />
  89. <input type="button" value="He's gotta be there somewhere" class="btn" id="search_root_btn" /><img src="images/btn_right.png" class="btn_right" alt="btn_right" />
  90. </p>
  91. </form>
  92. </div>
  93. </div>
  94. </div>
  95. </body>
  96. </html>
  97. <?php mysql_close($con);?>