Exemple #1
0
     }
 }
 /* if we are a guest user in a non-guest area, wipe credentials and prompt for login */
 if (!empty($_SESSION["sess_user_id"])) {
     if (!isset($guest_account) && sizeof(api_user_info(array("username" => read_config_option("guest_user")))) == $_SESSION["sess_user_id"]) {
         kill_session_var("sess_user_id");
     }
 }
 if (empty($_SESSION["sess_user_id"])) {
     /* User not authenticated, prompt for login */
     require_once CACTI_BASE_PATH . "/include/auth/login.php";
     exit;
 } elseif (!empty($_SESSION["sess_user_id"])) {
     /* User authenticated */
     /* check if password is expired */
     if (api_user_expire_info($_SESSION["sess_user_id"]) == "0") {
         $_SESSION["sess_change_password"] = true;
         if (read_config_option("auth_method") == 1 || $current_user["realm"] == "0" && read_config_option("auth_method") == "3") {
             log_save(_("AUTH: User password expired, password change forced"), SEV_NOTICE, FACIL_AUTH);
             header("Location: auth_changepassword.php?ref=" . (isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "index.php"));
             exit;
         }
     }
     /* Check permissions to use this realm against database */
     $realm_id = 0;
     if (isset($user_auth_realm_filenames[basename($_SERVER["PHP_SELF"])])) {
         $realm_id = $user_auth_realm_filenames[basename($_SERVER["PHP_SELF"])];
     }
     $user_realms = api_user_realms_list($_SESSION["sess_user_id"]);
     if ($user_realms[$realm_id]["value"] != "1") {
         log_save(_("AUTH: User access denied to realm ") . $user_auth_realms[$realm_id], SEV_WARNING, FACIL_AUTH);
Exemple #2
0
	<tr height="5" bgcolor="#<?php 
print $colors['navbar_background'];
?>
" class="noprint">
		<td colspan="2">
			<table width="100%">
				<tr>
					<td>
						<?php 
draw_navigation_text();
?>
					</td>
					<?php 
if (isset($_SESSION["sess_user_id"])) {
    if (read_config_option("auth_method") == "1" || $current_user["realm"] == "0" && read_config_option("auth_method") == "3") {
        $expire_days = api_user_expire_info($current_user["id"]);
        if ($expire_days != -1 && $expire_days <= read_config_option("password_expire_warning")) {
            ?>
						<td align="right" class="textError">
							<?php 
            echo _("Password expires in") . " " . $expire_days . _("days");
            ?>
						</td>
					<?php 
        }
    }
}
?>
					<td align="right">
						<?php 
if (isset($_SESSION["sess_user_id"]) && $using_guest_account == false && read_config_option("auth_method") != "0") {