mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-12 21:16:47 +02:00
Added some comments about legecy code and started adding in debugging info into the API
This commit is contained in:
parent
40fb427d31
commit
5d7cb50e74
@ -37,61 +37,70 @@
|
|||||||
@class common
|
@class common
|
||||||
@abstract common class that contains commonly used functions
|
@abstract common class that contains commonly used functions
|
||||||
*/
|
*/
|
||||||
class common
|
class common
|
||||||
{
|
{
|
||||||
var $phpgw;
|
var $phpgw;
|
||||||
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.
|
||||||
/*!
|
/*!
|
||||||
@functionn array_to_string
|
@functionn array_to_string
|
||||||
@abstract Convert an array into the format needed for the access column
|
@abstract Convert an array into the format needed for the access column
|
||||||
@param $access
|
@param $access
|
||||||
@param $array
|
@param $array
|
||||||
*/
|
*/
|
||||||
function array_to_string($access,$array)
|
function array_to_string($access,$array)
|
||||||
{
|
{
|
||||||
$s = '';
|
$this->debug_info[] = 'array_to_string() is a depreciated function - use ACL instead';
|
||||||
if ($access == 'group' || $access == 'public' || $access == 'none') {
|
$s = '';
|
||||||
if (count($array)) {
|
if ($access == 'group' || $access == 'public' || $access == 'none')
|
||||||
while ($t = each($array)) {
|
{
|
||||||
$s .= ',' . $t[1];
|
if (count($array))
|
||||||
}
|
{
|
||||||
$s .= ',';
|
while ($t = each($array)) {
|
||||||
}
|
$s .= ',' . $t[1];
|
||||||
if (! count($array) && $access == 'none') {
|
}
|
||||||
$s = '';
|
$s .= ',';
|
||||||
}
|
}
|
||||||
}
|
if (! count($array) && $access == 'none')
|
||||||
return $s;
|
{
|
||||||
}
|
$s = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// This is used for searching the access fields
|
// This is used for searching the access fields
|
||||||
/*!
|
/*!
|
||||||
@function sql_search
|
@function sql_search
|
||||||
@abstract this function is used for searching the access fields
|
@abstract this function is used for searching the access fields
|
||||||
@param $table
|
@param $table
|
||||||
@param $owner
|
@param $owner
|
||||||
*/
|
*/
|
||||||
function sql_search($table,$owner=0)
|
function sql_search($table,$owner=0)
|
||||||
{
|
{
|
||||||
global $phpgw, $phpgw_info;
|
global $phpgw, $phpgw_info;
|
||||||
|
|
||||||
$s = '';
|
$this->debug_info[] = 'sql_search() is a depreciated function - use ACL instead';
|
||||||
if (!$owner) {
|
$s = '';
|
||||||
$owner = $phpgw_info['user']['account_id'];
|
if (!$owner)
|
||||||
}
|
{
|
||||||
$groups = $phpgw->accounts->memberships(intval($owner));
|
$owner = $phpgw_info['user']['account_id'];
|
||||||
if (gettype($groups) == 'array') {
|
}
|
||||||
while ($group = each($groups)) {
|
$groups = $phpgw->accounts->memberships(intval($owner));
|
||||||
$s .= " or $table like '%," . $group[2] . ",%'";
|
if (gettype($groups) == 'array')
|
||||||
}
|
{
|
||||||
}
|
while ($group = each($groups))
|
||||||
return $s;
|
{
|
||||||
}
|
$s .= " or $table like '%," . $group[2] . ",%'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $s;
|
||||||
|
}
|
||||||
|
|
||||||
// return a array of installed languages
|
// return a array of installed languages
|
||||||
/*!
|
/*!
|
||||||
@ -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
|
||||||
*/
|
*/
|
||||||
function check_owner($record,$link,$label,$extravars = '')
|
// This is a depreciated function - use ACL instead (jengo)
|
||||||
{
|
function check_owner($record,$link,$label,$extravars = '')
|
||||||
global $phpgw, $phpgw_info;
|
{
|
||||||
|
global $phpgw, $phpgw_info;
|
||||||
|
|
||||||
$s = '<a href="' . $phpgw->link($link,$extravars) . '"> ' . lang($label) . ' </a>';
|
$this->debug_info[] = 'check_owner() is a depreciated function - use ACL instead';
|
||||||
if (ereg("^[0-9]+$",$record)) {
|
$s = '<a href="' . $phpgw->link($link,$extravars) . '"> ' . lang($label) . ' </a>';
|
||||||
if ($record != $phpgw_info['user']['account_id']) {
|
if (ereg('^[0-9]+$',$record))
|
||||||
$s = " ";
|
{
|
||||||
}
|
if ($record != $phpgw_info['user']['account_id'])
|
||||||
} else {
|
{
|
||||||
if ($record != $phpgw_info['user']['userid']) {
|
$s = ' ';
|
||||||
$s = " ";
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
if ($record != $phpgw_info['user']['userid'])
|
||||||
|
{
|
||||||
|
$s = ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $s;
|
||||||
|
}
|
||||||
|
|
||||||
return $s;
|
|
||||||
}
|
|
||||||
/*!
|
/*!
|
||||||
@function display_fullname
|
@function display_fullname
|
||||||
@abstract return the fullname of a user
|
@abstract return the fullname of a user
|
||||||
|
Loading…
x
Reference in New Issue
Block a user