Bearsampp
2026.7.11
Toggle main menu visibility
Loading...
Searching...
No Matches
ajax.xlight.php
Go to the documentation of this file.
1
<?php
2
/*
3
* Copyright (c) 2021-2024 Bearsampp
4
* License: GNU General Public License version 3 or later; see LICENSE.txt
5
* Author: Bear
6
* Website: https://bearsampp.com
7
* Github: https://github.com/Bearsampp
8
*/
9
global
$bearsamppBins
,
$bearsamppLang
;
10
16
17
// Initialize result array
18
$result
= array(
19
'checkport'
=>
''
,
20
'versions'
=>
''
,
21
);
22
23
// Check SMTP port
24
$port
=
$bearsamppBins
->getXlight()->getPort();
25
26
$textServiceStarted
=
$bearsamppLang
->getValue(
Lang::HOMEPAGE_SERVICE_STARTED
);
27
$textServiceStopped
=
$bearsamppLang
->getValue(
Lang::HOMEPAGE_SERVICE_STOPPED
);
28
$textDisabled
=
$bearsamppLang
->getValue(
Lang::DISABLED
);
29
36
if
(
$bearsamppBins
->getXlight()->checkPort(
$port
)) {
37
if
(
$bearsamppBins
->getXlight()->checkPort(
$port
)) {
38
$result
[
'checkport'
] .=
'<span class="float-end badge text-bg-success">'
. sprintf(
$textServiceStarted
,
$port
) .
'</span>'
;
39
}
else
{
40
$result
[
'checkport'
] .=
'<span class="float-end badge text-bg-danger">'
.
$textServiceStopped
.
'</span>'
;
41
}
42
}
else
{
43
$result
[
'checkport'
] =
'<span class="float-end badge text-bg-secondary">'
.
$textDisabled
.
'</span>'
;
44
}
45
51
foreach
(
$bearsamppBins
->getXlight()->getVersionList() as $version) {
52
if
($version !=
$bearsamppBins
->getXlight()->getVersion()) {
53
$result
[
'versions'
] .=
'<span class="m-1 badge text-bg-secondary">'
. $version .
'</span>'
;
54
}
else
{
55
$result
[
'versions'
] .=
'<span class="m-1 badge text-bg-primary">'
.
$bearsamppBins
->getXlight()->getVersion() .
'</span>'
;
56
}
57
}
58
59
// Output the result as a JSON-encoded array
60
echo json_encode(
$result
);
61
$result
$result
Definition
ajax.apache.php:19
$textServiceStopped
$textServiceStopped
Definition
ajax.apache.php:38
$textDisabled
$textDisabled
Definition
ajax.apache.php:39
$bearsamppBins
global $bearsamppBins
Definition
ajax.apache.php:16
$bearsamppLang
global $bearsamppLang
Definition
ajax.apache.php:16
$port
$port
Definition
ajax.apache.php:34
$textServiceStarted
$textServiceStarted
Definition
ajax.apache.php:37
Lang\DISABLED
const DISABLED
Definition
class.lang.php:36
Lang\HOMEPAGE_SERVICE_STOPPED
const HOMEPAGE_SERVICE_STOPPED
Definition
class.lang.php:379
Lang\HOMEPAGE_SERVICE_STARTED
const HOMEPAGE_SERVICE_STARTED
Definition
class.lang.php:378
sandbox
core
resources
homepage
ajax
ajax.xlight.php
Generated by
1.17.0