]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
Fix search for plugins and include common.php and header.php in the example
authorValerie Pond <redacted>
Wed, 11 Jan 2023 22:47:14 +0000 (22:47 +0000)
committerValerie Pond <redacted>
Wed, 11 Jan 2023 22:47:14 +0000 (22:47 +0000)
plugins.php
plugins/example_plugin/example.php
plugins/index.php [new file with mode: 0644]

index 739c9c918ae00d720fd72512b54d85875d7c099b..0f044267d87bf34c4ce685ca16e138245c24d221 100644 (file)
@@ -59,11 +59,11 @@ class Plugin
        public $error = NULL;
        function __construct($handle)
        {
-               if (!is_dir("plugins/$handle"))
-                       $this->error = "Plugin directory \"plugins/$handle\" doesn't exist";
+               if (!is_dir(UPATH."/plugins/$handle"))
+                       $this->error = "Plugin directory \"".UPATH."/plugins/$handle\" doesn't exist";
 
-               else if (!is_file("plugins/$handle/$handle.php"))
-                       $this->error = "Plugin file \"plugins/$handle/$handle.php\" doesn't exist";
+               else if (!is_file(UPATH."/plugins/$handle/$handle.php"))
+                       $this->error = "Plugin file \"".UPATH."/plugins/$handle/$handle.php\" doesn't exist";
 
                else
                {
index e5281d8226e6794de66b1da933bd205e9941a488..5a5f07fc75e82e5b81d66904c69bfd45cb52d82a 100644 (file)
@@ -1,3 +1,4 @@
 <?php
+require_once "../../common.php";
 require_once "../../header.php";
 echo "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
\ No newline at end of file
diff --git a/plugins/index.php b/plugins/index.php
new file mode 100644 (file)
index 0000000..bc5d8e9
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+
+// Silence is golden or something idk I'm not a goldsmith