Begin removing references to access field in prep for acl usage

This commit is contained in:
Miles Lott 2001-02-11 03:23:58 +00:00
parent 6b787678ea
commit 97c08d331e
6 changed files with 35 additions and 37 deletions

View File

@ -85,6 +85,7 @@
} }
$acl->add($phpgw_info["flags"]["currentapp"],'u_'.$user_id,$totalacl); $acl->add($phpgw_info["flags"]["currentapp"],'u_'.$user_id,$totalacl);
} }
$acl->save_repository();
} }
$processed = Array(); $processed = Array();

View File

@ -41,9 +41,7 @@
} else { } else {
$bday = "$bday_month/$bday_day/$bday_year"; $bday = "$bday_month/$bday_day/$bday_year";
} }
if ($access != "private" && $access != "public") {
$access = $phpgw->accounts->array_to_string($access,$n_groups);
}
if ($url == "http://") { if ($url == "http://") {
$url = ""; $url = "";
} }
@ -78,7 +76,6 @@
$fields["bday"] = $bday; $fields["bday"] = $bday;
$fields["url"] = $url; $fields["url"] = $url;
$fields["notes"] = $notes; $fields["notes"] = $notes;
$fields["access"] = $access;
$this->add($phpgw_info["user"]["account_id"],$fields); $this->add($phpgw_info["user"]["account_id"],$fields);

View File

@ -33,14 +33,15 @@
if (!$submit) { if (!$submit) {
// merge in extra fields // merge in extra fields
$extrafields = array ("pager" => "pager", $extrafields = array(
"pager" => "pager",
"mphone" => "mphone", "mphone" => "mphone",
"ophone" => "ophone", "ophone" => "ophone",
"access" => "access",
"address2" => "address2", "address2" => "address2",
"bday" => "bday", "bday" => "bday",
"url" => "url", "url" => "url",
"notes" => "notes"); "notes" => "notes"
);
$qfields = $this->stock_contact_fields + $extrafields; $qfields = $this->stock_contact_fields + $extrafields;
$fields = $this->read_single_entry($ab_id,$qfields); $fields = $this->read_single_entry($ab_id,$qfields);
form("","edit.php","Edit",$fields[0]); form("","edit.php","Edit",$fields[0]);
@ -53,9 +54,6 @@
} else { } else {
$bday = "$bday_month/$bday_day/$bday_year"; $bday = "$bday_month/$bday_day/$bday_year";
} }
if ($access != "private" && $access != "public") {
$access = $phpgw->accounts->array_to_string($access,$n_groups);
}
$fields["org_name"] = $company; $fields["org_name"] = $company;
$fields["org_unit"] = $department; $fields["org_unit"] = $department;
@ -87,7 +85,6 @@
$fields["bday"] = $bday; $fields["bday"] = $bday;
$fields["url"] = $url; $fields["url"] = $url;
$fields["notes"] = $notes; $fields["notes"] = $notes;
$fields["access"] = $access;
$this->update($ab_id,$phpgw_info["user"]["account_id"],$fields); $this->update($ab_id,$phpgw_info["user"]["account_id"],$fields);

View File

