* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: insert.password.inc.php,v 1.4 2004-09-02 19:39:20 x2000habouzit Exp $
+ $Id: insert.password.inc.php,v 1.5 2004-10-10 09:09:34 x2000chevalier Exp $
***************************************************************************/
function smarty_insert_getName() {
if(isset($_COOKIE['ORGuid'])) $id = $_COOKIE['ORGuid'];
if(isset($_SESSION['uid'])) $id = $_SESSION['uid'];
if(empty($id)) return "";
- $res = $globals->db->query("SELECT alias FROM aliases WHERE id='$id' AND type='a_vie'");
+ $res = $globals->db->query("SELECT alias FROM aliases WHERE id='$id' AND (type='a_vie' OR type='alias' OR type='epouse') ORDER BY type!='epouse', LENGTH(alias) LIMIT 1");
if(list($uname) = mysql_fetch_row($res)) {
mysql_free_result($res);
return $uname;