Naviguation dans :  Perl  JavaScript  Détail  - wsCaD_chgMail.cgi?Appel=newUser
 présentée :  par cas d'appel   par traitements 
Retour à l'accueil
  
   
 Requêtes 

 wsCaD_chgMail 

 passIdent 

Requêtes de Ça-déménage.com
Requête d'envoi de mail
Passe le contrôle d'identifiant
 
 
 Bibliothèque CaD 

 Base 

 Identification 

Bibliothèque de Ça-déménage.com
Accès aux bases
Gestion des identifications
 


 idtLireTout  Lit tous les identifiants
Syntaxe idtLireTout(From,nom,noms,OUT)
Paramètres 
nom  type  Description 
From  IN Cas d'appel
nom  IN Identifiant d'appel
noms  IN Liste des identifiants sur lesquels rechercher le mot de passe
— Liste de la forme : "/<ident1>/<ident2>/.../<identN>/"
OUT  OUT Liste des identifiants complétés par leur mot de passe
— Liste de la forme : "/<ident1>,<mdp1>/<ident2>,<mdp2>/.../<identN>,<mdpN>"
Perl : scalaire passé par référence – JavaScript : tableau à 1 élément
retourne  OUT  0 : Traitement correct
non nul : Erreur de traitement
Fonctions util. 
 wsFile Fonction d'accès aux fichiers


Code Perl 

sub idtLireTout {local($From,$nom,$noms,$OUT) = @_; 
 local $In = ''; if (&wsFile("read",$From,$nom,"Id",\$In)!=0) {return 100}; local $x = $In; 
 local($k,$x0,$y); 
 local %T0 = (); 
 if ($noms eq "") {return 0}; $noms .= "/";
while(true) {
 if ($x ne "") {$x =~ s/^\s*//};
 if ($x eq '') {last}; $k = index($x,"/#T)");
 if ($k==-1) {return 1}; $k = $k+4; $x0 = substr($x,0,$k); $x = substr($x,$k);
 if ($x0!~/\(#T\(Compte\)new:(.*)\/#T\(Identification\):(\w+)\/#T\(Authentification\):(.*)\/#T\(Date\)/) {next};
 if (index($noms,"/".$2."/")==-1) {next};
 $T0{"ws".$2} = $3;
}
 foreach $y (keys %T0) {$$OUT .= "/".substr($y,2).",".$T0{$y}};
 return 0;
}
Code JavaScript 

function idtLireTout(From,nom,noms,OUT) { 
 var In = Array(''); if (wsFile("read",From,nom,"Id",In)!=0) {return 100}; var x = In[0]; 
 var k,x0,y; 
 var T0 = []; 
 if (noms=="") {return 0}; noms += "/";
while(true) {
 if (x!="") {x = x.replace(/^\s*/,"")};
 if (x=='') {break}; k = x.indexOf("/#T)");
 if (k==-1) {return 1}; k = k+4; x0 = x.substr(0,k); x = x.substr(k);
 if (!x0.match(/\(#T\(Compte\)new:(.*)\/#T\(Identification\):(\w+)\/#T\(Authentification\):(.*)\/#T\(Date\)/)) {continue};
 if (noms.indexOf("/"+RegExp.$2+"/")==-1) {continue};
 T0["ws"+RegExp.$2] = RegExp.$3;
}
 for(y in T0) {OUT[0] += "/"+y.substr(2)+","+T0[y]};
 return 0;
}