- // TODO such a function should probably be provided in the User class
- // or at least not here
- $res = XDB::query('SELECT u.user_id
- FROM auth_user_md5 AS u
- INNER JOIN aliases AS a ON (a.id = u.user_id AND type != \'homonyme\')
- WHERE a.alias = {?} AND u.perms IN(\'admin\', \'user\')',
- $x);
- if (list($uid) = $res->fetchOneRow()) {
- $user = User::getSilent($uid);
- }
+ global $globals;
+ // Should we check the publicity of the alias?
+ $user = User::getSilent($x . '@' . $globals->mail->alias_dom);