provide repository versions on admin summary page and an upgrade message if you're behind master
This commit is contained in:
parent
9caaa9397e
commit
4dd3839c41
@ -107,7 +107,7 @@ class Admin extends \Zotlabs\Web\Controller {
|
|||||||
* @param App &$a
|
* @param App &$a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function get() {
|
function get() {
|
||||||
|
|
||||||
logger('admin_content', LOGGER_DEBUG);
|
logger('admin_content', LOGGER_DEBUG);
|
||||||
|
|
||||||
@ -230,17 +230,26 @@ class Admin extends \Zotlabs\Web\Controller {
|
|||||||
. ' A list about current PHP versions can be found <a href="http://php.net/supported-versions.php" class="alert-link">here</a>.';
|
. ' A list about current PHP versions can be found <a href="http://php.net/supported-versions.php" class="alert-link">here</a>.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$vmaster = get_repository_version('master');
|
||||||
|
$vdev = get_repository_version('dev');
|
||||||
|
|
||||||
|
$upgrade = ((version_compare(STD_VERSION,$vmaster) < 0) ? t('Your software should be updated') : '');
|
||||||
|
|
||||||
|
|
||||||
$t = get_markup_template('admin_summary.tpl');
|
$t = get_markup_template('admin_summary.tpl');
|
||||||
return replace_macros($t, array(
|
return replace_macros($t, array(
|
||||||
'$title' => t('Administration'),
|
'$title' => t('Administration'),
|
||||||
'$page' => t('Summary'),
|
'$page' => t('Summary'),
|
||||||
'$adminalertmsg' => $alertmsg,
|
'$adminalertmsg' => $alertmsg,
|
||||||
'$queues' => $queues,
|
'$queues' => $queues,
|
||||||
'$accounts' => array( t('Registered accounts'), $accounts),
|
'$accounts' => array( t('Registered accounts'), $accounts),
|
||||||
'$pending' => array( t('Pending registrations'), $pending),
|
'$pending' => array( t('Pending registrations'), $pending),
|
||||||
'$channels' => array( t('Registered channels'), $channels),
|
'$channels' => array( t('Registered channels'), $channels),
|
||||||
'$plugins' => array( t('Active plugins'), $plugins ),
|
'$plugins' => array( t('Active plugins'), $plugins ),
|
||||||
'$version' => array( t('Version'), STD_VERSION),
|
'$version' => array( t('Version'), STD_VERSION),
|
||||||
|
'$vmaster' => array( t('Repository version (master)'), $vmaster),
|
||||||
|
'$vdev' => array( t('Repository version (dev)'), $vdev),
|
||||||
|
'$upgrade' => $upgrade,
|
||||||
'$build' => get_config('system', 'db_version')
|
'$build' => get_config('system', 'db_version')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ class Siteinfo extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function get() {
|
function get() {
|
||||||
|
|
||||||
if(! get_config('system','hidden_version_siteinfo')) {
|
if(! get_config('system','hidden_version_siteinfo')) {
|
||||||
$version = sprintf( t('Version %s'), \Zotlabs\Project\System::get_project_version());
|
$version = sprintf( t('Version %s'), \Zotlabs\Project\System::get_project_version());
|
||||||
|
@ -2128,3 +2128,18 @@ function deliverable_singleton($channel_id,$xchan) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function get_repository_version($branch = 'master') {
|
||||||
|
|
||||||
|
$path = "https://raw.githubusercontent.com/redmatrix/hubzilla/$branch/boot.php";
|
||||||
|
|
||||||
|
$x = z_fetch_url($path);
|
||||||
|
if($x['success']) {
|
||||||
|
$y = preg_match('/define(.*?)STD_VERSION(.*?)([0-9.].*)\'/',$x['body'],$matches);
|
||||||
|
if($y)
|
||||||
|
return $matches[3];
|
||||||
|
}
|
||||||
|
return '?.?';
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
<h1>{{$title}} - {{$page}}</h1>
|
<h1>{{$title}} - {{$page}}</h1>
|
||||||
{{if $adminalertmsg}}
|
{{if $adminalertmsg}}
|
||||||
<p class="alert alert-warning" role="alert">{{$adminalertmsg}}</p>
|
<p class="alert alert-warning" role="alert">{{$adminalertmsg}}</p>
|
||||||
|
{{/if}}
|
||||||
|
{{if $upgrade}}
|
||||||
|
<p class="alert alert-warning" role="alert">{{$upgrade}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{{$queues.label}}</dt>
|
<dt>{{$queues.label}}</dt>
|
||||||
@ -29,4 +32,12 @@
|
|||||||
<dt>{{$version.0}}</dt>
|
<dt>{{$version.0}}</dt>
|
||||||
<dd>{{$version.1}} - {{$build}}</dd>
|
<dd>{{$version.1}} - {{$build}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt>{{$vmaster.0}}</dt>
|
||||||
|
<dd>{{$vmaster.1}}</dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt>{{$vdev.0}}</dt>
|
||||||
|
<dd>{{$vdev.1}}</dd>
|
||||||
|
</dl>
|
||||||
</div>
|
</div>
|
Reference in New Issue
Block a user