From 169680eda76e825717bfc15845e22722f9d536a9 Mon Sep 17 00:00:00 2001
From: Dmitriy Simushev <simushevds@ossg.ru>
Date: Wed, 18 Jan 2012 10:11:49 +0000
Subject: [PATCH] Fixed the bug related with the need to enter passwords when
 you change the profile of any operator.

---
 src/messenger/webim/libs/operator.php     | 6 ------
 src/messenger/webim/operator/operator.php | 2 +-
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/messenger/webim/libs/operator.php b/src/messenger/webim/libs/operator.php
index b954ef19..6fb5fd7c 100755
--- a/src/messenger/webim/libs/operator.php
+++ b/src/messenger/webim/libs/operator.php
@@ -121,12 +121,6 @@ function update_operator($operatorid, $login, $email, $password, $localename, $c
 
 	perform_query($query, $link);
 	close_connection($link);
-	// update the session password
-	if (isset($password))
-	{
-		$_SESSION[$mysqlprefix.'operator']['vcpassword']=md5($password);
-	}
-
 }
 
 function update_operator_avatar($operatorid, $avatar)
diff --git a/src/messenger/webim/operator/operator.php b/src/messenger/webim/operator/operator.php
index b1d61ec5..8dd6d259 100644
--- a/src/messenger/webim/operator/operator.php
+++ b/src/messenger/webim/operator/operator.php
@@ -78,7 +78,7 @@ if (isset($_POST['login']) && isset($_POST['password'])) {
 		} else {
 			update_operator($opId, $login, $email, $password, $localname, $commonname);
 			// update the session password
-			if (isset($password) && $opId == $operator['operatorid']) {
+			if (!empty($password) && $opId == $operator['operatorid']) {
 				$toDashboard = $operator['vcpassword'] == md5('') && $password != '';
 				$_SESSION["${mysqlprefix}operator"]['vcpassword'] = md5($password);
 				if($toDashboard) {