PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Authentication » LiveUser » Bug #296

Feat.Req: Flexible field list for auth table

Details

Submitted2003-11-25 15:28 UTC
Fromliveuser at bago dot org
Assignedarnaud
StatusClosed
PackageLiveUser
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2003-11-25 15:28 UTC] liveuser at bago dot org

Description:
------------
the Admin classes are not flexible as the LU base classes:

Why not to change the getAllUsers so to have estensible select given the authTableCols?

function getAllUsers()
{
if (!$this->init_ok) {
return false;
}

$fields = array();
foreach ($this->authTableCols AS $key => $value) {
$fields[] = $value . ' AS ' . $key;
}

// First: Get all data from auth table.
$query = '
SELECT
'. implode(',', $fields).'
FROM
' . $this->authTable;

Instead of the current one:

function getAllUsers()
{
if (!$this->init_ok) {
return false;
}

// First: Get all data from auth table.
$query = '
SELECT
' . $this->authTableCols['user_id'] . ' AS auth_user_id,
' . $this->authTableCols['handle'] . ' AS handle,
' . $this->authTableCols['passwd'] . ' AS passwd,
' . $this->authTableCols['lastlogin'] . ' AS lastlogin,
' . $this->authTableCols['is_active'] . ' AS is_active
FROM
' . $this->authTable;