Project

General

Profile

« Previous | Next » 

Revision e294aded

Added by Ermal LUÇI over 12 years ago

Make the logic a bit more robust and readble

View differences:

etc/inc/config.lib.inc
509 509
		}
510 510
	}
511 511

  
512
	$username = !empty($_SESSION["Username"]) ? $_SESSION['Username'] : empty($_ENV['USER']) ? "(system)" : $_ENV['USER'];
512
	if (empty($_SESSION["Username"])) {
513
		if (empty($_ENV['USER']) || $_ENV['USER'] == "root")
514
			$username = "(system)";
515
		else
516
			$username = $_ENV['USER'];
517
	} else
518
		$username = $_SESSION["Username"];
519

  
513 520
	if (!empty($_SERVER['REMOTE_ADDR']))
514 521
		$username .= '@' . $_SERVER['REMOTE_ADDR'];
515 522

  

Also available in: Unified diff