sentora / sentora-core

Sentora is a web hosting control panel written in PHP for *NIX
GNU General Public License v3.0
648 stars 446 forks source link

DNS Webservice Delete record not working. #223

Closed xabixab closed 1 year ago

xabixab commented 8 years ago

Deleting DNS records via xmws is not working in sentora.

<br />
<b>Notice</b>:  Undefined offset: 1 in <b>/etc/sentora/panel/dryden/ws/generic.class.php</b> on line <b>91</b><br />
<br />
<b>Notice</b>:  Undefined offset: 1 in <b>/etc/sentora/panel/dryden/ws/generic.class.php</b> on line <b>91</b><br />
<br />
<b>Fatal error</b>:  Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'vh_deleted_ts' in 'where clause'' in /etc/sentora/panel/modules/dns_manager/code/webservice.ext.php:138
Stack trace:
#0 /etc/sentora/panel/modules/dns_manager/code/webservice.ext.php(138): PDOStatement-&gt;execute()
#1 [internal function]: webservice-&gt;DeleteDNSRecords()
#2 /etc/sentora/panel/bin/api.php(40): call_user_func(Array)
#3 {main}
  thrown in <b>/etc/sentora/panel/modules/dns_manager/code/webservice.ext.php</b> on line <b>138</b><br />

To fix that problem I change the line 120 of /modules/dns_manager/code/webservice.ext.php from

$sqlstr = "SELECT * FROM x_dns WHERE dn_acc_fk=:userid AND vh_deleted_ts IS NULL AND dn_vhost_fk=:domainID ";

to

$sqlstr = "SELECT * FROM x_dns WHERE dn_acc_fk=:userid AND dn_deleted_ts IS NULL AND dn_vhost_fk=:domainID ";

After that change, its posible to delete DNS records vía xmws.

I know that this can be done with a pull request or something like that but i do not know how to do.

Sorry my english level is very low.

TGates71 commented 1 year ago

Xmws replaced with Senitor. https://github.com/allebb/senitor