PageRenderTime 46ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/public/codeCore/php/secure/adminPanel.php

https://github.com/IAmCorbin/MooKit
PHP | 109 lines | 103 code | 1 blank | 5 comment | 4 complexity | 312199a3dd540905accdb7a679dd4820 MD5 | raw file
Possible License(s): GPL-3.0
  1. <?php
  2. /**
  3. * Administration Panel
  4. * @package MooKit
  5. */
  6. //require Administrator Access
  7. if(Security::clearance() & ACCESS_ADMIN) {
  8. ?>
  9. <div id="adminPanel">
  10. <div id="adminPanelUsers">
  11. <div class="adminTitle">User Administration</div>
  12. <br />
  13. <form class="singleton" id="adminGetUsers" method="post" action="codeCore/php/secure/sharedGetUsers.php">
  14. <input type="text" name="alias" size="20" value="<? if(isset($_POST['alias'])) echo $_POST['alias']; ?>" />
  15. <input type="hidden" name="rType" value="rows" />
  16. <input type="submit" value="find users" />
  17. </form>
  18. <ul id="users_pagination" class="pagination"></ul>
  19. <table id="users">
  20. <thead>
  21. <th>ID<span class="sortArrow"></span></th>
  22. <th>Alias<span class="sortArrow"></span></th>
  23. <th>First Name<span class="sortArrow"></span></th>
  24. <th>Last Name<span class="sortArrow"></span></th>
  25. <th>Email<span class="sortArrow"></span></th>
  26. <th>Access Level<span class="sortArrow"></span></th>
  27. <th>Title<span class="sortArrow"></span></th>
  28. <th class="nosort">Delete</th>
  29. </thead>
  30. <tbody>
  31. <?
  32. if(!isset($_POST['alias'])) $_POST['alias'] = '';
  33. echo sharedGetUsers("rows", $_POST['alias']);
  34. ?>
  35. </tbody>
  36. </table>
  37. </div><!-- CLOSE ADMIN PANEL USERS -->
  38. <br />
  39. <div id="adminPanelMenu">
  40. <div class="adminTitle">Link Administration</div>
  41. <form class="singleton" id="adminGetLinks" method="post" action="codeCore/php/secure/adminGetLinks.php">
  42. <input type="text" name="name" size="20" value="<? if(isset($_POST['links'])) echo $_POST['links']; ?>" />
  43. <input type="hidden" name="rType" value="rows" />
  44. <input type="submit" value="find links" />
  45. </form>
  46. <ul id="links_pagination" class="pagination"></ul>
  47. <table id="links">
  48. <thead>
  49. <th>id</th>
  50. <th>name</th>
  51. <th>href</th>
  52. <th>description</th>
  53. <th>weight</th>
  54. <th>ajaxLink?</th>
  55. <th>menuLink?</th>
  56. <th>access level</th>
  57. <th>sublinks (right-click to remove)</th>
  58. <th class="nosort">Delete</th>
  59. </thead>
  60. <tbody>
  61. <? echo adminGetLinks("rows"); ?>
  62. </tbody>
  63. </table>
  64. <form id="adminAddLink" method="post" action="codeCore/php/secure/adminAddLink.php">
  65. <h1>Add a Link</h1>
  66. <label>
  67. <span>Link Name</span>
  68. <input name="name" type="text" size="20" />
  69. </label>
  70. <label>
  71. <span>href</span>
  72. <input name="href" type="text" size="40" />
  73. </label>
  74. <label>
  75. <span>Description</span>
  76. <input name="desc" type="text" size="20" /><- Optional:
  77. </label>
  78. <label style="float: left;">
  79. <span>Weight</span>
  80. <input name="weight" value="0" type="text" size="5" />
  81. </label>
  82. <label style="float: right;">
  83. <span>Ajax link?</span>
  84. <input name="ajaxLink" value="1" type="checkbox" />
  85. </label>
  86. <label style="float: right;">
  87. <span>Menu link?</span>
  88. <input name="menuLink" value="1" type="checkbox" />
  89. </label>
  90. <label style="float: right;">
  91. <span>Access Level</span>
  92. <select name="access_level">
  93. <option value="<?echo ACCESS_NONE;?>">NONE</option>
  94. <option value="<?echo ACCESS_BASIC;?>">BASIC</option>
  95. <option value="<?echo ACCESS_CREATE;?>">CREATE</option>
  96. <option value="<?echo ACCESS_ADMIN;?>">ADMIN</option>
  97. </select>
  98. </label>
  99. <label style="clear: both;" >
  100. <input type="submit" value="add" />
  101. </label>
  102. </form>
  103. </div>
  104. </div><!-- CLOSE ADMIN PANEL -->
  105. <?
  106. } else
  107. echo "Unauthorized";
  108. ?>