]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - plugins.php
Overview: Make top margin of bottom row smaller
[irc/unrealircd/unrealircd-webpanel.git] / plugins.php
index 739c9c918ae00d720fd72512b54d85875d7c099b..de3307e1af6f4d87259ad04e79425dc7d4f5f652 100644 (file)
@@ -55,19 +55,20 @@ class Plugin
        public $version;
        public $description;
        public $handle;
+       public $email;
 
        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
                {
-                       require_once "plugins/$handle/$handle.php";
+                       require_once UPATH."/plugins/$handle/$handle.php";
 
                        if (!class_exists($handle))
                                $this->error = "Class \"$handle\" doesn't exist";
@@ -84,6 +85,8 @@ class Plugin
                                        $this->error = "Plugin version not defined";
                                elseif (!isset($plugin->description))
                                        $this->error = "Plugin description not defined";
+                               elseif (!isset($plugin->email))
+                                       $this->error = "Plugin email not defined";
                                else
                                {
                                        $this->handle = $handle;
@@ -91,6 +94,7 @@ class Plugin
                                        $this->author = $plugin->author;
                                        $this->version = $plugin->version;
                                        $this->description = $plugin->description;
+                                       $this->email = $plugin->email;
                                }
                        }
                }