glpi-singlesignon icon indicating copy to clipboard operation
glpi-singlesignon copied to clipboard

Unable to save picture file.

Open EstevanCastro1 opened this issue 2 years ago • 2 comments

Error in image I can't upload an image, please can you help me?

EstevanCastro1 avatar Jun 15 '22 20:06 EstevanCastro1

Encountered this issue, the base folder for the plugin wasn't created in the corresponding files directory, and the upload function only tried to create a subfolder of the plugin space.

The install/uninstall hook should include the folder creation/removal:

The GLPI installation already ask for administrator to get write access on its files directory; just use GLPI_PLUGIN_DOC_DIR/{plugin_name} (that would resolve to glpi_dir/files/_plugins/{plugin_name} in default basic installations). Make sure to create the plugin directory at install time, and to remove it on uninstall.

Glpi Developer Document - Where to write files

bplessis avatar Jun 24 '22 13:06 bplessis

plugins/singlesignon/inc/toolbox.class.php at line 110
  Backtrace :
  plugins/singlesignon/inc/toolbox.class.php:110     mkdir()
  plugins/singlesignon/inc/provider.class.php:381    PluginSinglesignonToolbox::savePicture()
  plugins/singlesignon/inc/provider.class.php:279    PluginSinglesignonProvider->prepareInput()
  src/CommonDBTM.php:1572                            PluginSinglesignonProvider->prepareInputForUpdate()
  plugins/singlesignon/front/provider.form.php:54    CommonDBTM->update()

Megachip avatar Sep 09 '22 16:09 Megachip