Added some comments about legecy code and started adding in debugging info into the API

This commit is contained in:
jengo 2001-03-18 05:16:00 +00:00
parent 40fb427d31
commit 5d7cb50e74

View File

@ -43,6 +43,7 @@
var $iv = ''; var $iv = '';
var $key = ''; var $key = '';
var $crypto; var $crypto;
var $debug_info; // An array with debugging info from the API
// Convert an array into the format needed for the access column. // Convert an array into the format needed for the access column.
/*! /*!
@ -53,15 +54,19 @@
*/ */
function array_to_string($access,$array) function array_to_string($access,$array)
{ {
$this->debug_info[] = 'array_to_string() is a depreciated function - use ACL instead';
$s = ''; $s = '';
if ($access == 'group' || $access == 'public' || $access == 'none') { if ($access == 'group' || $access == 'public' || $access == 'none')
if (count($array)) { {
if (count($array))
{
while ($t = each($array)) { while ($t = each($array)) {
$s .= ',' . $t[1]; $s .= ',' . $t[1];
} }
$s .= ','; $s .= ',';
} }
if (! count($array) && $access == 'none') { if (! count($array) && $access == 'none')
{
$s = ''; $s = '';
} }
} }
@ -80,13 +85,17 @@
{ {
global $phpgw, $phpgw_info; global $phpgw, $phpgw_info;
$this->debug_info[] = 'sql_search() is a depreciated function - use ACL instead';
$s = ''; $s = '';
if (!$owner) { if (!$owner)
{
$owner = $phpgw_info['user']['account_id']; $owner = $phpgw_info['user']['account_id'];
} }
$groups = $phpgw->accounts->memberships(intval($owner)); $groups = $phpgw->accounts->memberships(intval($owner));
if (gettype($groups) == 'array') { if (gettype($groups) == 'array')
while ($group = each($groups)) { {
while ($group = each($groups))
{
$s .= " or $table like '%," . $group[2] . ",%'"; $s .= " or $table like '%," . $group[2] . ",%'";
} }
} }
@ -251,6 +260,7 @@
} }
return $html_error . '</table>'; return $html_error . '</table>';
} }
/*! /*!
@function check_owner @function check_owner
@abstract none yet @abstract none yet
@ -259,23 +269,31 @@
@param $label ? @param $label ?
@param $extravars @param $extravars
*/ */
// This is a depreciated function - use ACL instead (jengo)
function check_owner($record,$link,$label,$extravars = '') function check_owner($record,$link,$label,$extravars = '')
{ {
global $phpgw, $phpgw_info; global $phpgw, $phpgw_info;
$this->debug_info[] = 'check_owner() is a depreciated function - use ACL instead';
$s = '<a href="' . $phpgw->link($link,$extravars) . '"> ' . lang($label) . ' </a>'; $s = '<a href="' . $phpgw->link($link,$extravars) . '"> ' . lang($label) . ' </a>';
if (ereg("^[0-9]+$",$record)) { if (ereg('^[0-9]+$',$record))
if ($record != $phpgw_info['user']['account_id']) { {
$s = "&nbsp;"; if ($record != $phpgw_info['user']['account_id'])
{
$s = '&nbsp;';
} }
} else { }
if ($record != $phpgw_info['user']['userid']) { else
$s = "&nbsp"; {
if ($record != $phpgw_info['user']['userid'])
{
$s = '&nbsp';
} }
} }
return $s; return $s;
} }
/*! /*!
@function display_fullname @function display_fullname
@abstract return the fullname of a user @abstract return the fullname of a user