[ Index ] |
|
Code source de CMS made simple 1.0.5 |
1 <?php 2 #CMS - CMS Made Simple 3 #(c)2004 by Ted Kulp (wishy@users.sf.net) 4 #This project's homepage is: http://cmsmadesimple.sf.net 5 # 6 #This program is free software; you can redistribute it and/or modify 7 #it under the terms of the GNU General Public License as published by 8 #the Free Software Foundation; either version 2 of the License, or 9 #(at your option) any later version. 10 # 11 #This program is distributed in the hope that it will be useful, 12 #but WITHOUT ANY WARRANTY; without even the implied warranty of 13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 #GNU General Public License for more details. 15 #You should have received a copy of the GNU General Public License 16 #along with this program; if not, write to the Free Software 17 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 # 19 #$Id: deletegroup.php 3360 2006-08-22 01:39:33Z wishy $ 20 21 $CMS_ADMIN_PAGE=1; 22 23 require_once ("../include.php"); 24 require_once ("../lib/classes/class.group.inc.php"); 25 26 check_login(); 27 28 $group_id = -1; 29 if (isset($_GET["group_id"])) 30 { 31 $group_id = $_GET["group_id"]; 32 $group_name = ""; 33 $userid = get_userid(); 34 $access = check_permission($userid, 'Remove Groups'); 35 # you can't delete admin group (also admin group it's the first group) 36 if ($access && $group_id != 1) 37 { 38 $result = false; 39 40 global $gCms; 41 $groupops =& $gCms->GetGroupOperations(); 42 $groupobj = $groupops->LoadGroupByID($group_id); 43 $group_name = $groupobj->name; 44 45 #Perform the deletegroup_pre callback 46 foreach($gCms->modules as $key=>$value) 47 { 48 if ($gCms->modules[$key]['installed'] == true && 49 $gCms->modules[$key]['active'] == true) 50 { 51 $gCms->modules[$key]['object']->DeleteGroupPre($groupobj); 52 } 53 } 54 55 Events::SendEvent('Core', 'DeleteGroupPre', array('group' => &$groupobj)); 56 57 if ($groupobj) 58 { 59 $result = $groupobj->Delete(); 60 } 61 62 #Perform the deletegroup_post callback 63 foreach($gCms->modules as $key=>$value) 64 { 65 if ($gCms->modules[$key]['installed'] == true && 66 $gCms->modules[$key]['active'] == true) 67 { 68 $gCms->modules[$key]['object']->DeleteGroupPost($groupobj); 69 } 70 } 71 72 Events::SendEvent('Core', 'DeleteGroupPost', array('group' => &$groupobj)); 73 74 if ($result == true) 75 { 76 audit($group_id, $group_name, 'Deleted Group'); 77 } 78 } 79 } 80 81 redirect("listgroups.php"); 82 83 # vim:ts=4 sw=4 noet 84 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Tue Apr 3 18:50:37 2007 | par Balluche grâce à PHPXref 0.7 |