Project

General

Profile

« Previous | Next » 

Revision 4111fcf5

Added by Ermal LUÇI over 12 years ago

Always commit the session fast to allow other consumers to proceed to their requests. This unbreaks now the lock up the GUI had allowing only one action from same source per time. Now even if you run a command that blocks indefinitely for example the GUI want lock anymore but allow you to proceed to other actions

View differences:

etc/inc/config.lib.inc
497 497
		log_error("WARNING! Configuration written on bootup.  This can cause stray openvpn and load balancing items in config.xml");
498 498
	*/
499 499

  
500
	if (!session_id())
501
		session_start();
500 502
	if (!empty($_SESSION['Username']) && ($_SESSION['Username'] != "admin")) {
501 503
		$user = getUserEntry($_SESSION['Username']);
502
		if (is_array($user) && userHasPrivilege($user, "user-config-readonly"))
504
		if (is_array($user) && userHasPrivilege($user, "user-config-readonly")) {
505
			session_commit();
503 506
			return false;
507
		}
504 508
	}
509

  
505 510
	$username = empty($_SESSION["Username"]) ? "(system)" : $_SESSION['Username'];
506 511
	if (!empty($_SERVER['REMOTE_ADDR']))
507 512
		$username .= '@' . $_SERVER['REMOTE_ADDR'];
508 513

  
514
	session_commit();
515

  
509 516
	if($backup)
510 517
		backup_config();
511 518

  

Also available in: Unified diff