Skip to content

Commit

Permalink
TTN poweradmin#453 - If further owner is added to a zone, then keep a…
Browse files Browse the repository at this point in the history
…lso zone_template_id
  • Loading branch information
Edmondas Girkantas committed Aug 8, 2011
1 parent 3021c4e commit 25b471d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inc/record.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,12 @@ function add_owner_to_zone($zone_id, $user_id)
{
if($db->queryOne("SELECT COUNT(id) FROM zones WHERE owner=".$db->quote($user_id, 'integer')." AND domain_id=".$db->quote($zone_id, 'integer')) == 0)
{
$db->query("INSERT INTO zones (domain_id, owner) VALUES(".$db->quote($zone_id, 'integer').", ".$db->quote($user_id, 'integer').")");
$zone_templ_id = get_zone_template($zone_id);
$db->query("INSERT INTO zones (domain_id, owner, zone_templ_id) VALUES("
. $db->quote($zone_id, 'integer') . ", "
. $db->quote($user_id, 'integer') . ", "
. $db->quote($zone_templ_id, 'integer') . ")"
);
}
return true;
} else {
Expand Down

0 comments on commit 25b471d

Please sign in to comment.