Skip to content

Commit 6208314

Browse files
author
moglia
committed
Modified loadUserProfile function i discovered using mailuser interface from horfic after many tests and debugs functions recive a value iguals to userid field not sys_userid.
I keep sysuser_id testing for compatibility issues no have any idea if this used in another place and added aditional userid test. Tested all things and used auto-response with roundcube with this modifications all worked fine. More info see here: http://www.howtoforge.com/forums/showthread.php?t=38437&page=15
1 parent 2b6dc39 commit 6208314

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

interface/lib/classes/remoting_lib.inc.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,14 @@ function loadUserProfile($client_id = 0) {
149149
$this->sys_default_group = 1;
150150
$this->sys_groups = 1;
151151
} else {
152-
//* load system user
152+
//* load system user - try with sysuser and before with userid (workarrond)
153153
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE sysuser_id = $client_id");
154154
if(empty($user["userid"])) {
155-
$this->errorMessage .= 'No sysuser with the ID $client_id found.';
156-
return false;
155+
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $client_id");
156+
if(empty($user["userid"])) {
157+
$this->errorMessage .= "No sysuser with the ID $client_id found.";
158+
return false;
159+
}
157160
}
158161
$this->sys_username = $user['username'];
159162
$this->sys_userid = $user['userid'];
@@ -162,7 +165,7 @@ function loadUserProfile($client_id = 0) {
162165
}
163166

164167
return true;
165-
}
168+
}
166169

167170

168171
/**

0 commit comments

Comments
 (0)