diff --git a/addressbook/doc/fieldnames.txt b/addressbook/doc/fieldnames.txt new file mode 100644 index 0000000000..88b5ba8fe6 --- /dev/null +++ b/addressbook/doc/fieldnames.txt @@ -0,0 +1,60 @@ +This are the internal fieldnames and their meaning of the 1.4 addressbook: +------------------------------------------------------------------------- +id => Contact ID +tid => Typ +owner => Addressbook +private => private +cat_id => Category +n_prefix => prefix +n_given => first name +n_middle => middle name +n_family => last name +n_suffix => suffix +n_fn => full name +n_fileas => own sorting +bday => birthday +org_name => Company +org_unit => Department +title => Title +role => Role +assistent => Assistent +room => Room +adr_one_street => street business +adr_one_street2 => address line 2 business +adr_one_locality => city business +adr_one_region => state business +adr_one_postalcode => zip code business +adr_one_countryname => country business +label => label +adr_two_street => street private +adr_two_street2 => address line 2 private +adr_two_locality => city private +adr_two_region => state private +adr_two_postalcode => zip code private +adr_two_countryname => country private +tel_work => work phone +tel_cell => mobile phone +tel_fax => fax business +tel_assistent => assistent phone +tel_car => car phone +tel_pager => pager +tel_home => home phone +tel_fax_home => fax private +tel_cell_private => mobile phone private +tel_other => other phone +tel_prefer => preferred phone +email => email business +email_home => email private +url => url business +url_home => url private +freebusy_uri => Freebusy URI +calendar_uri => Calendar URI +note => note +tz => time zone +geo => geo +pubkey => public key +created => created +creator => created by +modified => last modified +modifier => last modified by +jpegphoto => photo diff --git a/admin/admin-cli.php b/admin/admin-cli.php index c79ca85153..f37996a296 100755 --- a/admin/admin-cli.php +++ b/admin/admin-cli.php @@ -51,6 +51,9 @@ switch($action) case '--change-account-id': return do_change_account_id($arg0s); + + case '--check-acl'; + return do_check_acl(); default: usage($action); @@ -100,9 +103,28 @@ function usage($action=null,$ret=0) echo " Deletes a user from eGroupWare. It's data can be moved to an other user or it get deleted too.\n"; echo "--change-account-id admin-account[@domain],admin-password,from1,to1[...,fromN,toN]\n"; echo " Changes one or more account_id's in the database (make a backup before!).\n"; + echo "--check-acl admin-account[@domain],admin-password\n"; + echo " Deletes ACL entries of not longer existing accounts (make a database backup before!).\n"; exit; } +function do_check_acl() +{ + $deleted = 0; + if (($all_accounts = $GLOBALS['egw']->accounts->search(array('type'=>'both')))) + { + $ids = array(); + foreach($all_accounts as $account) + { + $ids[] = $account['account_id']; + } + // does not work for LDAP! $ids = array_keys($all_accounts); + $GLOBALS['egw']->db->query("DELETE FROM egw_acl WHERE acl_account NOT IN (".implode(',',$ids).") OR acl_appname='phpgw_group' AND acl_location NOT IN ('".implode("','",$ids)."')",__LINE__,__FILE__); + $deleted = $GLOBALS['egw']->db->affected_rows(); + } + echo "\n$deleted ACL records of not (longer) existing accounts deleted.\n\n"; +} + /** * Delete a given user from eGW * diff --git a/admin/check_acl.php b/admin/check_acl.php deleted file mode 100644 index c487180e1c..0000000000 --- a/admin/check_acl.php +++ /dev/null @@ -1,47 +0,0 @@ - * -* -------------------------------------------- * -* 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 egw_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(); diff --git a/etemplate/inc/class.uietemplate.inc.php b/etemplate/inc/class.uietemplate.inc.php index 83ac1078ef..d04b49b5c3 100644 --- a/etemplate/inc/class.uietemplate.inc.php +++ b/etemplate/inc/class.uietemplate.inc.php @@ -281,7 +281,7 @@ } else { - echo '