mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Show if optional PHP extensions are loaded on Admin -> About page
This commit is contained in:
parent
6c0b5ab33b
commit
d534d2700a
4 changed files with 38 additions and 1 deletions
|
|
@ -203,6 +203,12 @@ class RemoteAdminFetch extends AbstractFetchRemote {
|
||||||
this.defaultRequest(fCallback, 'AdminPasswordUpdate', oData);
|
this.defaultRequest(fCallback, 'AdminPasswordUpdate', oData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {?Function} fCallback
|
||||||
|
*/
|
||||||
|
phpExtensions(fCallback) {
|
||||||
|
this.defaultRequest(fCallback, 'AdminPHPExtensions');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new RemoteAdminFetch();
|
export default new RemoteAdminFetch();
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,15 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import { Settings } from 'Common/Globals';
|
import { Settings } from 'Common/Globals';
|
||||||
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
export class AboutAdminSettings /*extends AbstractViewSettings*/ {
|
export class AboutAdminSettings /*extends AbstractViewSettings*/ {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.version = ko.observable(Settings.app('version'));
|
this.version = ko.observable(Settings.app('version'));
|
||||||
|
this.phpextensions = ko.observableArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onBuild() {
|
||||||
|
Remote.phpExtensions((iError, data) => iError || this.phpextensions(data.Result));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -694,6 +694,18 @@ trait Admin
|
||||||
('plugin' !== $sType ? array('Reload' => true) : true) : false);
|
('plugin' !== $sType ? array('Reload' => true) : true) : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function DoAdminPHPExtensions() : array
|
||||||
|
{
|
||||||
|
$aResult = [];
|
||||||
|
foreach (['curl','gd','gmagick','imagick','intl','ldap','pdo_mysql','pdo_pgsql','pdo_sqlite','xxtea','zip'] as $name) {
|
||||||
|
$aResult[] = [
|
||||||
|
'name' => $name,
|
||||||
|
'loaded' => extension_loaded($name)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return $this->DefaultResponse(__FUNCTION__, $aResult);
|
||||||
|
}
|
||||||
|
|
||||||
private function pluginEnable(string $sName, bool $bEnable = true) : bool
|
private function pluginEnable(string $sName, bool $bEnable = true) : bool
|
||||||
{
|
{
|
||||||
if (!\strlen($sName))
|
if (!\strlen($sName))
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,23 @@
|
||||||
<a class="g-ui-link" href="https://snappymail.eu/" target="_blank" style="padding-left: 0">https://snappymail.eu/</a>
|
<a class="g-ui-link" href="https://snappymail.eu/" target="_blank" style="padding-left: 0">https://snappymail.eu/</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="rl-desc span6">
|
<div class="span6">
|
||||||
<h1 style="margin-bottom: 0;">SnappyMail</h1>
|
<h1 style="margin-bottom: 0;">SnappyMail</h1>
|
||||||
<h4 style="margin-top: 0;" data-bind="text: version"></h4>
|
<h4 style="margin-top: 0;" data-bind="text: version"></h4>
|
||||||
<h4 style="color: #aaa; font-weight: normal;">An advanced fork of <a href="https://www.rainloop.net/" target="_blank">RainLoop</a></h4>
|
<h4 style="color: #aaa; font-weight: normal;">An advanced fork of <a href="https://www.rainloop.net/" target="_blank">RainLoop</a></h4>
|
||||||
<h4 style="color: #aaa; font-weight: normal;" data-i18n="TAB_ABOUT/LABEL_TAG_HINT"></h4>
|
<h4 style="color: #aaa; font-weight: normal;" data-i18n="TAB_ABOUT/LABEL_TAG_HINT"></h4>
|
||||||
|
|
||||||
|
<h3>PHP optional extensions</h3>
|
||||||
|
<table class="table table-hover table-bordered"><thead><tr>
|
||||||
|
<th>Extension</th>
|
||||||
|
<th>Loaded</th>
|
||||||
|
</tr></thead><tbody data-bind="foreach: phpextensions">
|
||||||
|
<tr>
|
||||||
|
<td data-bind="text: name"></td>
|
||||||
|
<td data-bind="text: loaded ? '✔' : '❌'"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue