Explorar o código

Added folder name check

Edgard %!s(int64=6) %!d(string=hai) anos
pai
achega
5be034f8a5
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      setup.php

+ 7 - 0
setup.php

@@ -2,6 +2,13 @@
 
 define('PLUGIN_SINGLESIGNON_VERSION', '1.0.0');
 
+$folder = basename(dirname(__FILE__));
+
+if ($folder !== "singlesignon") {
+   $msg = sprintf(__sso("Please, rename the plugin folder \"%s\" to \"singlesignon\""), $folder);
+   Session::addMessageAfterRedirect($msg, true, ERROR);
+}
+
 // Init the hooks of the plugins -Needed
 function plugin_init_singlesignon() {
    global $PLUGIN_HOOKS, $CFG_GLPI, $CFG_SSO;