aboutsummaryrefslogtreecommitdiffstats
path: root/include/plugin.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-08-22 17:41:41 -0700
committerredmatrix <git@macgirvin.com>2016-08-22 17:41:41 -0700
commit38ca3bac405b339367b513037428f796c433819a (patch)
treee9a0ca2161f037426f8d8fa788d7976fc7a170cc /include/plugin.php
parente967bc9c455c27f08a2add12d566e81036819e4e (diff)
downloadvolse-hubzilla-38ca3bac405b339367b513037428f796c433819a.tar.gz
volse-hubzilla-38ca3bac405b339367b513037428f796c433819a.tar.bz2
volse-hubzilla-38ca3bac405b339367b513037428f796c433819a.zip
optional server role compatibility checks for plugins
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-xinclude/plugin.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/plugin.php b/include/plugin.php
index cb206d944..663d17959 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -404,6 +404,18 @@ function check_plugin_versions($info) {
return false;
}
}
+ if(array_key_exists('serverroles',$info)) {
+ $role = \Zotlabs\Lib\System::get_server_role();
+ if(! (
+ stristr($info['serverroles'],'*')
+ || stristr($info['serverroles'],'any')
+ || stristr($info['serverroles'],$role))) {
+ logger('serverrole limit: ' . $info['name'],LOGGER_NORMAL,LOG_WARNING);
+ return false;
+
+ }
+ }
+
if(array_key_exists('requires',$info)) {
$arr = explode(',',$info['requires']);