When I create a resource record using dns_a_add, it create a dns_rr entry with sys_userid and sys_groupid = 0 This doesn't create problem, it's ok. But when using dns_a_update, even trying this after a dns_a_get Code: $dns_record["data"] = $_POST['Domain']['ip']; $dns_record['sys_userid'] = "2"; $dns_record['sys_groupid'] = "2"; Then when I do the dns_a_update I got this error With this SQL tried to execute Code: UPDATE `dns_rr` SET `server_id` = \'1\', `zone` = \'2\', `name` = \'sette\', `type` = \'A\', `data` = \'192.168.1.80\', `ttl` = \'60\', `active` = \'Y\', `stamp` = \'0000-00-00 00:00:00\', `serial` = \'1385072055\', `sys_userid` = , `sys_groupid` = WHERE id = 36 Please note the problem: sys_userid and sys_groupid were not assigned. So there is a blocking SQL error Now this problem blocks me ... how can I fix this ?
Seems as if you did not set the client ID correctly when calling the function. You can not pass any sys_ columns in the params array.
Code: >> Update Please choose the update method. For production systems select 'stable'. The update from svn is only for development systems and may break your current setup. Note: Update all slave server, before you update master server. Select update method (stable,svn) [stable]: There are no updates available for ISPConfig 3.0.5.3 I found in remote.inc.php the function dns_a_update It runs updateQuery and from this it runs updateQueryPrepare. It executes $app->remoting_lib->getSQL I think the problem was here, or near here, at rows 784 of remoting_lib.inc.php... on Code: if($primary_id != 0) { // update client permissions only if client_id > 0 if($this->formDef['auth'] == 'yes' && $this->client_id > 0) { $sql_update .= '`sys_userid` = '.$this->sys_userid.', '; $sql_update .= '`sys_groupid` = '.$this->sys_default_group.', '; } $sql_update = substr($sql_update,0,-2); $sql = "UPDATE ".$escape.$this->formDef['db_table'].$escape." SET ".$sql_update." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id; if($sql_ext_where != '') $sql .= " and ".$sql_ext_where; Please, help me, this problem is REALLY blocking me... this function, update dns A record is the core of what I'm developing ..
This is my quick and dirty patch Code: $sql_update .= '`sys_userid` = '. (0 + $this->sys_userid) .', '; $sql_update .= '`sys_groupid` = '. (0 + $this->sys_default_group) .', '; This was ugly code, but actually works... How to open an official bug report ?
sorry, can you explain me again what can be the problem ? What's my error? In calling dns_a_update or dns_a_add ? I tried without passsing any sys_* params, and the problem happens again. I tried to pass these params to workaround the "bug", if it's a bug.
The function has these parameters: $client->dns_a_update($session_id, $client_id, $id, $dns_record) The owner of the record is defined by the parameter $client_id. The api looks up the userid and groupid of the client and then sets the sys_* params for this record to match the correct values for the client. So yor problem is not a bug, you just pass a wrong client_id to the function or the client record is incomplete, so that the client has no userid and groupid assigned.
I think the client it's ok it's the only client I've create directly by ispconfig, not via API. When using dns_a_add, I cannot send this params, so i'ts not my error. Or not ? Please help me to understand what's the error
This is the code I use to add the record Code: public function dns_a_add($domain, $ip) { $client = $this->getSoapClient(); $session_id = $client->login($this->username,$this->password); $client_id = 1; $params = array( 'server_id' => 1, 'zone' => 2, 'name' => $domain, 'type' => 'a', 'data' => $ip, 'aux' => '0', 'ttl' => '60', 'active' => 'y', 'stamp' => 'CURRENT_TIMESTAMP', 'serial' => time(), ); $id = $client->dns_a_add($session_id, $client_id, $params); $client->logout($session_id); return $id; } Using this, the dns_rr record is created with sys_* = 0
And this is the code for updating Code: public function dns_a_update($dns_rr_id, $new_ip) { $client = $this->getSoapClient(); $session_id = $client->login($this->username,$this->password); $dns_record = $client->dns_a_get($session_id, $dns_rr_id); $dns_record["data"] = $new_ip; $client_id = 1; $affected_rows = $client->dns_a_update($session_id, $client_id, $dns_rr_id, $dns_record); $client->logout($session_id); }
you must mass $client_id in the soap function and do not put sys_* parameters in the parameters array. the remoting api will look-up the correct sys_* id to put in the sql table. check that your $client_id is set properly when calling the update.
sorry, can you read accurately my previous posts? I've posted all data, client_id, client "snapshot", update and add code, etc... So, I think client_id is right (i've ONLY ONE) and client record is ok (I've created with ispconfig itself, not via API). What's wrong ???? Code: public function dns_a_update($dns_rr_id, $new_ip) { $client = $this->getSoapClient(); $session_id = $client->login($this->username,$this->password); $dns_record = $client->dns_a_get($session_id, $dns_rr_id); $dns_record["data"] = $new_ip; $client_id = 1; $affected_rows = $client->dns_a_update($session_id, $client_id, $dns_rr_id, $dns_record); $client->logout($session_id); }
have you read the thread?!?! I've posted a screenshot of client1 record, taken from PhpMyAdmin ! Is client1 is here and it's okay. And this is a 100% fully replicable bug on a clean installation! What's the problem? Admitting is a bug ? It's only the nth bug ! It's not the only...
The problem is that you are impolite, he just asked you a simple question because the function is working fine for others, so no need for such a reaction. I've added a bugreport in the bugtracker now so we will review the function again.
Please post the output of the following sql query when you execute it in phpmyadmin: SELECT * FROM sys_user WHERE client_id = 1;
Ok, this explains your problem. So there is no bug in the api (even if we should add a error handler there), the problem is that the client record of client1 is incomplete. A client consists of 3 records in 3 tables: - the base record in the client table - the login user record for the login of the client in the sys_user table - the group of the client in the group table at least the record in the group table is missing. There are no known problems in ispconfig 3.0.5.3 with creating clients. Did you use a different version, e.g. from svn or did you modfy any code in ispconfig? Hvae you tried to login as this client in ispconfig with the username and password of the client? This should fail as well on your server.
,I installed IspConfig as in this guide, because it's exactly my situation, an ubuntu 13.04 server: http://www.howtoforge.com/perfect-server-ubuntu-13.04-apache2-bind-dovecot-ispconfig-3-p6 Code: cd /tmp wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz tar xfz ISPConfig-3-stable.tar.gz cd ispconfig3_install/install/ php -q install.php It has created NO client. And only one sys_user (admin) I created a client from ispconfig, but NO new sys_user.
Now i've tried to create a new sys_user from CP user of isp config, it has been added to group 'realtebo' (the only client i've created as I said before), and of kyind 'user', not admin. Login works, but clientid is still '0' (zero). In the form there is no way to setup the clientid... or have I misunderstood some steps ?