mirror of
https://github.com/Cacti/cacti.git
synced 2026-12-05 14:44:14 +09:00
Resolving Issue #3228
Login page does not remember the last realm used by user
This commit is contained in:
1 parent
1e2202e042
commit
4319f8e035
2 files changed
+25
-1
No files matched your search
@@ -34,6 +34,7 @@ Cacti CHANGELOG
|
||||
-issue#3206: Converted aggregate graph cannot be edited
|
||||
-issue#3209: PHP Error when Creating New Graphs through Automatically Added Devices using Sync Device Template
|
||||
-issue#3216: When editing a Data Source Profile size is shown as 'N/A'
|
||||
-issue#3228: Login page does not remember the last realm used by user
|
||||
|
||||
1.2.8
|
||||
-security#3025: CVE-2019-17357 When viewing graphs, some input variables are not properly checked (SQL injection possible)
|
||||
|
||||
+24
-1
@@ -739,7 +739,7 @@ $selectedTheme = get_selected_theme();
|
||||
<label for='realm'><?php print __('Realm');?></label>
|
||||
</td>
|
||||
<td>
|
||||
<select id='realm' name='realm'><?php
|
||||
<select id='realm' name='realm' class='ui-state-default ui-corner-all'><?php
|
||||
if (cacti_sizeof($realms)) {
|
||||
foreach($realms as $index => $realm) {
|
||||
print "\t\t\t\t\t<option value='" . $index . "'" . ($realm['selected'] ? ' selected="selected"':'') . '>' . html_escape($realm['name']) . "</option>\n";
|
||||
@@ -785,7 +785,30 @@ $selectedTheme = get_selected_theme();
|
||||
</div>
|
||||
<div class='loginRight'></div>
|
||||
<script type='text/javascript'>
|
||||
var storage = Storages.localStorage;
|
||||
|
||||
$(function() {
|
||||
preferredRealm = storage.get('user_realm');
|
||||
|
||||
// Restore the preferred realm
|
||||
if ($('#realm').length) {
|
||||
if (preferredRealm !== undefined) {
|
||||
$('#realm').val(preferredRealm);
|
||||
if ($('#realm').selectmenu('instance') !== undefined) {
|
||||
$('#realm').selectmenu('refresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Control submit in order to store preferred realm
|
||||
$('#login').submit(function(event) {
|
||||
event.preventDefault();
|
||||
if ($('#realm').length) {
|
||||
storage.set('user_realm', $('#realm').val());
|
||||
}
|
||||
$('#login').off('submit').trigger('submit');
|
||||
});
|
||||
|
||||
$('body').css('height', $(window).height());
|
||||
$('.loginLeft').css('width',parseInt($(window).width()*0.33)+'px');
|
||||
$('.loginRight').css('width',parseInt($(window).width()*0.33)+'px');
|
||||
|
||||
Reference in new issue
Block a user