Skip to content

Commit ab4baaa

Browse files
3.0.10
Fixing #3923
1 parent 9ed3e01 commit ab4baaa

File tree

10 files changed

+16
-325
lines changed

10 files changed

+16
-325
lines changed

includes/config/include.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
define('TP_VERSION', '3.0.10');
1919
define("UPGRADE_MIN_DATE", "1697990713");
20-
define('TP_VERSION_MINOR', '130');
20+
define('TP_VERSION_MINOR', '131');
2121
define('TP_TOOL_NAME', 'Teampass');
2222
define('TP_ONE_DAY_SECONDS', 86400);
2323
define('TP_ONE_WEEK_SECONDS', 604800);

includes/config/settings.sample.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
define("DB_PREFIX", "");
88
define("DB_PORT", "");
99
define("DB_ENCODING", "utf8");
10-
define("DB_SSL", false);
10+
define("DB_SSL", false); // if DB over SSL then comment this line
11+
// if DB over SSL then uncomment the following lines
12+
//define("DB_SSL", array(
13+
// "key" => "",
14+
// "cert" => "",
15+
// "ca_cert" => "",
16+
// "ca_path" => "",
17+
// "cipher" => ""
18+
//));
1119
define("DB_CONNECT_OPTIONS", array(
1220
MYSQLI_OPT_CONNECT_TIMEOUT => 10
1321
));

index.php

-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
*/
2626

2727
use TeampassClasses\SuperGlobal\SuperGlobal;
28-
use EZimuel\PHPSecureSession;
29-
use TeampassClasses\PerformChecks\PerformChecks;
3028

3129
header('X-XSS-Protection: 1; mode=block');
3230
header('X-Frame-Options: SameOrigin');
@@ -80,7 +78,6 @@
8078
require_once __DIR__.'/sources/main.functions.php';
8179

8280
// init
83-
loadClasses('DB');
8481
$superGlobal = new SuperGlobal();
8582

8683
// Quick major version check -> upgrade needed?
@@ -95,7 +92,6 @@
9592
exit;
9693
}
9794

98-
$superGlobal = new SuperGlobal();
9995

10096
if (isset($SETTINGS['cpassman_url']) === false || $SETTINGS['cpassman_url'] === '') {
10197
$SETTINGS['cpassman_url'] = $superGlobal->get('REQUEST_URI', 'SERVER');

install/upgrade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ function getSettingValue($val)
515515

516516
echo '
517517
<div class="mt-5">
518-
<a href="#" class="btn btn-primary" onclick="javascript:window.location.href=\'', (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ? 'https' : 'http', '://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/') - 8).'\';"><b>Open TeamPass</b></a>
518+
<a href="#" class="btn btn-primary" onclick="javascript:window.location.href=\'', (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ? 'https' : 'http', '://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/') - 8).'/index.php\';"><b>Open TeamPass</b></a>
519519
</div>';
520520
}
521521

install/upgrade_run_3.0.0.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@
891891
"ADD KEY `CACHE` (`increment_id`, `user_id`)"
892892
);
893893
if (!$res) {
894-
echo '[{"finish":"1", "msg":"", "error":"An error appears when adding the INDEX CACHE to the cache_tree table! ' . mysqli_error($db_link) . '!"}]';
894+
echo '[{"finish":"1", "msg":"", "error":"An error appears when adding the INDEX CACHE to the cache_tree table! ' . addslashes(mysqli_error($db_link)) . '!"}]';
895895
mysqli_close($db_link);
896896
exit();
897897
}

sources/core.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@
2828
use voku\helper\AntiXSS;
2929
use TeampassClasses\SuperGlobal\SuperGlobal;
3030
use EZimuel\PHPSecureSession;
31-
use TeampassClasses\PerformChecks\PerformChecks;
3231

3332
// Load functions
3433
require_once 'main.functions.php';
35-
loadClasses('DB');
3634
$superGlobal = new SuperGlobal();
3735

3836
// Load config if $SETTINGS not defined
@@ -42,8 +40,6 @@
4240
throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1);
4341
}
4442

45-
// Include files
46-
$superGlobal = new SuperGlobal();
4743

4844
/**
4945
* Redirection management.
@@ -52,7 +48,7 @@
5248
*
5349
* @return string refresh page to url
5450
*/
55-
function redirect($url)
51+
function teampassRedirect($url)
5652
{
5753
// Load AntiXSS
5854
$antiXss = new AntiXSS();
@@ -91,7 +87,7 @@ function redirect($url)
9187
&& isset($SETTINGS['enable_sts']) === true
9288
&& (int) $SETTINGS['enable_sts'] === 1
9389
) {
94-
redirect('https://' . $server['http_host'] . $server['request_uri']);
90+
teampassRedirect('https://' . $server['http_host'] . $server['request_uri']);
9591
}
9692

9793
// Load pwComplexity

sources/del_SecureHandler.php

-165
This file was deleted.

0 commit comments

Comments
 (0)