ryxeo-glpi-git / plugins / anet_migration / front / plugin_anet_migration.config.form.php @ 7074cc57
Historique | Voir | Annoter | Télécharger (1,67 ko)
1 |
<?php
|
---|---|
2 |
|
3 |
//Création automatique des 2000 packs dans la base de données
|
4 |
|
5 |
if(!defined('GLPI_ROOT')){ |
6 |
define('GLPI_ROOT', '../../..'); |
7 |
} |
8 |
include_once (GLPI_ROOT . "/inc/includes.php"); |
9 |
|
10 |
checkRight("config","w"); |
11 |
|
12 |
commonHeader("anet_migration",$_SERVER['PHP_SELF'],"config","plugins"); |
13 |
|
14 |
/*
|
15 |
// Pour le jour où on aura un réel développement GLPI ... en attendant je fais un appel
|
16 |
// brutal au fichier ...
|
17 |
|
18 |
echo "<div align='center'>";
|
19 |
echo "<form method='post' action=\"./plugin_aner-migration.config.php\">";
|
20 |
echo "<table class='tab_cadre' cellpadding='5'>";
|
21 |
echo "<tr><th colspan=\"2\">Configuration anet-migration</th></tr>";
|
22 |
if (haveRight("config","w")){
|
23 |
echo "<tr><td>Nombre de packs</td><td><input type=\"text\" name=\"nombre\" value=\"2000\"></td></tr>";
|
24 |
echo "<tr><td>Racine</td><td><input type=\"text\" name=\"nombre\" value=\"ENR\"></td></tr>";
|
25 |
echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\"></td></tr>";
|
26 |
}
|
27 |
echo "</table></div>";
|
28 |
*/
|
29 |
|
30 |
print "<p>Editez le fichier plugin_anet_migration.config.form.php et retournez sur cette page pour créer automatiquement 2000 packs</p>"; |
31 |
print "<p>Voyez ça avec Éric !</p>"; |
32 |
//On fait ça a la main pour l'instant
|
33 |
/*
|
34 |
global $DB;
|
35 |
$nb_packs = 2000;
|
36 |
$prefix = "ENR09-01-";
|
37 |
for($i = 0; $i < $nb_packs; $i++) {
|
38 |
srand();
|
39 |
$code=$prefix . rand(1000,9999) . "-" . chr(rand(65,90)) . chr(rand(65,90)) . chr(rand(65,90)) . chr(rand(65,90)) . "-" . rand(1000,9999);
|
40 |
$password=rand(1000,9999) . "-" . rand(1000,9999);
|
41 |
$query="INSERT into glpi_plugin_anet_migration values('','','','2011-12-31','$code','$password',0,0,0,0);";
|
42 |
//print "<p>" . $query . "</p>";
|
43 |
//exit;
|
44 |
$DB->query($query);// or die($DB->error());
|
45 |
}
|
46 |
*/
|
47 |
|
48 |
commonFooter(); |
49 |
?>
|
50 |
|