diff --git a/admin/check_acl.php b/admin/check_acl.php new file mode 100644 index 0000000000..63301608e4 --- /dev/null +++ b/admin/check_acl.php @@ -0,0 +1,47 @@ + * +* -------------------------------------------- * +* This program is free software; you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the * +* Free Software Foundation; either version 2 of the License, or (at your * +* option) any later version. * +\**************************************************************************/ + +/* $Id$ */ + +/** + * delete ACL records of deleted accounts (can be called only via the URL) + * + * ACL records of deleted accounts have very irritating effects on the ACL (specialy calendar) + * + * @package admin + * @author RalfBecker@outdoor-training.de + * @license GPL + */ + +$GLOBALS['egw_info'] = array( + 'flags' => array( + 'currentapp' => 'admin', +)); +include('../header.inc.php'); + +if (!$GLOBALS['egw_info']['user']['apps']['admin']) +{ + echo '

'.lang('Permission denied')."

\n"; +} +else +{ + $deleted = 0; + if (($all_accounts = $GLOBALS['egw']->accounts->search(array('type'=>'both')))) + { + $all_accounts = array_keys($all_accounts); + $GLOBALS['egw']->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__); + $deleted = $GLOBALS['egw']->db->affected_rows(); + } + echo '

'.lang('%1 ACL records of not (longer) existing accounts deleted.',$deleted)."

\n"; +} +$GLOBALS['egw']->common->egw_footer(); +$GLOBALS['egw']->common->egw_exit();