"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "auth_login.php" between
cacti-1.2.21.tar.gz and cacti-1.2.22.tar.gz

About: Cacti is a complete network graphing solution designed to harness the power of RRDTool’s data storage and graphing functionality.

auth_login.php  (cacti-1.2.21):auth_login.php  (cacti-1.2.22)
skipping to change at line 43 skipping to change at line 43
* For all but basic, this means that two post variables must be * For all but basic, this means that two post variables must be
* set. Additionally, for basic authentication verify the user, * set. Additionally, for basic authentication verify the user,
* and if not valid generate a fatal error. * and if not valid generate a fatal error.
*/ */
$username = auth_get_username(); // Get the username from either basic auth or t he login form $username = auth_get_username(); // Get the username from either basic auth or t he login form
$version = get_cacti_version(); // Get the current Cacti version $version = get_cacti_version(); // Get the current Cacti version
/* initialize some variables */ /* initialize some variables */
$user = array(); // An array that will incl ude all user details $user = array(); // An array that will incl ude all user details
$user_enabled = true; // A variable to let plugi ns know that the user is enabled $user_enabled = true; // A variable to let plugi ns know that the user is enabled
$guest_user = false; // Indicates the the Guest account is being used $guest_user = false; // Indicates the Guest acc ount is being used
$realm = 0; // The compensated realm u sed for template and user validation $realm = 0; // The compensated realm u sed for template and user validation
$frv_realm = get_nfilter_request_var('realm', 0); // The dropdown value for realm $frv_realm = get_nfilter_request_var('realm', 0); // The dropdown value for realm
$auth_method = read_config_option('auth_method'); // The authentication meth od for Cacti $auth_method = read_config_option('auth_method'); // The authentication meth od for Cacti
$error = false; // Global variable, will b e true if any errors occur $error = false; // Global variable, will b e true if any errors occur
$error_msg = ''; // The errors message in c ase there was a login error $error_msg = ''; // The errors message in c ase there was a login error
/* glboal variables for exception handling */ /* global variables for exception handling */
global $error, $error_msg; global $error, $error_msg;
if (get_nfilter_request_var('action') == 'login' || $auth_method == 2) { if (get_nfilter_request_var('action') == 'login' || $auth_method == 2) {
if ($auth_method >= 2 && $frv_realm <= 1) { if ($auth_method > 2 && $frv_realm <= 1) {
// User picked 'local' from dropdown; // User picked 'local' from dropdown;
$auth_method = 1; $auth_method = 1;
} else { } else {
$auth_method = read_config_option('auth_method'); $auth_method = read_config_option('auth_method');
} }
// Compensate as the dropdown for LDAP is off by one // Compensate as the dropdown for LDAP is off by one
if ($frv_realm == 2) { if ($frv_realm == 2) {
$realm = 3; $realm = 3;
} elseif ($auth_method == 2) { } elseif ($auth_method == 2) {
skipping to change at line 145 skipping to change at line 145
cacti_log("LOGIN: Authenticated user '" . $username . "' using guest account '" . $user['username'] . "'", false, 'AUTH'); cacti_log("LOGIN: Authenticated user '" . $username . "' using guest account '" . $user['username'] . "'", false, 'AUTH');
if ($username != '' && get_template_account($username) == 0) { if ($username != '' && get_template_account($username) == 0) {
raise_message('template_disabled', __('User was A uthenticated, but the Template Account is disabled. Using Guest Account'), MESS AGE_LEVEL_WARN); raise_message('template_disabled', __('User was A uthenticated, but the Template Account is disabled. Using Guest Account'), MESS AGE_LEVEL_WARN);
} }
$guest_user = true; $guest_user = true;
} else { } else {
/* error */ /* error */
$error = true; $error = true;
$error_msg = __('Access Denied! Guest user id %s does no t exist. Please contact your Adminitrator.', read_config_option('guest_user')); $error_msg = __('Access Denied! Guest user id %s does no t exist. Please contact your Administrator.', read_config_option('guest_user')) ;
cacti_log("LOGIN FAILED: Unable to locate guest user '" . read_config_option('guest_user') . "'", false, 'AUTH'); cacti_log("LOGIN FAILED: Unable to locate guest user '" . read_config_option('guest_user') . "'", false, 'AUTH');
if ($auth_method == 2) { if ($auth_method == 2) {
auth_display_custom_error_message($error_msg); auth_display_custom_error_message($error_msg);
exit; exit;
} }
} }
} }
skipping to change at line 202 skipping to change at line 202
cacti_log(sprintf("LOGIN FAILED: User %s with id %s does not have access to any area of Cacti.", $user['username'], $user['id']), false, 'AUTH'); cacti_log(sprintf("LOGIN FAILED: User %s with id %s does not have access to any area of Cacti.", $user['username'], $user['id']), false, 'AUTH');
if ($auth_method == 2) { if ($auth_method == 2) {
auth_display_custom_error_message($error_msg); auth_display_custom_error_message($error_msg);
exit; exit;
} }
} }
/* remember me support. Not for guest of basic auth */ /* remember me support. Not for guest of basic auth */
if ($auth_method != 2 && $username != get_guest_account()) { if ($auth_method != 2 && $user['id'] !== get_guest_account()) {
if (!$error && isset_request_var('remember_me') && read_c onfig_option('auth_cache_enabled') == 'on') { if (!$error && isset_request_var('remember_me') && read_c onfig_option('auth_cache_enabled') == 'on') {
set_auth_cookie($user); set_auth_cookie($user);
} }
} }
if (!$error) { if (!$error) {
/* set the php session */ /* set the php session */
$_SESSION['sess_user_id'] = $user['id']; $_SESSION['sess_user_id'] = $user['id'];
/* handle 'force change password' */ /* handle 'force change password' */
skipping to change at line 370 skipping to change at line 370
</tr> </tr>
<?php } if (read_config_option('auth_cach e_enabled') == 'on') { ?> <?php } if (read_config_option('auth_cach e_enabled') == 'on') { ?>
<tr> <tr>
<td colspan='2'> <td colspan='2'>
<input style='ver tical-align:-3px;' type='checkbox' id='remember_me' name='remember_me' <?php pri nt (isset($_COOKIE['cacti_remembers']) || !isempty_request_var('remember_me') ? 'checked':'');?>> <input style='ver tical-align:-3px;' type='checkbox' id='remember_me' name='remember_me' <?php pri nt (isset($_COOKIE['cacti_remembers']) || !isempty_request_var('remember_me') ? 'checked':'');?>>
<label for='remem ber_me'><?php print __('Keep me signed in');?></label> <label for='remem ber_me'><?php print __('Keep me signed in');?></label>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
<tr> <tr>
<td cospan='2'> <td colspan='2'>
<input type='subm it' class='ui-button ui-corner-all ui-widget' value='<?php print __esc('Login'); ?>'> <input type='subm it' class='ui-button ui-corner-all ui-widget' value='<?php print __esc('Login'); ?>'>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<?php api_plugin_hook('login_after'); ?> <?php api_plugin_hook('login_after'); ?>
</form> </form>
<div class='loginErrors'> <div class='loginErrors'>
<?php <?php
if ($error) { if ($error) {
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)