Hide system information from anyone but admins

This commit is contained in:
Fedor A. Fetisov 2018-01-11 23:35:13 +03:00
parent 84e4de1e7a
commit 8ced21fe86
2 changed files with 37 additions and 33 deletions

View File

@ -35,8 +35,10 @@ class AboutController extends AbstractController
*/ */
public function indexAction(Request $request) public function indexAction(Request $request)
{ {
$operator = $this->getOperator();
$page = array_merge( $page = array_merge(
array( array(
'showSystemInfo' => is_capable(CAN_ADMINISTRATE, $operator),
'localizations' => get_available_locales(), 'localizations' => get_available_locales(),
'phpVersion' => phpversion(), 'phpVersion' => phpversion(),
'extensions' => $this->getExtensionsInfo(), 'extensions' => $this->getExtensionsInfo(),
@ -45,7 +47,7 @@ class AboutController extends AbstractController
'menuid' => 'about', 'menuid' => 'about',
'availableUpdates' => $this->getAvailableUpdates(), 'availableUpdates' => $this->getAvailableUpdates(),
), ),
prepare_menu($this->getOperator()) prepare_menu($operator)
); );
return $this->render('about', $page); return $this->render('about', $page);

View File

@ -14,6 +14,7 @@
<p>{{{l10n "Copyright &copy; {0} Contributors of the Mibew Messenger project." "2005-2017"}}}</p> <p>{{{l10n "Copyright &copy; {0} Contributors of the Mibew Messenger project." "2005-2017"}}}</p>
<p>{{{l10n "For more information visit the official site of the project: <a href=\"https://mibew.org/\">https://mibew.org/</a>"}}}</p> <p>{{{l10n "For more information visit the official site of the project: <a href=\"https://mibew.org/\">https://mibew.org/</a>"}}}</p>
{{#if showSystemInfo}}
<br/><br/> <br/><br/>
<h2>{{l10n "System information"}}</h2> <h2>{{l10n "System information"}}</h2>
@ -51,6 +52,7 @@
{{l10n "There is no available updates."}}<br/><br/> {{l10n "There is no available updates."}}<br/><br/>
{{/if}} {{/if}}
<a href="{{route "update_check"}}">{{l10n "Check for available updates"}}</a> <a href="{{route "update_check"}}">{{l10n "Check for available updates"}}</a>
{{/if}}
</div> </div>
<div class="form-footer"> <div class="form-footer">