@ -61,7 +61,7 @@
"d_email_home" => "", //yn "d_email_home" => "", //yn
"bday" => "birthday", "bday" => "birthday",
"url" => "URL", "url" => "URL",
"access" => "access" //"access" => "access"
); );
function display_name($column) { function display_name($column) {
@ -104,7 +104,7 @@
$company = $fields["org_name"]; $company = $fields["org_name"];
$department = $fields["org_unit"]; $department = $fields["org_unit"];
$url = $fields["url"]; $url = $fields["url"];
$access = $fields["access"]; //$access = $fields["access"];
if ($format != "view") { if ($format != "view") {
$email = "<input name=\"email\" value=\"$email\">"; $email = "<input name=\"email\" value=\"$email\">";
@ -239,7 +239,8 @@
$birthday = $phpgw->common->dateformatorder($bday_year,$bday_month,$bday_day) $birthday = $phpgw->common->dateformatorder($bday_year,$bday_month,$bday_day)
. '<font face="'.$theme["font"].'" size="-2">(e.g. 1969)</font>'; . '<font face="'.$theme["font"].'" size="-2">(e.g. 1969)</font>';
/*
// This is now handled by acl code, and should go away
if ($format == "Edit") { if ($format == "Edit") {
if ($access != "private" && $access != "public") { if ($access != "private" && $access != "public") {
$access_link .= '<td><font size="-1">'.lang("Group access").':</font></td>' $access_link .= '<td><font size="-1">'.lang("Group access").':</font></td>'
@ -298,7 +299,7 @@
$access_link = ''; $access_link = '';
$t->set_var("lang_access",''); $t->set_var("lang_access",'');
} }
*/
if ($format == "view") if ($format == "view")
$create .= '<tr><td><font size="-1">'.lang("Created by").':</font></td>' $create .= '<tr><td><font size="-1">'.lang("Created by").':</font></td>'
. '<td colspan="3"><font size="-1">' . '<td colspan="3"><font size="-1">'

View File

@ -108,9 +108,11 @@
// Show the entries // Show the entries
for ($i=0;$i<count($entries);$i++) { // each entry for ($i=0;$i<count($entries);$i++) { // each entry
if ( ($entries[$i]["access"] == $filter) || $rights = $phpgw->acl->get_rights('u_'.$entries[$i]["owner"],$phpgw_info["flags"]["currentapp"]);
($entries[$i]["access"] == "," . $filter . ",") || if ( ($rights & PHPGW_ACL_READ) || ($entries[$i]["owner"] == $account_id) ) {
($filter == "") || ($filter == "none")) { //if ( ($entries[$i]["access"] == $filter) ||
// ($entries[$i]["access"] == "," . $filter . ",") ||
// ($filter == "") || ($filter == "none")) {
$t->set_var(columns,""); $t->set_var(columns,"");
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$t->set_var(row_tr_color,$tr_color); $t->set_var(row_tr_color,$tr_color);

View File

@ -22,7 +22,6 @@
include("../header.inc.php"); include("../header.inc.php");
#$t = new Template($phpgw_info["server"]["app_tpl"]);
$t = new Template($phpgw->common->get_tpl_dir("addressbook")); $t = new Template($phpgw->common->get_tpl_dir("addressbook"));
$t->set_file(array( "view" => "view.tpl")); $t->set_file(array( "view" => "view.tpl"));
@ -40,19 +39,19 @@
} }
} }
// merge in extra fields // merge in extra fields
$extrafields = array ("pager" => "pager", $extrafields = array (
"pager" => "pager",
"mphone" => "mphone", "mphone" => "mphone",
"ophone" => "ophone", "ophone" => "ophone",
"address2" => "address2", "address2" => "address2",
"bday" => "bday", "bday" => "bday",
"url" => "url", "url" => "url",
"notes" => "notes", "notes" => "notes",
"access" => "access"); );
$qfields = $this->stock_contact_fields + $extrafields; $qfields = $this->stock_contact_fields + $extrafields;
$fields = $this->read_single_entry($ab_id,$qfields); $fields = $this->read_single_entry($ab_id,$qfields);
$owner = $fields[0]["owner"]; $owner = $fields[0]["owner"];
$access = $fields[0]["access"];
$view_header = "<p>&nbsp;<b>" . lang("Address book - view") . "</b><hr><p>"; $view_header = "<p>&nbsp;<b>" . lang("Address book - view") . "</b><hr><p>";
$view_header .= '<table border="0" cellspacing="2" cellpadding="2" width="80%" align="center">'; $view_header .= '<table border="0" cellspacing="2" cellpadding="2" width="80%" align="center">';
@ -79,6 +78,7 @@
$columns_html .= "<td>" . $ref . $data . "</td>"; $columns_html .= "<td>" . $ref . $data . "</td>";
} }
/*
if ($access == "private") { if ($access == "private") {
$access_link .= lang("Record Access") . " - " . $access; $access_link .= lang("Record Access") . " - " . $access;
} elseif ($access != "private" && $access != "public") { } elseif ($access != "private" && $access != "public") {
@ -86,7 +86,7 @@
} else { } else {
$access_link =""; $access_link ="";
} }
*/
$columns_html .= '<tr><td colspan="4">&nbsp;</td></tr>' $columns_html .= '<tr><td colspan="4">&nbsp;</td></tr>'
. '<tr><td><b>' . lang("Record owner") . '</b></td><td>' . '<tr><td><b>' . lang("Record owner") . '</b></td><td>'
. $phpgw->common->grab_owner_name($owner) . '</td><td><b>' . $phpgw->common->grab_owner_name($owner) . '</td><td><b>'