Skip to content

Commit 84e8a19

Browse files
committed
SimpleRisk 20240726-001 Release
1 parent 6784a6a commit 84e8a19

6,711 files changed

Lines changed: 609307 additions & 1867213 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

simplerisk/account/change_password.php

Lines changed: 59 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
/* This Source Code Form is subject to the terms of the Mozilla Public
33
* License, v. 2.0. If a copy of the MPL was not distributed with this
44
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5-
6-
// Include required functions file
7-
require_once(realpath(__DIR__ . '/../includes/functions.php'));
8-
require_once(realpath(__DIR__ . '/../includes/authenticate.php'));
9-
require_once(realpath(__DIR__ . '/../includes/display.php'));
10-
require_once(realpath(__DIR__ . '/../includes/alerts.php'));
11-
require_once(realpath(__DIR__ . '/../vendor/autoload.php'));
5+
$active_sidebar_menu = "Admin";
6+
$active_sidebar_submenu ="UserManagement";
7+
$title = 'SimpleRisk: Enterprise Risk Management Simplified';
8+
require_once(realpath(__DIR__ . '/../sidebar.php'));
129

1310
// Add various security headers
1411
add_security_headers();
@@ -20,8 +17,6 @@
2017
include_csrf_magic();
2118

2219
// Include the SimpleRisk language file
23-
// Ignoring detections related to language files
24-
// @phan-suppress-next-line SecurityCheck-PathTraversal
2520
require_once(language_file());
2621

2722
// Check if a new password was submitted
@@ -93,76 +88,64 @@
9388
}
9489

9590
?>
96-
97-
<!doctype html>
98-
<html>
99-
100-
<head>
101-
<meta http-equiv="X-UA-Compatible" content="IE=10,9,7,8">
102-
<?php
103-
// Use these jQuery scripts
104-
$scripts = [
105-
'jquery.min.js',
106-
];
107-
108-
// Include the jquery javascript source
109-
display_jquery_javascript($scripts);
110-
111-
display_bootstrap_javascript();
112-
?>
113-
<title>SimpleRisk: Enterprise Risk Management Simplified</title>
114-
<meta name="viewport" content="width=device-width, initial-scale=1">
115-
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
116-
<link rel="stylesheet" href="../css/bootstrap.css?<?php echo current_version("app"); ?>">
117-
<link rel="stylesheet" href="../css/bootstrap-responsive.css?<?php echo current_version("app"); ?>">
118-
<link rel="stylesheet" href="../css/divshot-util.css?<?php echo current_version("app"); ?>">
119-
<link rel="stylesheet" href="../css/divshot-canvas.css?<?php echo current_version("app"); ?>">
120-
<link rel="stylesheet" href="../css/display.css?<?php echo current_version("app"); ?>">
121-
<link rel="stylesheet" href="../vendor/components/font-awesome/css/fontawesome.min.css?<?php echo current_version("app"); ?>">
122-
<link rel="stylesheet" href="../css/theme.css?<?php echo current_version("app"); ?>">
123-
<link rel="stylesheet" href="../css/side-navigation.css?<?php echo current_version("app"); ?>">
124-
<?php
125-
setup_favicon("..");
126-
setup_alert_requirements("..");
127-
?>
128-
</head>
129-
130-
<body>
131-
132-
133-
<?php
134-
view_top_menu("Configure");
135-
136-
// Get any alert messages
137-
get_alert();
138-
?>
91+
<link rel="stylesheet" href="../css/theme.css?<?= $current_app_version ?>">
92+
<style>
93+
input[type="password"]{
94+
max-width: 50% !important;
95+
}
96+
</style>
97+
<div class="page-breadcrumb">
98+
<div class="row">
99+
<div class="col-12 d-flex no-block align-items-center">
100+
<h4 class="page-title"><?= $escaper->escapeHtml($lang['ProfileDetails']); ?></h4>
101+
<div class="ms-auto text-end">
102+
<nav aria-label="breadcrumb">
103+
<ol class="breadcrumb">
104+
<li class="breadcrumb-item"><a href="../account/profile.php">Overview</a></li>
105+
</ol>
106+
</nav>
107+
</div>
108+
</div>
109+
</div>
110+
</div>
139111
<div class="container-fluid">
140-
<div class="row-fluid">
141-
<div class="span4 offset4">
142-
<div class="well">
143-
<?php
144-
//if (isset($_SESSION['user_type']) && $_SESSION['user_type'] != "ldap")
145-
//{
146-
echo "<div class=\"hero-unit\">\n";
147-
echo "<form name=\"change_password\" method=\"post\" action=\"\">\n";
148-
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
149-
echo "<tr><td colspan=\"2\"><h4>" . $escaper->escapeHtml($lang['ChangePassword']) . "</h4></td><tr>\n";
150-
echo "<tr><td>" . $escaper->escapeHtml($lang['CurrentPassword']) . ":&nbsp</td><td><input maxlength=\"100\" name=\"current_pass\" id=\"current_pass\" class=\"input-medium\" type=\"password\" autocomplete=\"off\" /></td></tr>\n";
151-
echo "<tr><td>" . $escaper->escapeHtml($lang['NewPassword']) . ":&nbsp</td><td><input maxlength=\"100\" name=\"new_pass\" id=\"new_pass\" class=\"input-medium\" type=\"password\" autocomplete=\"off\" /></td></tr>\n";
152-
echo "<tr><td>" . $escaper->escapeHtml($lang['ConfirmPassword']) . ":&nbsp;</td><td><input maxlength=\"100\" name=\"confirm_pass\" id=\"confirm_pass\" class=\"input-medium\" type=\"password\" autocomplete=\"off\" /></td></tr>\n";
153-
echo "</table>\n";
154-
echo "<div class=\"form-actions\">\n";
155-
echo "<button type=\"submit\" name=\"change_password\" class=\"btn btn-primary\">" . $escaper->escapeHtml($lang['Submit']) . "</button>\n";
156-
echo "<input class=\"btn\" value=\"" . $escaper->escapeHtml($lang['Reset']) . "\" type=\"reset\">\n";
157-
echo "</div>\n";
158-
echo "</form>\n";
159-
echo "</div>\n";
160-
// }
161-
?>
112+
<div class="row">
113+
<div class="col-lg-12">
114+
<div class="card">
115+
<form class="form-horizontal" action="" method="post">
116+
<div class="card-body">
117+
<h4 class="card-title"><?= $escaper->escapeHtml($lang['ChangePassword']);?></h4>
118+
119+
<div>
120+
<label><?= $escaper->escapeHtml($lang['CurrentPassword']);?></label>
121+
<input type="password" class="form-control" id="current_pass" name="current_pass"/>
122+
</div>
123+
<div>
124+
<label><?= $escaper->escapeHtml($lang['NewPassword']);?></label>
125+
<input type="password" class="form-control" id="new_pass" name="new_pass"/>
126+
</div>
127+
<div class="form-group">
128+
<label><?= $escaper->escapeHtml($lang['ConfirmPassword']);?></label>
129+
<input type="password" class="form-control" id="confirm_pass" name="confirm_pass"/>
130+
</div>
131+
<div class="form-group">
132+
<div>
133+
<button type="submit" class="btn btn-primary" name="change_password" value="submit"><?= $escaper->escapeHtml($lang['Submit']);?></button>
134+
135+
<button type="reset" class="btn"><?= $escaper->escapeHtml($lang['Reset']);?></button>
136+
137+
</div>
138+
</div>
139+
</div>
140+
</form>
162141
</div>
163142
</div>
164143
</div>
165144
</div>
166-
</body>
145+
</div>
146+
<?php
147+
require_once(realpath(__DIR__ . '/../footer.php'));
167148

168-
</html>
149+
get_alert();
150+
setup_alert_requirements("..");
151+
?>

simplerisk/account/mfa.php

Lines changed: 53 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
<?php
2-
32
/* This Source Code Form is subject to the terms of the Mozilla Public
43
* License, v. 2.0. If a copy of the MPL was not distributed with this
54
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
65

6+
// Render the header and sidebar
7+
require_once(realpath(__DIR__ . '/../includes/renderutils.php'));
8+
9+
$breadcrumb_title_key = "MFA Configuration";
10+
render_header_and_sidebar(breadcrumb_title_key: $breadcrumb_title_key);
11+
712
// Include required functions file
813
require_once(realpath(__DIR__ . '/../includes/functions.php'));
914
require_once(realpath(__DIR__ . '/../includes/mfa.php'));
@@ -13,18 +18,6 @@
1318
require_once(realpath(__DIR__ . '/../includes/alerts.php'));
1419
require_once(realpath(__DIR__ . '/../vendor/autoload.php'));
1520

16-
// Add various security headers
17-
add_security_headers();
18-
19-
// Add the session
20-
add_session_check();
21-
22-
// Include the CSRF Magic library
23-
include_csrf_magic();
24-
25-
// Include the SimpleRisk language file
26-
require_once(language_file());
27-
2821
// If the user attempted to verify the MFA
2922
if (isset($_POST['verify']))
3023
{
@@ -48,93 +41,61 @@
4841
}
4942

5043
?>
51-
52-
<!doctype html>
53-
<html>
54-
55-
<head>
56-
<meta http-equiv="X-UA-Compatible" content="IE=10,9,7,8">
57-
<?php
58-
// Use these jQuery scripts
59-
$scripts = [
60-
'jquery.min.js',
61-
];
62-
63-
// Include the jquery javascript source
64-
display_jquery_javascript($scripts);
65-
66-
// Use these jquery-ui scripts
67-
$scripts = [
68-
'jquery-ui.min.js',
69-
];
70-
71-
// Include the jquery-ui javascript source
72-
display_jquery_ui_javascript($scripts);
73-
74-
display_bootstrap_javascript();
75-
?>
76-
<script src="../js/bootstrap-multiselect.js?<?php echo current_version("app"); ?>"></script>
77-
<script src="../js/permissions-widget.js?<?php echo current_version("app"); ?>"></script>
78-
<title>SimpleRisk: Enterprise Risk Management Simplified</title>
79-
<meta name="viewport" content="width=device-width, initial-scale=1">
80-
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
81-
<link rel="stylesheet" href="../css/bootstrap.css?<?php echo current_version("app"); ?>">
82-
<link rel="stylesheet" href="../css/bootstrap-responsive.css?<?php echo current_version("app"); ?>">
83-
<link rel="stylesheet" href="../css/bootstrap-multiselect.css?<?php echo current_version("app"); ?>">
84-
<link rel="stylesheet" href="../css/divshot-util.css?<?php echo current_version("app"); ?>">
85-
<link rel="stylesheet" href="../css/divshot-canvas.css?<?php echo current_version("app"); ?>">
86-
<link rel="stylesheet" href="../css/display.css?<?php echo current_version("app"); ?>">
87-
<link rel="stylesheet" href="../vendor/components/font-awesome/css/fontawesome.min.css?<?php echo current_version("app"); ?>">
88-
<link rel="stylesheet" href="../css/theme.css?<?php echo current_version("app"); ?>">
89-
<link rel="stylesheet" href="../css/side-navigation.css?<?php echo current_version("app"); ?>">
44+
<div class="row bg-white">
45+
<div class="col-12">
46+
<div class="card-body border my-2">
9047

9148
<?php
92-
setup_favicon("..");
93-
setup_alert_requirements("..");
94-
?>
95-
96-
</head>
97-
98-
<body>
99-
<?php
100-
view_top_menu("Configure");
49+
echo "
50+
<form name='mfa' method='post' action=''>
51+
";
10152

102-
// Get any alert messages
103-
get_alert();
53+
// If the authenticated user does not have MFA enabled
54+
if (!mfa_enabled_for_uid($_SESSION['uid'])) {
10455

105-
?>
56+
// Display the MFA verification webpage content
57+
display_mfa_verification_page();
10658

107-
<div class="container-fluid">
108-
<div class="row-fluid">
109-
<div class="span12">
110-
<div class="row-fluid">
111-
<div class="span6">
59+
} else {
11260

113-
<?php
114-
115-
echo "<form name='mfa' method='post' action=''>\n";
61+
// Display the MFA reset webpage content
62+
display_mfa_reset_page();
11663

117-
// If the authenticated user does not have MFA enabled
118-
if (!mfa_enabled_for_uid($_SESSION['uid']))
119-
{
120-
// Display the MFA verification webpage content
121-
display_mfa_verification_page();
122-
}
123-
else
124-
{
125-
// Display the MFA reset webpage content
126-
display_mfa_reset_page();
127-
}
64+
}
12865

129-
echo "</form>\n";
66+
echo "
67+
</form>
68+
";
13069

131-
?>
132-
</div>
133-
</div>
134-
</div>
135-
</div>
136-
</div>
70+
?>
13771

138-
</body>
72+
</div>
73+
</div>
74+
</div>
75+
<script type="text/javascript">
76+
$(document).ready(function() {
77+
78+
// Configure the 'Back' button
79+
setTimeout(() => {
80+
$("div.page-breadcrumb ol.breadcrumb li.breadcrumb-item.submenu a").text("Back");
81+
}, 0);
82+
$("div.page-breadcrumb ol.breadcrumb li.breadcrumb-item.submenu a").attr("href", "javascript:history.go(-1)");
83+
84+
});
85+
</script>
86+
<style>
87+
88+
/* Only show the 'Back' button */
89+
div.page-breadcrumb ol.breadcrumb li.breadcrumb-item:not(.submenu) {
90+
display: none;
91+
}
92+
93+
div.page-breadcrumb ol.breadcrumb li.breadcrumb-item.submenu::before {
94+
display: none;
95+
}
13996

140-
</html>
97+
</style>
98+
<?php
99+
// Render the footer of the page. Please don't put code after this part.
100+
render_footer();
101+
?>

0 commit comments

Comments
 (0)