diff --git a/include/class.plugin.php b/include/class.plugin.php index 74fddc0766906a4f4966f573f06311453e4cee03..107ff4f46d8b451c038ae4b850f4731a6ada8b7e 100644 --- a/include/class.plugin.php +++ b/include/class.plugin.php @@ -323,7 +323,7 @@ class Plugin { function getConfig() { static $config = null; - if ($config === null) + if ($config === null && $this->config_class) $config = new $this->config_class($this->getId()); return $config; diff --git a/include/staff/plugin.inc.php b/include/staff/plugin.inc.php index 89c056d006dec8d368208b6f14658c0c29af09f0..c1cefd5bc2fb60e1570b97e7fec9e6b838461bf9 100644 --- a/include/staff/plugin.inc.php +++ b/include/staff/plugin.inc.php @@ -2,7 +2,9 @@ $info=array(); if($plugin && $_REQUEST['a']!='add') { - $form = $plugin->getConfig()->getForm(); + $config = $plugin->getConfig(); + if ($config) + $form = $config->getForm(); if ($_POST) $form->isValid(); $title = 'Update Plugin'; @@ -24,12 +26,19 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2"> <tbody> <?php -$form->render(); +if ($form) + $form->render(); +else { ?> + <tr><th>This plugin has no configurable settings<br> + <em>Every plugin should be so easy to use</em></th></tr> +<?php } ?> </tbody></table> <p class="centered"> +<?php if ($form) { ?> <input type="submit" name="submit" value="<?php echo $submit_text; ?>"> <input type="reset" name="reset" value="Reset"> +<?php } ?> <input type="button" name="cancel" value="Cancel" onclick='window.location.href="?"'> </p> </form> diff --git a/include/upgrader/streams/core.sig b/include/upgrader/streams/core.sig index cc5bdea3c043bacc39e0d2213dfa2c8b13c5a8f8..882f4a25247117dd27b27f868e35279e75f29e89 100644 --- a/include/upgrader/streams/core.sig +++ b/include/upgrader/streams/core.sig @@ -1 +1 @@ -6de40a4d5bad7a2923e769a4db1ff3b9 +1b0fce992f6c7ed37a9b2914f86775d4 diff --git a/include/upgrader/streams/core/6de40a4d-1b0fce99.patch.sql b/include/upgrader/streams/core/6de40a4d-1b0fce99.patch.sql new file mode 100644 index 0000000000000000000000000000000000000000..48f9480d54544b4eb94935817109cd930cce487d --- /dev/null +++ b/include/upgrader/streams/core/6de40a4d-1b0fce99.patch.sql @@ -0,0 +1,27 @@ +/** + * @version v1.8.1 - Plugins + * @schema 1b0fce992f6c7ed37a9b2914f86775d4 + * @title Add plugin management system + * + * Add table for plugin manager + */ + +ALTER TABLE `%TABLE_PREFIX%staff` + ADD `backend` varchar(32) default NULL AFTER `passwd`; + +-- Plugins +DROP TABLE IF EXISTS `%TABLE_PREFIX%plugin`; +CREATE TABLE `%TABLE_PREFIX%plugin` ( + `id` int(11) unsigned not null auto_increment, + `name` varchar(30) not null, + `install_path` varchar(60) not null, + `isphar` tinyint(1) not null default 0, + `isactive` tinyint(1) not null default 0, + `installed` datetime not null, + primary key (`id`) +) DEFAULT CHARSET=utf8; + +-- Finished with patch +UPDATE `%TABLE_PREFIX%config` + SET `value` = '1b0fce992f6c7ed37a9b2914f86775d4' + WHERE `key` = 'schema_signature' AND `namespace` = 'core'; diff --git a/scp/login.php b/scp/login.php index 5d49282b8a6bbed101a07d0c73b48490495f52bb..17424b6aeda068aa29b8bd233416cc3c604ad868 100644 --- a/scp/login.php +++ b/scp/login.php @@ -37,7 +37,7 @@ if($_POST) { } // Consider single sign-on authentication backends -if (!$thisstaff->getId() || !$thisstaff->isValid()) { +if (!$thisstaff || !($thisstaff->getId() || $thisstaff->isValid())) { if (($user = AuthenticationBackend::singleSignOn($errors)) && ($user instanceof Staff)) @header("Location: $dest");