home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / configuration / groups / index.php < prev   
PHP Script  |  2004-03-08  |  3KB  |  68 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12. require("../../Group-Office.php");
  13. $GO_SECURITY->authenticate();
  14. require($GO_LANGUAGE->get_language_file('groups'));
  15. //load group management class
  16. require($GO_CONFIG->class_path."groups.class.inc");
  17. $groups = new groups();
  18.  
  19. //load contact management class
  20. require($GO_CONFIG->class_path."users.class.inc");
  21. $users = new users();
  22.  
  23. //perform on delete request
  24. if (isset($_REQUEST['delete_group']))
  25. {
  26.     //only owners can delete groups
  27.     if ($groups->user_owns_group($GO_SECURITY->user_id, $_REQUEST['delete_group']) && $_REQUEST['delete_group'] != $groups->group_everyone && $_REQUEST['delete_group'] != $groups->group_root)
  28.     {
  29.         $groups->delete_group($_REQUEST['delete_group']);
  30.     }else
  31.     {
  32.         $feedback = "<P class=\"Error\">".$strAccessDenied."</p>";
  33.     }
  34. }
  35.  
  36. $page_title = $groups_title;
  37. require($GO_THEME->theme_path."header.inc");
  38.  
  39. $tabtable = new tabtable('groups', $groups_title, '600', '300');
  40.  
  41. $tabtable->print_head();
  42. echo '<table cellpadding="4" cellspacing="0" border="0">';
  43. if (isset($feedback))
  44. {
  45.     echo $feedback;
  46. }
  47. echo '<tr height="30"><td colspan="3"><a href="'.$GO_CONFIG->host.'configuration/groups/group.php" class="normal">'.$cmdAdd.'</a></td></tr>';
  48. echo '<tr><td><h3>'.$strName.'</h3></td>';
  49. echo '<td><h3>'.$strOwner.'</h3></td><td> </td></tr>';
  50.  
  51. //show the groups the user is in and owns.
  52. $groups->get_authorised_groups($GO_SECURITY->user_id);
  53. while ($groups->next_record())
  54. {
  55.     echo '<tr>';
  56.     echo "<td><a class=\"normal\" href=\"group.php?group_id=".$groups->f("id")."&group_name=".$groups->f("name")."\">".$groups->f("name")."</a></td>\n";
  57.     echo "<td>".show_profile($groups->f("user_id"))."</td>\n";
  58.     echo "<td><a href='javascript:confirm_action(\"".$_SERVER['PHP_SELF']."?delete_group=".$groups->f("id")."\",\"".rawurlencode($strDeletePrefix."'".$groups->f("name")."'".$strDeleteSuffix)."\")' title=\"".$strDeleteItem." '".$groups->f("name")."'\"><img src=\"".$GO_THEME->images['delete']."\" border=\"0\"></a></td>\n";
  59.     echo "</tr>";
  60. }
  61. echo '</table>';
  62. echo '<br />';
  63. $button = new button($cmdClose, "javascript:document.location='".$GO_CONFIG->host."configuration/'");
  64. $tabtable->print_foot();
  65.  
  66. require($GO_THEME->theme_path."footer.inc");
  67. ?>
  68.