proposal quick fix for rebuilding search_table even if the
authorx2002marichez <x2002marichez@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 22 Feb 2007 11:08:21 +0000 (11:08 +0000)
committerx2002marichez <x2002marichez@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 22 Feb 2007 11:08:21 +0000 (11:08 +0000)
administratively edited user is still "pending"

git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1509 839d8a87-29fc-0310-9880-83ba4fa771e5

include/user.func.inc.php

index 9d23e74..f0cccc7 100644 (file)
@@ -705,7 +705,14 @@ function _user_reindex($uid, $keys, $muls) {
 function user_reindex($uid) {
     XDB::execute("DELETE FROM search_name WHERE uid={?}", $uid);
     $res = XDB::query("SELECT prenom, nom, nom_usage, profile_nick FROM auth_user_md5 INNER JOIN auth_user_quick USING(user_id) WHERE auth_user_md5.user_id = {?}", $uid);
-    _user_reindex($uid, $res->fetchOneRow(), array(1,1,1,0.2));
+    if ($res->numRows()) {
+      _user_reindex($uid, $res->fetchOneRow(), array(1,1,1,0.2));
+    } else { // not in auth_user_quick => still "pending"
+      $res = XDB::query("SELECT prenom, nom, nom_usage FROM auth_user_md5 WHERE auth_user_md5.user_id = {?}", $uid);
+      if ($res->numRows()) {
+          _user_reindex($uid, $res->fetchOneRow(), array(1,1,1));
+      }
+    }
 }
 
 // }}}