Ejemplo n.º 1
0
 public static function getValidUsersDB($userIDs)
 {
     if (!$userIDs) {
         return array();
     }
     $invalid = array();
     // Get any of these users that are known to be invalid
     $sql = "SELECT UserID FROM LUM_User WHERE RoleID=2 AND UserID IN (" . implode(', ', array_fill(0, sizeOf($userIDs), '?')) . ")";
     try {
         $invalid = Zotero_WWW_DB_2::columnQuery($sql, $userIDs);
         Zotero_WWW_DB_2::close();
     } catch (Exception $e) {
         try {
             Z_Core::logError("WARNING: {$e} -- retrying on primary");
             $invalid = Zotero_WWW_DB_1::columnQuery($sql, $userIDs);
             Zotero_WWW_DB_1::close();
         } catch (Exception $e2) {
             Z_Core::logError("WARNING: " . $e2);
             // If not available, assume valid
         }
     }
     if ($invalid) {
         $userIDs = array_diff($userIDs, $invalid);
     }
     return $userIDs;
 }