From 9827726352b6727246416805e52cc566e031739f Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Thu, 20 Sep 2001 02:43:39 +0000 Subject: [PATCH] fixed a typo change the way the referer get modified, when adding addresses from email client Miles need to review it --- addressbook/inc/class.uiaddressbook.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.uiaddressbook.inc.php b/addressbook/inc/class.uiaddressbook.inc.php index 62ee7f4d94..0f5eeb06f4 100644 --- a/addressbook/inc/class.uiaddressbook.inc.php +++ b/addressbook/inc/class.uiaddressbook.inc.php @@ -556,7 +556,8 @@ function add_email() { - global $name,$refereri,$add_email; + global $name,$referer,$add_email; + $named = explode(' ', $name); for ($i=count($named);$i>=0;$i--) { $names[$i] = $named[$i]; } @@ -753,6 +754,7 @@ $ab_id = $GLOBALS['HTTP_GET_VARS']['ab_id']; $submit = $GLOBALS['HTTP_POST_VARS']['submit']; $referer = $GLOBALS['HTTP_GET_VARS']['referer']; + /* First, make sure they have permission to this entry */ $check = $this->bo->read_entry(array('id' => $ab_id, 'fields' => array('owner' => 'owner','tid' => 'tid'))); @@ -983,8 +985,14 @@ $this->template->set_var('vcard_button',lang('no vcard')); } +# it's better to use $GLOBALS['phpgw_info']['server']['webserver_url'] instead of '/phpgroupware' +# right? +# and why do we replace /phpgroupware from the url, we already a perfect url? + +# $this->template->set_var('done_button',$this->html_1button_form('DoneForm','Done', +# $referer ? ereg_replace('/phpgroupware','',$referer) : $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.get_list'))); $this->template->set_var('done_button',$this->html_1button_form('DoneForm','Done', - $referer ? ereg_replace('/phpgroupware','',$referer) : $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.get_list'))); + $referer ? $referer : $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.get_list'))); $this->template->set_var('access_link',$access_link); $this->template->pfp('out','view_t');