[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php, 1.36.2.1
From: |
Jonathan Rivera <address@hidden> |
Subject: |
[Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php, 1.36.2.15.2.28, 1.36.2.15.2.29 class.soaddressbook.inc.php, 1.14.2.3.2.19, 1.14.2.3.2.20 class.boaddressbook.inc.php, 1.21.2.2.2.19, 1.21.2.2.2.20 |
Date: |
Mon, 03 Nov 2003 20:32:50 +0000 |
Update of /cvsroot/phpgroupware/addressbook/inc
In directory subversions:/tmp/cvs-serv5457/addressbook/inc
Modified Files:
Tag: Version-0_9_16-branch
class.uiaddressbook.inc.php class.soaddressbook.inc.php
class.boaddressbook.inc.php
Log Message:
This changes are for check the addressmaster acl permissions
Index: class.boaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.boaddressbook.inc.php,v
retrieving revision 1.21.2.2.2.19
retrieving revision 1.21.2.2.2.20
diff -C2 -d -r1.21.2.2.2.19 -r1.21.2.2.2.20
*** class.boaddressbook.inc.php 29 Oct 2003 07:30:46 -0000 1.21.2.2.2.19
--- class.boaddressbook.inc.php 3 Nov 2003 20:32:47 -0000 1.21.2.2.2.20
***************
*** 824,827 ****
--- 824,871 ----
return $this->so->delete_specified_note($id);
}
+
+ /**
+ * Check if the contact has add permissions.
+ *
+ * @param integer $contact_id The contact_id which you want to
check
+ * @param integer $owner_id The owner_id of the contact which
you want to check
+ */
+ function check_add($contact_id, $owner_id='')
+ {
+ return $this->so->check_add($contact_id, $owner_id);
+ }
+
+ /**
+ * Check if the contact has edit permissions.
+ *
+ * @param integer $contact_id The contact_id which you want to
check
+ * @param integer $owner_id The owner_id of the contact which
you want to check
+ */
+ function check_edit($contact_id, $owner_id='')
+ {
+ return $this->so->check_edit($contact_id, $owner_id);
+ }
+
+ /**
+ * Check if the contact has read permissions.
+ *
+ * @param integer $contact_id The contact_id which you want to
check
+ * @param integer $owner_id The owner_id of the contact which
you want to check
+ */
+ function check_read($contact_id, $owner_id='')
+ {
+ return $this->so->check_read($contact_id, $owner_id);
+ }
+
+ /**
+ * Check if the contact has delete permissions.
+ *
+ * @param integer $contact_id The contact_id which you want to
check
+ * @param integer $owner_id The owner_id of the contact which
you want to check
+ */
+ function check_delete($contact_id, $owner_id='')
+ {
+ return $this->so->check_delete($contact_id, $owner_id);
+ }
}
?>
Index: class.soaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.soaddressbook.inc.php,v
retrieving revision 1.14.2.3.2.19
retrieving revision 1.14.2.3.2.20
diff -C2 -d -r1.14.2.3.2.19 -r1.14.2.3.2.20
*** class.soaddressbook.inc.php 29 Oct 2003 07:30:46 -0000 1.14.2.3.2.19
--- class.soaddressbook.inc.php 3 Nov 2003 20:32:47 -0000 1.14.2.3.2.20
***************
*** 757,760 ****
--- 757,805 ----
return $this->contacts->contact_import($entry);
}
+
+ /**
+ * Check if the contact has add permissions.
+ *
+ * @param integer $contact_id The contact_id which you want to
check
+ * @param integer $owner_id The owner_id of the contact which
you want to check
+ */
+ function check_add($contact_id, $owner_id='')
+ {
+ return $this->contacts->check_add($contact_id,
$owner_id);
+ }
+
+ /**
+ * Check if the contact has edit permissions.
+ *
+ * @param integer $contact_id The contact_id which you want to
check
+ * @param integer $owner_id The owner_id of the contact which
you want to check
+ */
+ function check_edit($contact_id, $owner_id='')
+ {
+ return $this->contacts->check_edit($contact_id,
$owner_id);
+ }
+
+ /**
+ * Check if the contact has read permissions.
+ *
+ * @param integer $contact_id The contact_id which you want to
check
+ * @param integer $owner_id The owner_id of the contact which
you want to check
+ */
+ function check_read($contact_id, $owner_id='')
+ {
+ return $this->contacts->check_read($contact_id,
$owner_id);
+ }
+
+ /**
+ * Check if the contact has delete permissions.
+ *
+ * @param integer $contact_id The contact_id which you want to
check
+ * @param integer $owner_id The owner_id of the contact which
you want to check
+ */
+ function check_delete($contact_id, $owner_id='')
+ {
+ return $this->contacts->check_delete($contact_id,
$owner_id);
+ }
+
}
?>
Index: class.uiaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uiaddressbook.inc.php,v
retrieving revision 1.36.2.15.2.28
retrieving revision 1.36.2.15.2.29
diff -C2 -d -r1.36.2.15.2.28 -r1.36.2.15.2.29
*** class.uiaddressbook.inc.php 26 Oct 2003 03:13:40 -0000 1.36.2.15.2.28
--- class.uiaddressbook.inc.php 3 Nov 2003 20:32:46 -0000 1.36.2.15.2.29
***************
*** 98,102 ****
$this->bo =
CreateObject('addressbook.boaddressbook');
$this->template = &$GLOBALS['phpgw']->template;
- $this->bo->so->contacts =
CreateObject('phpgwapi.contacts');
$this->cat = CreateObject('phpgwapi.categories');
$this->company =
CreateObject('phpgwapi.categories','addressbook_company');
--- 98,101 ----
***************
*** 448,458 ****
$this->template->set_var('row_vcard_link',$GLOBALS['phpgw']->link('/index.php',
'menuaction=addressbook.uivcard.out&ab_id='.$entry['contact_id']));
! if
($this->bo->so->contacts->check_perms($this->bo->grants[$myowner],PHPGW_ACL_EDIT)
||
! $myowner ==
$GLOBALS['phpgw_info']['user']['account_id'])
{
$this->template->set_var('row_edit','<a
href="' . $GLOBALS['phpgw']->link('/index.php',
'menuaction=addressbook.uiaddressbook.' . $this->edit_mode
.
'&ab_id='.$entry['contact_id']) . '">' . lang('Edit') . '</a>');
! }
else
{
--- 447,464 ----
$this->template->set_var('row_vcard_link',$GLOBALS['phpgw']->link('/index.php',
'menuaction=addressbook.uivcard.out&ab_id='.$entry['contact_id']));
!
! if($this->bo->check_edit($entry['contact_id'],
$myowner))
{
$this->template->set_var('row_edit','<a
href="' . $GLOBALS['phpgw']->link('/index.php',
'menuaction=addressbook.uiaddressbook.' . $this->edit_mode
.
'&ab_id='.$entry['contact_id']) . '">' . lang('Edit') . '</a>');
! }
! // if
($this->bo->so->contacts->check_perms($this->bo->grants[$myowner],PHPGW_ACL_EDIT)
||
! // $myowner ==
$GLOBALS['phpgw_info']['user']['account_id'])
! // {
! // $this->template->set_var('row_edit','<a
href="' . $GLOBALS['phpgw']->link('/index.php',
! //
'menuaction=addressbook.uiaddressbook.' . $this->edit_mode
! // .
'&ab_id='.$entry['contact_id']) . '">' . lang('Edit') . '</a>');
! // }
else
{
***************
*** 651,660 ****
/* First, make sure they have permission to this entry
*/
$this->owner =
$this->entry['owner']?$this->entry['owner']:$this->owner;
! if
(!$this->bo->so->contacts->check_perms($this->bo->grants[$this->owner],PHPGW_ACL_EDIT)
&&
! ($this->owner !=
$GLOBALS['phpgw_info']['user']['account_id']) )
{
Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php', $this->form_index));
$GLOBALS['phpgw']->common->phpgw_exit();
}
//start to draw the add window
--- 657,673 ----
/* First, make sure they have permission to this entry
*/
$this->owner =
$this->entry['owner']?$this->entry['owner']:$this->owner;
! if(!$this->bo->check_edit($this->contact_id,
$this->owner))
{
Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php', $this->form_index));
$GLOBALS['phpgw']->common->phpgw_exit();
}
+
+ // $this->owner =
$this->entry['owner']?$this->entry['owner']:$this->owner;
+ // if
(!$this->bo->so->contacts->check_perms($this->bo->grants[$this->owner],PHPGW_ACL_EDIT)
&&
+ // ($this->owner !=
$GLOBALS['phpgw_info']['user']['account_id']) )
+ // {
+ // Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php', $this->form_index));
+ // $GLOBALS['phpgw']->common->phpgw_exit();
+ // }
//start to draw the add window
***************
*** 864,869 ****
/* First, make sure they have permission to this entry
*/
$this->owner =
$this->entry['owner']?$this->entry['owner']:$this->owner;
! if (
!$this->bo->so->contacts->check_perms($this->bo->grants[$this->owner],PHPGW_ACL_EDIT)
&&
! ($this->owner !=
$GLOBALS['phpgw_info']['user']['account_id']) )
{
Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php', $this->form_index));
--- 877,881 ----
/* First, make sure they have permission to this entry
*/
$this->owner =
$this->entry['owner']?$this->entry['owner']:$this->owner;
! if(!$this->bo->check_edit($this->contact_id,
$this->owner))
{
Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php', $this->form_index));
***************
*** 871,874 ****
--- 883,893 ----
}
+ // if (
!$this->bo->so->contacts->check_perms($this->bo->grants[$this->owner],PHPGW_ACL_EDIT)
&&
+ // ($this->owner !=
$GLOBALS['phpgw_info']['user']['account_id']) )
+ // {
+ // Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php', $this->form_index));
+ // $GLOBALS['phpgw']->common->phpgw_exit();
+ // }
+
//start to draw the add window
$GLOBALS['phpgw']->common->phpgw_header();
***************
*** 939,944 ****
$js_submit = '';
$fields['owner'] =
$fields['owner']?$fields['owner']:$this->owner;
! if (($this->bo->so->grants[$fields['owner']] &
PHPGW_ACL_DELETE) ||
! $fields['owner'] ==
$GLOBALS['phpgw_info']['user']['account_id'])
{
$delete = '<input type="submit" name="delete"
value="' . lang('Delete') . '">';
--- 958,964 ----
$js_submit = '';
$fields['owner'] =
$fields['owner']?$fields['owner']:$this->owner;
! if ($this->bo->check_delete($this->contact_id))
! // if (($this->bo->so->grants[$fields['owner']] &
PHPGW_ACL_DELETE) ||
! // $fields['owner'] ==
$GLOBALS['phpgw_info']['user']['account_id'])
{
$delete = '<input type="submit" name="delete"
value="' . lang('Delete') . '">';
***************
*** 2587,2592 ****
unset($contacts['tab_cats']);
unset($contacts['tab_extra']);
! if (
!$this->bo->so->contacts->check_perms($this->bo->grants[$owner],PHPGW_ACL_READ)
&&
! ($owner !=
$GLOBALS['phpgw_info']['user']['account_id']) )
{
Header('Location: '
--- 2607,2612 ----
unset($contacts['tab_cats']);
unset($contacts['tab_extra']);
!
! if(!$this->bo->check_read($contact_id, $owner))
{
Header('Location: '
***************
*** 2595,2598 ****
--- 2615,2626 ----
}
+ // if (
!$this->bo->so->contacts->check_perms($this->bo->grants[$owner],PHPGW_ACL_READ)
&&
+ // ($owner !=
$GLOBALS['phpgw_info']['user']['account_id']) )
+ // {
+ // Header('Location: '
+ // . $GLOBALS['phpgw']->link('/index.php',
+ //
'menuaction=addressbook.uiaddressbook.index§ion='.$contact_type));
+ // }
+
foreach($cats as $key => $cat_id)
{
***************
*** 2673,2684 ****
/* These are in the footer */
$this->template->set_var('lang_owner',lang('Record
owner'));
!
$this->template->set_var('owner',$GLOBALS['phpgw']->common->grab_owner_name($owner));
$this->template->set_var('lang_access',lang('Record
access'));
$this->template->set_var('access',$access);
$this->template->set_var('lang_category',lang('Category'));
$this->template->set_var('catname',$catname);
! if (($this->bo->so->contacts->grants[$owner] &
PHPGW_ACL_EDIT) ||
! ($owner ==
$GLOBALS['phpgw_info']['user']['account_id']))
! {
$this->template->set_var('edit_button',$this->html_1button_form('edit','Edit',
$GLOBALS['phpgw']->link('/index.php',
--- 2701,2721 ----
/* These are in the footer */
$this->template->set_var('lang_owner',lang('Record
owner'));
! if($owner ==
$GLOBALS['phpgw_info']['server']['addressmaster'])
! {
! $this->template->set_var('owner',
'addressmaster');
! }
! else
! {
!
$this->template->set_var('owner',$GLOBALS['phpgw']->common->grab_owner_name($owner));
! }
$this->template->set_var('lang_access',lang('Record
access'));
$this->template->set_var('access',$access);
$this->template->set_var('lang_category',lang('Category'));
$this->template->set_var('catname',$catname);
! if($this->bo->check_edit($contact_id))
! {
! // if (($this->bo->so->contacts->grants[$owner] &
PHPGW_ACL_EDIT) ||
! // ($owner ==
$GLOBALS['phpgw_info']['user']['account_id']))
! // {
$this->template->set_var('edit_button',$this->html_1button_form('edit','Edit',
$GLOBALS['phpgw']->link('/index.php',
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php, 1.36.2.15.2.28, 1.36.2.15.2.29 class.soaddressbook.inc.php, 1.14.2.3.2.19, 1.14.2.3.2.20 class.boaddressbook.inc.php, 1.21.2.2.2.19, 1.21.2.2.2.20,
Jonathan Rivera <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] addressbook/inc class.uivcard.inc.php, 1.5.2.1.2.2, 1.5.2.1.2.3 class.uiXport.inc.php, 1.6.2.4.2.1, 1.6.2.4.2.2 class.boXport.inc.php, 1.7.4.1, 1.7.4.2
- Next by Date:
[Phpgroupware-cvs] phpgwapi/inc class.contacts_sql.inc.php, 1.17.2.2.2.35, 1.17.2.2.2.36 class.vcard.inc.php, 1.4.4.1, 1.4.4.2
- Previous by thread:
[Phpgroupware-cvs] addressbook/inc class.uivcard.inc.php, 1.5.2.1.2.2, 1.5.2.1.2.3 class.uiXport.inc.php, 1.6.2.4.2.1, 1.6.2.4.2.2 class.boXport.inc.php, 1.7.4.1, 1.7.4.2
- Next by thread:
[Phpgroupware-cvs] phpgwapi/inc class.contacts_sql.inc.php, 1.17.2.2.2.35, 1.17.2.2.2.36 class.vcard.inc.php, 1.4.4.1, 1.4.4.2
- Index(es):