L'utilisateur n'est pas trouvé dans la table utilisateur (afin de detecter le serveur de stockage) [ERREUR 2] => L'utilisateur n'a aucun serveur d'attribué [ERREUR 3] => L'insertion dans la table accessible via proftpd à échoué [ERREUR 4] => La mise a jour du compte ftp sur le panel a échoué [ERREUR 5] => La suppression de la table accessible via proftpd à échoué [ERREUR 6] => La suppression du compte ftp sur le panel à échoué */ // Annulation de la connexion MySql locale : $ConnexionLocale = "non"; // Inclusion du core require ('/var/www/daemon/system/core.php'); /* -------- */ /* Création */ /* -------- */ $ListFtp = $ConnexionPanel->Select ("*", "ftp", "Status='1'", "", "", "", ""); if ( $ListFtp != FALSE ) { $CountFtp = count ($ListFtp); echo "\nCompte(s) en attente de création : ".$CountFtp."\n"; for ($i=0; $i < $CountFtp; $i++) { echo "Compte de ".$ListFtp[$i]["Utilisateur"]." : ".$ListFtp[$i]["Nom"]; $SelectServeur = $ConnexionPanel->Select ("*", "utilisateur", "Utilisateur='".$ListFtp[$i]["Utilisateur"]."'", "", "", "", ""); if ( $SelectServeur != FALSE ) { if ( !empty($SelectServeur[0]["ServeurFichier"]) ) { $Champs = "userid, passwd, homedir, Server"; $Valeurs = "'".$ListFtp[$i]["Nom"]."', ENCRYPT('".$ListFtp[$i]["Password"]."'), '/var/www/web/".$ListFtp[$i]["Utilisateur"].$ListFtp[$i]["Chemin"]."', '".$SelectServeur[0]["ServeurFichier"]."'"; $InsertFtp = $ConnexionSystem->Insert ($Champs, $Valeurs, "ftpuser"); if ( $InsertFtp != FALSE ) { $MajPanel = $ConnexionPanel->Update ("ftp", "Status", "2", "Nom='".$ListFtp[$i]["Nom"]."'"); if ( $MajPanel != FALSE ) { echo "\t\t\t[OK]\n"; } else { echo "\t\t\t[ERREUR 4]\n"; } } else { echo "\t\t\t[ERREUR 3]\n"; } } else { echo "\t\t\t[ERREUR 2]\n"; } } else { echo "\t\t\t[ERREUR 1]\n"; } } } else { echo "Aucun compte n'est en attente de création\n"; } /* ----------- */ /* Suppression */ /* ----------- */ $ListFtp = $ConnexionPanel->Select ("*", "ftp", "Status='3'", "", "", "", ""); if ( $ListFtp != FALSE ) { $CountFtp = count ($ListFtp); echo "\nCompte(s) en attente de suppression : ".$CountFtp."\n"; for ($i=0; $i < $CountFtp; $i++) { echo "Compte de ".$ListFtp[$i]["Utilisateur"]." : ".$ListFtp[$i]["Nom"]; $SuppressionSystem = $ConnexionSystem->Delete ("ftpuser", "userid='".$ListFtp[$i]["Nom"]."'"); if ( $SuppressionSystem != FALSE ) { $SuppressionPanel = $ConnexionPanel->Delete ("ftp", "Nom='".$ListFtp[$i]["Nom"]."'"); if ( $SuppressionPanel != FALSE ) { echo "\t\t\t[OK]\n"; } else { echo "\t\t\t[ERREUR 6]\n"; } } else { echo "\t\t\t[ERREUR 5]\n"; } } } else { echo "Aucun compte n'est en attente de supression\n"; } ?>