[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/scripts/ -> ldap-update-allcontact.php (source)

   1  <?PHP
   2  /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   *
   4   * This program is free software; you can redistribute it and/or modify
   5   * it under the terms of the GNU General Public License as published by
   6   * the Free Software Foundation; either version 2 of the License, or
   7   * (at your option) any later version.
   8   *
   9   * This program is distributed in the hope that it will be useful,
  10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12   * GNU General Public License for more details.
  13   *
  14   * You should have received a copy of the GNU General Public License
  15   * along with this program; if not, write to the Free Software
  16   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17   *
  18   * $Id: ldap-update-allcontact.php,v 1.4 2005/10/18 14:03:06 eldy Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/scripts/ldap-update-allcontact.php,v $
  20   *
  21   * Mets à jour tous les contacts dans LDAP à partir de la base sql
  22   */
  23  
  24  require_once ("../htdocs/master.inc.php");
  25  require_once (DOL_DOCUMENT_ROOT."/contact.class.php");
  26  require_once(DOL_DOCUMENT_ROOT."/user.class.php");
  27  
  28  $error = 0;
  29  
  30  $user = new User($db);
  31  
  32  $sql = "SELECT idp";
  33  $sql .= " FROM ".MAIN_DB_PREFIX."socpeople";
  34  
  35  $resql = $db->query($sql);
  36  
  37  if ( $resql ) 
  38  {
  39    $num = $db->num_rows($resql);
  40    $i = 0;
  41    
  42    while ($i < $num)
  43      {
  44        $row = $db->fetch_row($resql);
  45  
  46        print "Mise à jour $row[0]\n";
  47  
  48        $contact = new Contact($db);
  49        $contact->id = $row[0];
  50        $contact->update_ldap($user);
  51  
  52        $i++;      
  53      }
  54  }
  55  
  56  
  57  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics