if (is_null($x)) {
return null;
}
- // 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 auth_user_quick AS q USING(user_id)
- INNER JOIN aliases AS a ON (a.id = u.user_id AND type != \'homonyme\')
- WHERE u.perms IN(\'admin\', \'user\')
- AND q.emails_alias_pub = \'public\'
- AND a.alias = {?}',
- $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);
return $user ? $user : null;
}
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
-?>
\ No newline at end of file
+?>