Skip to content

Commit a453825

Browse files
author
Daniel Neto
committed
Update
1 parent 2abf7a1 commit a453825

File tree

4 files changed

+44
-18
lines changed

4 files changed

+44
-18
lines changed

Diff for: install/checkConfiguration.php

+19-7
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,28 @@
9797
$content = "<?php
9898
\$global['disableAdvancedConfigurations'] = 0;
9999
\$global['videoStorageLimitMinutes'] = 0;
100-
//\$global['webSiteRootURL'] = '{$_POST['webSiteRootURL']}';
101-
// get the subdirectory, if exists
102100
103-
\$DOCUMENT_ROOT = str_replace('/',DIRECTORY_SEPARATOR,\$_SERVER[\"DOCUMENT_ROOT\"]);
104-
\$subDir = str_replace(array(\$DOCUMENT_ROOT, 'configuration.php'), array('',''), __FILE__);
105-
\$global['webSiteRootURL'] = \"http\".(!empty(\$_SERVER['HTTPS'])?\"s\":\"\").\"://\".\$_SERVER['SERVER_NAME'].\$subDir;
106-
\$global['webSiteRootURL'] = str_replace('\\\','/',\$global['webSiteRootURL']);
101+
// Get the HTTP/HTTPS scheme
102+
\$scheme = 'http' . (!empty(\$_SERVER['HTTPS']) && \$_SERVER['HTTPS'] !== 'off' ? 's' : '');
107103
108-
\$global['systemRootPath'] = '{$_POST['systemRootPath']}';
104+
// Get the server name
105+
\$serverName = \$_SERVER['SERVER_NAME'];
106+
107+
// Get the server port
108+
\$serverPort = \$_SERVER['SERVER_PORT'];
109+
110+
// Check if the port is a standard port (80 for HTTP, 443 for HTTPS) to decide whether to include it in the URL
111+
\$includePort = \$serverPort !== '80' && \$serverPort !== '443';
109112
113+
// Get the subdirectory, if exists
114+
\$DOCUMENT_ROOT = str_replace('/', DIRECTORY_SEPARATOR, \$_SERVER['DOCUMENT_ROOT']);
115+
\$subDir = str_replace(array(\$DOCUMENT_ROOT, 'configuration.php'), array('', ''), __FILE__);
116+
\$subDir = str_replace('\\\','/', \$subDir); // Ensure forward slashes
117+
118+
// Construct the webSiteRootURL with or without port
119+
\$global['webSiteRootURL'] = \$scheme . '://' . \$serverName . (\$includePort ? ':' . \$serverPort : '') . \$subDir;
120+
121+
\$global['systemRootPath'] = '{$_POST['systemRootPath']}';
110122
111123
\$mysqlHost = '{$_POST['databaseHost']}';
112124
\$mysqlPort = '{$_POST['databasePort']}';

Diff for: objects/include_config.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
$offset = sprintf('%+d:%02d', $hrs*$sgn, $mins);
1616
$global['mysqli']->query("SET time_zone='$offset';");
1717

18-
header('Set-Cookie: cross-site-cookie=name; SameSite=None; Secure');
18+
header('Set-Cookie: cross-site-cookie=name; SameSite=Lax; Secure');
19+
1920
session_start();
2021

2122
require_once $global['systemRootPath'] . 'objects/Object.php';

Diff for: view/css/style.css

+4
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ div.clearfix {
136136
text-overflow: ellipsis;
137137
}
138138

139+
.ellipsis .clearfix{
140+
margin: 2px;
141+
}
142+
139143
.margin-top-15 {
140144
margin-top: 15px;
141145
}

Diff for: view/index.php

+19-10
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
),
3535
);
3636

37+
//var_dump(__LINE__, "{$global['webSiteRootURL']}view/getBestEncoder.php", $serverPort !== '80' && $serverPort !== '443');exit;
3738
$bestEncoder = json_decode(url_get_contents("{$global['webSiteRootURL']}view/getBestEncoder.php", stream_context_create($arrContextOptions)));
3839

3940
if (empty($bestEncoder)) {
@@ -205,14 +206,23 @@
205206
<div data-target="#l<?php echo $value['id']; ?>" data-toggle="tab">
206207
<div class="ellipsis">
207208
<span class="account-type"><?php echo $value['name']; ?></span>
208-
<span id="recommended<?php echo $value['id']; ?>" class="label label-success recommended" style="display: none;"><i class="fa fa-check"></i> Recommended</span><br />
209-
<span id="label<?php echo $value['id']; ?>" class="label label-danger">Offline</span> <span class="account-amount" id="queuesize<?php echo $value['id']; ?>">Queue Size 0 </span> / <span class="account-amount" id="concurrent<?php echo $value['id']; ?>">Concurrent 1 </span> <br />
210-
<a href="<?php echo $value['siteURL']; ?>" class="account-link"><?php
211-
$parts = parse_url($value['siteURL']);
212-
echo $parts["host"];
213-
?></a><br>
214-
<span id="ping<?php echo $value['id']; ?>" class="label label-default">Searching Ping ...</span>
215-
<span id="maxfilesize<?php echo $value['id']; ?>" class="label label-default">Max File Size 0Mb</span>
209+
<div class="clearfix"></div>
210+
<span id="recommended<?php echo $value['id']; ?>" class="label label-success recommended" style="display: none;">
211+
<i class="fa fa-check"></i> Recommended
212+
</span>
213+
<span id="label<?php echo $value['id']; ?>" class="label label-danger">Offline</span>
214+
<div class="clearfix hidden-xs"></div>
215+
<span class="account-amount" id="queuesize<?php echo $value['id']; ?>">Queue Size 0 </span> / <span class="account-amount" id="concurrent<?php echo $value['id']; ?>">Concurrent 1 </span>
216+
<div class="clearfix"></div>
217+
<a href="<?php echo $value['siteURL']; ?>" class="account-link">
218+
<?php
219+
$parts = parse_url($value['siteURL']);
220+
echo $parts["host"];
221+
?>
222+
</a>
223+
<div class="clearfix hidden-xs"></div>
224+
<span id="ping<?php echo $value['id']; ?>" class="label label-default">Searching Ping ...</span>
225+
<span id="maxfilesize<?php echo $value['id']; ?>" class="label label-default">Max File Size 0Mb</span>
216226
</div>
217227

218228
</div>
@@ -233,8 +243,7 @@
233243
?>" id="l<?php echo $value['id']; ?>"><!--style="padding-left: 60px; padding-right:100px"-->
234244
<div class="row">
235245
<div class="col-sm-12">
236-
<canvas id="canvas<?php echo $value['id']; ?>" rowId="<?php echo $value['id']; ?>"
237-
siteURL="<?php echo $value['siteURL']; ?>" class="ping" height="30"></canvas>
246+
<canvas id="canvas<?php echo $value['id']; ?>" rowId="<?php echo $value['id']; ?>" siteURL="<?php echo $value['siteURL']; ?>" class="ping" height="30"></canvas>
238247
</div>
239248
<div class="col-sm-12" style="min-height: 70vh;">
240249
<iframe src="<?php echo $value['siteURL']; ?>?noNavbar=1&webSiteRootURL=<?php echo urlencode($_SESSION["login"]->streamer); ?>&user=<?php echo $_SESSION["login"]->user; ?>&pass=<?php echo $_SESSION["login"]->pass; ?>" frameborder="0" style="overflow:hidden;height:100vh;width:100%;" height="100%" width="100%"></iframe>

0 commit comments

Comments
 (0)