From 38ca3bac405b339367b513037428f796c433819a Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 22 Aug 2016 17:41:41 -0700 Subject: optional server role compatibility checks for plugins --- include/plugin.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/plugin.php') 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']); -- cgit v1.2.3