mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 17:14:36 +01:00
Started working on edit ACL, its not complete
This commit is contained in:
parent
f3df7a0ff4
commit
72b4870a4c
@ -12,26 +12,41 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
if ($submit || ! $ab_id) {
|
$phpgw_info['flags'] = array(
|
||||||
$phpgw_info["flags"] = array(
|
'noheader' => True,
|
||||||
"noheader" => True,
|
'nonavbar' => True,
|
||||||
"nonavbar" => True
|
'currentapp' => 'addressbook',
|
||||||
);
|
// is this really needed ?
|
||||||
|
'enable_contacts_class' => True
|
||||||
|
);
|
||||||
|
|
||||||
|
include('../header.inc.php');
|
||||||
|
|
||||||
|
$this = CreateObject('phpgwapi.contacts');
|
||||||
|
|
||||||
|
// First, make sure they have permission to this entry
|
||||||
|
$phpgw->db->query("select owner from phpgw_addressbook where id='$ab_id'");
|
||||||
|
$phpgw->db->next_record();
|
||||||
|
|
||||||
|
if (! $this->check_perms($this->grants[$phpgw->db->f('owner')],PHPGW_ACL_EDIT) && $phpgw->db->f('owner') != $phpgw_info['user']['account_id'])
|
||||||
|
{
|
||||||
|
Header("Location: " . $phpgw->link('/addressbook/index.php',"cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
|
||||||
|
$phpgw->common->phpgw_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpgw_info["flags"]["currentapp"] = "addressbook";
|
|
||||||
$phpgw_info["flags"]["enable_contacts_class"] = True;
|
|
||||||
include("../header.inc.php");
|
|
||||||
|
|
||||||
$t = new Template($phpgw->common->get_tpl_dir("addressbook"));
|
$t = new Template($phpgw->common->get_tpl_dir("addressbook"));
|
||||||
$t->set_file(array( "edit" => "edit.tpl"));
|
$t->set_file(array("edit" => "edit.tpl"));
|
||||||
|
|
||||||
if (! $ab_id) {
|
if (! $ab_id) {
|
||||||
Header("Location: " . $phpgw->link('/addressbook/index.php',"cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
|
Header("Location: " . $phpgw->link('/addressbook/index.php',"cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
|
||||||
$phpgw->common->phpgw_exit();
|
$phpgw->common->phpgw_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this = CreateObject("phpgwapi.contacts");
|
if (! $submit)
|
||||||
|
{
|
||||||
|
$phpgw->common->phpgw_header();
|
||||||
|
echo parse_navbar();
|
||||||
|
}
|
||||||
|
|
||||||
// Read in user custom fields, if any
|
// Read in user custom fields, if any
|
||||||
$phpgw->preferences->read_repository();
|
$phpgw->preferences->read_repository();
|
||||||
@ -51,14 +66,10 @@
|
|||||||
"address2" => "address2",
|
"address2" => "address2",
|
||||||
"address3" => "address3"
|
"address3" => "address3"
|
||||||
);
|
);
|
||||||
if ($rights & PHPGW_ACL_EDIT) {
|
|
||||||
$qfields = $this->stock_contact_fields + $extrafields + $customfields;
|
$qfields = $this->stock_contact_fields + $extrafields + $customfields;
|
||||||
$fields = addressbook_read_entry($ab_id,$qfields);
|
$fields = addressbook_read_entry($ab_id,$qfields);
|
||||||
addressbook_form("","edit.php","Edit",$fields[0],$customfields);
|
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 {
|
} else {
|
||||||
if ($url == "http://") {
|
if ($url == "http://") {
|
||||||
$url = "";
|
$url = "";
|
||||||
|
@ -211,6 +211,7 @@
|
|||||||
return $return_fields;
|
return $return_fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function read_last_entry($fields="")
|
function read_last_entry($fields="")
|
||||||
{
|
{
|
||||||
if (!$fields || empty($fields)) { $fields = $this->stock_contact_fields; }
|
if (!$fields || empty($fields)) { $fields = $this->stock_contact_fields; }
|
||||||
@ -521,7 +522,7 @@
|
|||||||
if ($field_s == ",") {
|
if ($field_s == ",") {
|
||||||
unset($field_s);
|
unset($field_s);
|
||||||
}
|
}
|
||||||
$this->db->query("update $this->std_table set owner='$owner', access='$access' $fields_s where "
|
$this->db->query("update $this->std_table set access='$access' $fields_s where "
|
||||||
. "id='$id'",__LINE__,__FILE__);
|
. "id='$id'",__LINE__,__FILE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
|
// I don't think this is needed anymore
|
||||||
|
|
||||||
// Perform acl check, set $rights
|
// Perform acl check, set $rights
|
||||||
if(!isset($owner)) { $owner = 0; }
|
if(!isset($owner)) { $owner = 0; }
|
||||||
|
|
||||||
@ -450,8 +452,9 @@
|
|||||||
$t->set_var("lang_pubkey",lang("Public Key"));
|
$t->set_var("lang_pubkey",lang("Public Key"));
|
||||||
$t->set_var("pubkey",$pubkey);
|
$t->set_var("pubkey",$pubkey);
|
||||||
|
|
||||||
|
$t->set_var('lang_private',lang('Private'));
|
||||||
if ($customfields) {
|
if ($customfields) {
|
||||||
$t->set_var("lang_custom",lang("Custom Fields").':');
|
$t->set_var('lang_custom',lang('Custom Fields').':');
|
||||||
} else {
|
} else {
|
||||||
$t->set_var("lang_custom",'');
|
$t->set_var("lang_custom",'');
|
||||||
}
|
}
|
||||||
|
@ -313,6 +313,14 @@
|
|||||||
{notes}
|
{notes}
|
||||||
</font></td>
|
</font></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><font size="-1">{lang_private}:</font></td>
|
||||||
|
<td colspan="3">
|
||||||
|
<input type="checkbox" name="access" value="True"{access_check}>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><font color="#000000" face="" size="-1">{lang_custom}</font></td>
|
<td><font color="#000000" face="" size="-1">{lang_custom}</font></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
Loading…
Reference in New Issue
Block a user