J'ai cherché à comprendre l'utilité de la table glpi_plugin_archires_path (surtout parce que la valeur proposée par défaut ne correspondait pas à mon installation).
En fait c'est juste pour connaitre le chemin local contenant les images... (j'ai peut-être raté quelque chose) Je pense que l'utilisation de realpath(GLPI_ROOT) permet de trouver plus simplement ce chemin ;) Donc, voir P.J. Remarque : cela semble uniquement utilisé pour l'envoi du SVG ? Mais dans ce cas, le client reçoit un fichier contenant des références à des images stockées sur le serveur (donc inaccessibles).... :( Remi P.S. : uniquement testé sous Linux ;)
--- ./inc/plugin_archires.functions_display.php.orig 2007-07-23 16:01:14.000000000 +0200 +++ ./inc/plugin_archires.functions_display.php 2007-07-23 16:03:11.000000000 +0200 @@ -1542,9 +1542,7 @@ function plugin_archires_graphviz_fetch( if ($format!='svg') $graph .= "<tr><td><img src=\"".$image_name."\"/></td></tr>"; else{ - $plugin_archires_path= new plugin_archires_path(); - $plugin_archires_path->GetFromDB(1); - $graph .= "<tr><td><img src=\"".$plugin_archires_path->fields["path"]."/plugins/archires/".$image_name. "\"/></td></tr>"; + $graph .= "<tr><td><img src=\"".realpath(GLPI_ROOT)."/plugins/archires/".$image_name. "\"/></td></tr>"; } $graph .= "<tr><td> </td></tr><tr><td>".$device["name"]; //ip / type @@ -1660,9 +1658,7 @@ function plugin_archires_graphviz_fetch( if ($format!='svg') $graph .= "<tr><td><img src= \"pics/socket.png\" /></td></tr>"; else{ - $plugin_archires_path= new plugin_archires_path(); - $plugin_archires_path->GetFromDB(1); - $graph .= "<tr><td><img src=\"".$plugin_archires_path->fields["path"]."/plugins/archires/pics/socket.png\" /></td></tr>"; + $graph .= "<tr><td><img src=\"".realpath(GLPI_ROOT)."/plugins/archires/pics/socket.png\" /></td></tr>"; } --- ./inc/plugin_archires.classes.php.orig 2007-07-23 16:01:21.000000000 +0200 +++ ./inc/plugin_archires.classes.php 2007-07-23 16:03:31.000000000 +0200 @@ -32,32 +32,6 @@ // Purpose of file: // ---------------------------------------------------------------------- -class plugin_archires_path extends CommonDBTM { - - function plugin_archires_path () { - $this->table="glpi_plugin_archires_path"; - - } - - function Config($target) { - global $CFG_GLPI, $LANGARCHIRES, $LANG; - - echo "<form name='form' action=\"$target\" method=\"post\">"; - echo "<div align='center'>"; - echo "<table class='tab_cadre' cellpadding='5'>"; - - echo "<tr><th>".$LANGARCHIRES["system"][0]." </th></tr>"; - echo "<tr class='tab_bg_1'><td align='center'> <input type=\"text\" name=\"path\" size='30' value=\"".$this->fields["path"]."\">"; - echo " <img src='".$CFG_GLPI["root_doc"]."/pics/aide.png' alt='' onmouseout=\"setdisplay(getElementById('comments_path'),'none')\" onmouseover=\"setdisplay(getElementById('comments_path'),'block')\">"; - echo "<span class='over_link' id='comments_path'>".$LANGARCHIRES["system"][1]."</span>"; - echo "</td></tr>"; - echo "<tr><th colspan='2'><input type='hidden' name='ID' value='1'><input type=\"submit\" name=\"update_path\" class=\"submit\" value=\"".$LANG["buttons"][2]."\" ></th></tr>"; - echo "</table></div>"; - echo "</form><br>"; - - } -} - class plugin_archires_color_device extends CommonDBTM { function plugin_archires_color_device () { --- ./inc/plugin_archires.functions_setup.php.orig 2007-07-23 16:01:30.000000000 +0200 +++ ./inc/plugin_archires.functions_setup.php 2007-07-23 16:05:20.000000000 +0200 @@ -43,18 +43,6 @@ function plugin_archires_Install() { $DB = new DB; - $query = "CREATE TABLE `glpi_plugin_archires_path` (`ID` int(11) NOT NULL auto_increment, - `path` varchar(255) collate utf8_unicode_ci NOT NULL default '', - PRIMARY KEY (`ID`))ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; - - $DB->query($query) or die($DB->error()); - - $query = "INSERT INTO `glpi_plugin_archires_path` - (`ID`, `path`) - VALUES ('1', '/var/www/glpi')"; - - $DB->query($query) or die($DB->error()); - $query = "CREATE TABLE `glpi_plugin_archires_color_device` ( `ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `type` INT( 11 ) NOT NULL , @@ -267,18 +255,6 @@ function plugin_archires_updatev14() { function plugin_archires_updatev15() { $DB = new DB; - $query = "CREATE TABLE `glpi_plugin_archires_path` (`ID` int(11) NOT NULL auto_increment, - `path` varchar(255) collate utf8_unicode_ci NOT NULL default '', - PRIMARY KEY (`ID`))ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; - - $DB->query($query) or die($DB->error()); - - $query = "INSERT INTO `glpi_plugin_archires_path` - (`ID`, `path`) - VALUES ('1', '/var/www')"; - - $DB->query($query) or die($DB->error()); - $query = "ALTER TABLE `glpi_plugin_archires_display` CHANGE `computer` `computer` smallint(6) NOT NULL default '0';"; $DB->query($query) or die($DB->error()); @@ -576,10 +552,6 @@ function plugin_archires_uninstall() { $DB = new DB; - $query = "DROP TABLE `glpi_plugin_archires_path`;"; - - $DB->query($query) or die($DB->error()); - $query = "DROP TABLE `glpi_plugin_archires_color_device`;"; $DB->query($query) or die($DB->error()); --- ./front/plugin_archires.config.php.orig 2007-07-23 16:01:36.000000000 +0200 +++ ./front/plugin_archires.config.php 2007-07-23 16:11:01.000000000 +0200 @@ -197,20 +197,11 @@ checkRight("config","w"); } glpi_header($_SERVER['HTTP_REFERER']); - }elseif (isset($_POST["update_path"])) { - checkRight("config","w"); - $plugin_archires_path= new plugin_archires_path(); - $plugin_archires_path->update($_POST); - glpi_header($_SERVER['HTTP_REFERER']); } else { checkRight("config","w"); - $plugin_archires_path= new plugin_archires_path(); - $plugin_archires_path->GetFromDB(1); - $plugin_archires_path->Config($_SERVER["PHP_SELF"]); - echo "<div align='center'>"; echo "<table class='tab_cadre' cellpadding='5'>"; @@ -471,4 +462,4 @@ checkRight("config","w"); commonFooter(); -?> \ Pas de fin de ligne à la fin du fichier. +?> --- ./locales/fr_FR.php.orig 2007-07-23 16:08:19.000000000 +0200 +++ ./locales/fr_FR.php 2007-07-23 16:10:01.000000000 +0200 @@ -124,4 +124,4 @@ $LANGARCHIRES["test"][12] = "Port matér $LANGARCHIRES["test"][13] = "Port matériel 2"; $LANGARCHIRES["test"][14] = "IP matériel 2"; -?> \ Pas de fin de ligne à la fin du fichier. +?> --- ./locales/en_GB.php.orig 2007-07-23 16:08:15.000000000 +0200 +++ ./locales/en_GB.php 2007-07-23 16:10:01.000000000 +0200 @@ -105,9 +105,6 @@ $LANGARCHIRES["setup"][18] = "FAQ"; $LANGARCHIRES["setup"][19] = "Associate colors with items status"; $LANGARCHIRES["setup"][20] = "Associated view"; -$LANGARCHIRES["system"][0] = "Apache Path for GLPI"; -$LANGARCHIRES["system"][1] = "Example C:/OCS/xampp/htdocs/glpi for Windows and /var/www/glpi for linux"; - $LANGARCHIRES["test"][0] = "Test"; $LANGARCHIRES["test"][1] = "Test Graphviz"; $LANGARCHIRES["test"][2] = "Material"; @@ -124,4 +121,4 @@ $LANGARCHIRES["test"][12] = "Socket mate $LANGARCHIRES["test"][13] = "Socket material 2"; $LANGARCHIRES["test"][14] = "IP material 2"; -?> \ Pas de fin de ligne à la fin du fichier. +?>
_______________________________________________ Glpi-dev mailing list Glpi-dev@gna.org https://mail.gna.org/listinfo/glpi-dev