show_users.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <script type="text/javascript" src="js/modules/show_users.js"></script>
  2. <style type="text/css">
  3. tr.hide{
  4. display: none;
  5. }
  6. table.userListTable{
  7. border-collapse: collapse;
  8. border: 0px;
  9. }
  10. table.userListTable td{
  11. padding-left: 5px;
  12. }
  13. tr.subusersShowHide{cursor: pointer;}
  14. th.subuserColumn{
  15. width: 140px;
  16. }
  17. td.actions{
  18. cursor: default;
  19. }
  20. </style>
  21. <?php
  22. /*
  23. *
  24. * OGP - Open Game Panel
  25. * Copyright (C) Copyright (C) 2008 - 2013 The OGP Development Team
  26. *
  27. * http://www.opengamepanel.org/
  28. *
  29. * This program is free software; you can redistribute it and/or
  30. * modify it under the terms of the GNU General Public License
  31. * as published by the Free Software Foundation; either version 2
  32. * of the License, or any later version.
  33. *
  34. * This program is distributed in the hope that it will be useful,
  35. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  36. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  37. * GNU General Public License for more details.
  38. *
  39. * You should have received a copy of the GNU General Public License
  40. * along with this program; if not, write to the Free Software
  41. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  42. *
  43. */
  44. function exec_ogp_module() {
  45. global $db;
  46. echo '<h2>'.get_lang('users')."</h2>";
  47. echo "<p><a href='?m=user_admin&amp;p=add'>".get_lang('add_new_user')."</a></p>";
  48. echo '<table class="userListTable center" style="width: 100%;">';
  49. echo '<tr><th>'.get_lang('actions')."</th><th>".get_lang('username')."</th>";
  50. echo "<th>".get_lang('user_role')."</th>";
  51. echo "<th>".get_lang('email_address')."</th>";
  52. echo "<th>".get_lang('expires')."</th>";
  53. echo "<th class='subuserColumn'>".get_lang('subusers')."</th></tr>";
  54. $result = $db->getUserList();
  55. $i = 0;
  56. foreach ( $result as $row )
  57. {
  58. // Show user's parent
  59. $ownedBy = "";
  60. if(!is_null($row['users_parent'])){
  61. $ownedBy = $row['users_parent'];
  62. }
  63. $user_expires = read_expire($row['user_expires']);
  64. print "<tr class='tr".($i++%2)." ";
  65. print $row['users_role'] . " ";
  66. if(!empty($ownedBy)){
  67. print "hide";
  68. }else{
  69. print "subusersShowHide";
  70. }
  71. print "' uid='" . $row['user_id'] . "'";
  72. if(!empty($ownedBy)){
  73. print "ownedby='" . $ownedBy . "'";
  74. }
  75. print ">";
  76. print "<td class='actions'><a href='?m=user_games&amp;p=assign&amp;user_id=$row[user_id]'>[".
  77. get_lang('assign_homes')."]</a><br />
  78. <a href='?m=user_admin&amp;p=del&amp;user_id=$row[user_id]'>[".get_lang('delete')."]</a><br />
  79. <a href='?m=user_admin&amp;p=edit_user&amp;user_id=$row[user_id]'>[".get_lang('edit_profile')."]</a></td>
  80. <td>".htmlentities($row['users_login'])."</td><td>".htmlentities($row['users_role'])."</td>
  81. <td>".htmlentities($row['users_email'])."</td>
  82. <td>$user_expires</td>";
  83. if(!empty($ownedBy)){
  84. print "<td></td>";
  85. }else{
  86. print "<td class='subUserShowHideTextTd expand' showtext='" . get_lang('show_subusers') . "' hidetext='" . get_lang('hide_subusers') . "'>" . get_lang('show_subusers') . " &darr;</td>";
  87. }
  88. print "</tr>";
  89. }
  90. echo '</table>';
  91. }
  92. ?>