diff --git a/addressbook/add.php b/addressbook/add.php index 577932a047..b7f13c88ee 100755 --- a/addressbook/add.php +++ b/addressbook/add.php @@ -31,7 +31,7 @@ // Read in user custom fields, if any $phpgw->preferences->read_repository(); $customfields = array(); - while (list($col,$descr) = each($phpgw_info["user"]["preferences"]["addressbook"])) { + while (list($col,$descr) = @each($phpgw_info["user"]["preferences"]["addressbook"])) { if ( substr($col,0,6) == 'extra_' ) { $field = ereg_replace('extra_','',$col); $field = ereg_replace(' ','_',$field); diff --git a/addressbook/edit.php b/addressbook/edit.php index cda445b2fb..e463c7104c 100755 --- a/addressbook/edit.php +++ b/addressbook/edit.php @@ -36,7 +36,7 @@ // Read in user custom fields, if any $phpgw->preferences->read_repository(); $customfields = array(); - while (list($col,$descr) = each($phpgw_info["user"]["preferences"]["addressbook"])) { + while (list($col,$descr) = @each($phpgw_info["user"]["preferences"]["addressbook"])) { if ( substr($col,0,6) == 'extra_' ) { $field = ereg_replace('extra_','',$col); $field = ereg_replace(' ','_',$field); @@ -45,17 +45,20 @@ } if (!$submit) { - // not checking acl here, only on submit - that ok? // merge in extra fields $extrafields = array( "ophone" => "ophone", "address2" => "address2", "address3" => "address3" ); - - $qfields = $this->stock_contact_fields + $extrafields + $customfields; - $fields = addressbook_read_entry($ab_id,$qfields); - addressbook_form("","edit.php","Edit",$fields[0],$customfields); + if ($rights & PHPGW_ACL_EDIT) { + $qfields = $this->stock_contact_fields + $extrafields + $customfields; + $fields = addressbook_read_entry($ab_id,$qfields); + addressbook_form("","edit.php","Edit",$fields[0],$customfields); + } else { + Header("Location: " . $phpgw->link('/addressbook/index.php',"cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query")); + $phpgw->common->phpgw_exit(); + } } else { if ($url == "http://") { $url = ""; diff --git a/addressbook/index.php b/addressbook/index.php index 343410c364..02459d456a 100755 --- a/addressbook/index.php +++ b/addressbook/index.php @@ -32,7 +32,7 @@ // Read in user custom fields, if any $phpgw->preferences->read_repository(); $customfields = array(); - while (list($col,$descr) = each($phpgw_info["user"]["preferences"]["addressbook"])) { + while (list($col,$descr) = @each($phpgw_info["user"]["preferences"]["addressbook"])) { if ( substr($col,0,6) == 'extra_' ) { $field = ereg_replace('extra_','',$col); $field = ereg_replace(' ','_',$field); @@ -207,9 +207,15 @@ $t->set_var(col_data,$ref.$data); $t->parse("columns","column",True); } - - $t->set_var(row_view_link,$phpgw->link("/addressbook/view.php","ab_id=$myid&start=$start&order=$order&filter=" - . "$filter&query=$query&sort=$sort")); + + if (1) { + $t->set_var(row_view_link,$phpgw->link("/addressbook/view.php","ab_id=$myid&start=$start&order=$order&filter=" + . "$filter&query=$query&sort=$sort")); + } else { + $t->set_var(row_view_link,""); + $t->set_var("lang_view",lang("Private")); + } + $t->set_var(row_vcard_link,$phpgw->link("/addressbook/vcardout.php","ab_id=$myid&start=$start&order=$order&filter=" . "$filter&query=$query&sort=$sort")); if ($rights & PHPGW_ACL_EDIT) {