optional server role compatibility checks for plugins
This commit is contained in:
parent
e967bc9c45
commit
38ca3bac40
@ -1341,6 +1341,7 @@ class Admin extends \Zotlabs\Web\Controller {
|
|||||||
'$str_minversion' => t('Minimum project version: '),
|
'$str_minversion' => t('Minimum project version: '),
|
||||||
'$str_maxversion' => t('Maximum project version: '),
|
'$str_maxversion' => t('Maximum project version: '),
|
||||||
'$str_minphpversion' => t('Minimum PHP version: '),
|
'$str_minphpversion' => t('Minimum PHP version: '),
|
||||||
|
'$str_serverroles' => t('Compatible Server Roles: '),
|
||||||
'$str_requires' => t('Requires: '),
|
'$str_requires' => t('Requires: '),
|
||||||
'$disabled' => t('Disabled - version incompatibility'),
|
'$disabled' => t('Disabled - version incompatibility'),
|
||||||
|
|
||||||
|
4
boot.php
4
boot.php
@ -612,11 +612,11 @@ function sys_boot() {
|
|||||||
if(UNO)
|
if(UNO)
|
||||||
App::$config['system']['server_role'] = 'basic';
|
App::$config['system']['server_role'] = 'basic';
|
||||||
else
|
else
|
||||||
App::$config['system']['server_role'] = 'pro';
|
App::$config['system']['server_role'] = 'standard';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! (array_key_exists('server_role',App::$config['system']) && App::$config['system']['server_role']))
|
if(! (array_key_exists('server_role',App::$config['system']) && App::$config['system']['server_role']))
|
||||||
App::$config['system']['server_role'] = 'pro';
|
App::$config['system']['server_role'] = 'standard';
|
||||||
|
|
||||||
App::$timezone = ((App::$config['system']['timezone']) ? App::$config['system']['timezone'] : 'UTC');
|
App::$timezone = ((App::$config['system']['timezone']) ? App::$config['system']['timezone'] : 'UTC');
|
||||||
date_default_timezone_set(App::$timezone);
|
date_default_timezone_set(App::$timezone);
|
||||||
|
@ -404,6 +404,18 @@ function check_plugin_versions($info) {
|
|||||||
return false;
|
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)) {
|
if(array_key_exists('requires',$info)) {
|
||||||
$arr = explode(',',$info['requires']);
|
$arr = explode(',',$info['requires']);
|
||||||
|
@ -24,6 +24,9 @@
|
|||||||
{{if $info.minphpversion}}
|
{{if $info.minphpversion}}
|
||||||
<p class="versionlimit">{{$str_minphpversion}}{{$info.minphpversion}}</p>
|
<p class="versionlimit">{{$str_minphpversion}}{{$info.minphpversion}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{if $info.serverroles}}
|
||||||
|
<p class="versionlimit">{{$str_serverroles}}{{$info.serverroles}}</p>
|
||||||
|
{{/if}}
|
||||||
{{if $info.requires}}
|
{{if $info.requires}}
|
||||||
<p class="versionlimit">{{$str_requires}}{{$info.requires}}</p>
|
<p class="versionlimit">{{$str_requires}}{{$info.requires}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
Reference in New Issue
Block a user