@SpeedyB
You are totaly right with that, but the mail_user table only has the sysuser_id field, no client field, so there is no other way for the moment (except the second solution with the 0 I posted, so everything gets created by admin).
I would have to change a little bit in the remoting_lib.inc.php from ISPConfig 3. ATM you have to send the client_id, he is looking up if that client exists and then he looks for the appropriate sysuser and is using the fields of it (sys_username, sys_userid, sys_default_group, sys_groups).
It would be better if he is just looks up if the sysuser exists and is then using the fields, so that we skip the client lookup.
The modified loadUserProfile function in the /interface/lib/classes/remoting_lib.inc.php would be this.
PHP Code:
function loadUserProfile($client_id = 0) {
global $app,$conf;
$client_id = intval($client_id);
if($client_id == 0) {
$this->sys_username = 'admin';
$this->sys_userid = 1;
$this->sys_default_group = 1;
$this->sys_groups = 1;
} else {
//* load system user
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE sysuser_id = $client_id");
if(empty($user["userid"])) {
$this->errorMessage .= 'No sysuser with the ID $client_id found.';
return false;
}
$this->sys_username = $user['username'];
$this->sys_userid = $user['userid'];
$this->sys_default_group = $user['default_group'];
$this->sys_groups = $user['groups'];
}
return true;
}
I don't know how much it would effect the other scripts which are using the remote framework, but I know that pretty much only the sysuser_id and not the client_id is in the tables.
So probably it helps the others too.
UPDATE: I updated the remote_lib.inc.php file in the ISPConfig 3 svn, so with the new version it will be fine^^
Recent comments
7 hours 24 min ago
16 hours 52 min ago
17 hours 42 min ago
21 hours 15 min ago
1 day 1 hour ago
1 day 2 hours ago
1 day 4 hours ago
1 day 14 hours ago
1 day 19 hours ago
1 day 20 hours ago