connect($Connexion->dbname); $auth = new Auth($_POST["login"],$_POST["pwd"]); //if ($_COOKIE['PHPSESSID']) //{ //} ?>
exec("SELECT appli.GetPassword('users','".$auth->getValue("appli_user")."')"); $Connexion->setRow(-1);$Connexion->nextRow();$rs=$Connexion->fobject(); if ( ($rs->getpassword == _POSTGRESQL_ERROR_) || ($rs->getpassword <> $auth->getValue("appli_mdp")) ) { include("session_failed.php"); } else { /* Les login et mot de passe sont exacts, on récupère donc les paramètres samba pour le réseau */ $Connexion->exec("SELECT * FROM appli.GetRezoParametersFromUserLogin('".$auth->getValue("appli_user")."')"); $Connexion->setRow(-1);$Connexion->nextRow();$rs=$Connexion->fobject(); /* Complétion de l'authentification */ $auth->setValue("rezo_user",$rs->login); $auth->setValue("rezo_mdp",$rs->password); $auth->setValue("rezo_path",$rs->path); $auth->setValue("rezo_schema",$rs->schema); /* Sauvegarde dans la session du schema */ //if(!session_is_registered("rezo_schema")) //{ $_SESSION['rezo_schema'] = $auth->getValue("rezo_schema"); //} /* */ $Connexion->exec("SELECT * FROM appli.GetInfoFromThisRezoSchemaPath('".$auth->getValue("rezo_schema")."')"); $Virtual_nom_fichier = array(); $Virtual_nom_table = array(); $Virtual_date_de_derniere_importation = array(); $Connexion->setRow(-1); if ($Connexion->numRows()==0) { $Virtual_nom_fichier[] = 'JLKJL9090'; $Virtual_nom_table[] = 'JLKJL9090'; $Virtual_date_de_derniere_importation[] = 'JLKJL9090'; } else { while($Connexion->nextRow()) { $rs=$Connexion->fobject(); $Virtual_nom_fichier[] = $rs->nom_fichier; $Virtual_nom_table[] = $rs->nom_table; $Virtual_date_de_derniere_importation[] = $rs->date_de_derniere_importation; } } /* Si on arrive jusqu'ici alors 1) Connexion à l'appli = OK 2) Connexion au réseau = OK Donc plusieurs précautions sont à prendre: 1) le répertoire en question existe? 2) le répertoire est-il vide? 3) y'a des fichiers GeoSpatiale avec les fichiers auxilaires voulus? Si on passe tous ces tests alors on affiche le tableau si le tableau est vide par défaut on propose le nom du fichier (filtré comme il faut) comme nom de table associée si un fichier géospatiale est nouveau (donc il n'est pas encore référencé */ $obj_rezo = new GeoDataRep($auth->getValue("rezo_path"));echo $auth->getValue("rezo_path"); $obj_rezo->ListEveryIn(); if ( $obj_rezo->IsValidGeoDataRep()==_IS_A_VALID_DIR_ )// on vérifie que le répertoire existe! {//Début validation 1: Oui le répertoire existe if ( $obj_rezo->IsAEmptyRep()==_IS_A_EMPTY_DIR )// le répertoire n'est pas vide! {//Début validation 2: Non le répertoire n'est pas vide! if ( $obj_rezo->ThereIsGeoSpatialesFiles() ) {//Erreur validation 3 for($iter=0;$iter<$obj_rezo->CountEvery();$iter++) { $TestOnFile = $obj_rezo->IsAValidGisFile($iter); if ($TestOnFile[0]==true) {$GoodFiles++;} } ?> \n"; echo "| \nValidation\t\t | \n"; echo "\t\t\nChoix\t\t | \n"; echo "\t\t\nN°\t\t | \n"; echo "\t\t\nType\t\t | \n"; echo "\t\t\nNom du fichier\t\t | \n"; echo "\t\t\nNom de la table\t\t | \n"; echo "\t\t\nProjection\t\t | \n"; echo "\t||||
|---|---|---|---|---|---|---|---|---|---|---|
![]() | \n";
echo "ERREUR: ";
echo "
| ";
$nom_table = "XXX";
$olditer = $iter;
$iter = "XXX";
}
else
{
echo "![]() | \n";
echo "\n"; } echo " | ".$iter." | ".$input_type_hidden_drop_table." ".$obj_rezo->GetFileNameWithOutExt($itertest)." \n | "; if ($TestOnFile[0]==true) { echo "\n";
/* if ($etat_db==0)
{
echo ">>\n
Nouvelle table";
}*/
echo "\n\n";
/* if ($etat_db==0)
{
echo " >> ".utf8_decode("Mise à jour d'une table").""; echo " \n";
echo "\n \n";
}*/
echo " | \n
\n"; } else { echo " | XXX | XXX | <\n"; } echo "