2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2009 */
6 /* Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
14 $_user_location = 'public';
16 define('AT_INCLUDE_PATH', '../../../../include/');
17 require(AT_INCLUDE_PATH.'vitals.inc.php');
18 require(AT_SOCIAL_INCLUDE.'constants.inc.php');
19 require(AT_SOCIAL_INCLUDE.'friends.inc.php');
20 require(AT_SOCIAL_INCLUDE.'classes/SocialGroups/SocialGroup.class.php');
21 require(AT_SOCIAL_INCLUDE.'classes/SocialGroups/SocialGroups.class.php');
24 // Get social group class
25 $social_groups = new SocialGroups();
28 $id = intval($_REQUEST['id']); //make sure $_GET and $_POST don't overlap the use of 'id'
29 $sg = new SocialGroup($id);
30 $sgs = new SocialGroups();
32 //validate if this user is the administrator of the group
33 if ($sg->getUser() != $_SESSION['member_id']){
34 $msg->addError('CANT_DELETE_GROUP');
35 header('Location: index.php');
40 $msg->addFeedback('GROUP_DELETED');
41 $sgs->removeGroup($id);
42 header('Location: '.url_rewrite(AT_SOCIAL_BASENAME.'groups/index.php', AT_PRETTY_URL_HEADER));
47 include(AT_INCLUDE_PATH.'header.inc.php');
48 $savant->assign('group_obj', $group);
49 $savant->assign('group_types', $social_groups->getAllGroupType());
50 $savant->display('sgroup_edit.tmpl.php');
51 include(AT_INCLUDE_PATH.'footer.inc.php');