[2] | 1 | <?php |
---|
| 2 | /**************************************************************************\ |
---|
| 3 | * eGroupWare - Admin - delete ACL records of deleted accounts * |
---|
| 4 | * http://www.egroupware.org * |
---|
| 5 | * Written and (c) 2004 by Ralf Becker <RalfBecker@outdoor-training.de> * |
---|
| 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 | |
---|
| 13 | |
---|
| 14 | /** |
---|
| 15 | * delete ACL records of deleted accounts (can be called only via the URL) |
---|
| 16 | * |
---|
| 17 | * ACL records of deleted accounts have very irritating effects on the ACL (specialy calendar) |
---|
| 18 | * |
---|
| 19 | * @package admin |
---|
| 20 | * @author RalfBecker@outdoor-training.de |
---|
| 21 | * @license GPL |
---|
| 22 | */ |
---|
| 23 | |
---|
| 24 | $GLOBALS['phpgw_info'] = array( |
---|
| 25 | 'flags' => array( |
---|
| 26 | 'currentapp' => 'admin', |
---|
| 27 | )); |
---|
| 28 | include('../header.inc.php'); |
---|
| 29 | |
---|
| 30 | if (!$GLOBALS['phpgw_info']['user']['apps']['admin']) |
---|
| 31 | { |
---|
| 32 | echo '<p align="center">'.lang('Permission denied')."</p>\n"; |
---|
| 33 | } |
---|
| 34 | else |
---|
| 35 | { |
---|
| 36 | $deleted = 0; |
---|
| 37 | if (($all_accounts = $GLOBALS['phpgw']->accounts->search(array('type'=>'both')))) |
---|
| 38 | { |
---|
| 39 | $all_accounts = array_keys($all_accounts); |
---|
| 40 | $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_acl WHERE acl_account NOT IN (".implode(',',$all_accounts).") OR acl_appname='phpgw_group' AND acl_location NOT IN ('".implode("','",$all_accounts)."')",__LINE__,__FILE__); |
---|
| 41 | $deleted = $GLOBALS['phpgw']->db->affected_rows(); |
---|
| 42 | } |
---|
| 43 | echo '<p align="center">'.lang('%1 ACL records of not (longer) existing accounts deleted.',$deleted)."</p>\n"; |
---|
| 44 | } |
---|
| 45 | $GLOBALS['phpgw']->common->phpgw_footer(); |
---|
| 46 | $GLOBALS['phpgw']->common->phpgw_exit(); |
---|