optional server role compatibility checks for plugins

This commit is contained in:
redmatrix
2016-08-22 17:41:41 -07:00
parent e967bc9c45
commit 38ca3bac40
4 changed files with 18 additions and 2 deletions

View File

@@ -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']);