add get_login_by_uid API

This commit is contained in:
Antoine Beaupr�� 2014-06-18 15:26:53 +00:00
parent dd6ace0c0c
commit 73606b8e26
1 changed files with 15 additions and 0 deletions

View File

@ -173,6 +173,21 @@ class m_admin {
return $db->f('uid');
}
/**
* return the name of an alternc account
*
* @global type $db
* @param type $uid
* @return null if missing
*/
function get_login_by_uid($uid) {
global $db;
$db->query("SELECT login FROM membres WHERE uid=$uid;");
if (! $db->next_record()) {
return null;
}
return $db->f('login');
}
/**
* Returns the known information about a hosted account