* Fixed a couple bugs when handling alert recipients.

* Fixed a bug where deleting records from numerous tables didn't use the active time stamp.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 5 years ago
parent 9e16cdf504
commit 754435685e
  1. 62
      Anvil/Tools/Database.pm
  2. 2
      cgi-bin/striker
  3. 4
      html/skins/alteeve/email.html
  4. 2
      share/words.xml

@ -2253,7 +2253,15 @@ AND
if ($old_bridge_id ne "DELETED") if ($old_bridge_id ne "DELETED")
{ {
my $query = "UPDATE bridges SET bridge_id = 'DELETED' WHERE bridge_uuid = ".$anvil->Database->quote($bridge_uuid).";"; my $query = "
UPDATE
bridges
SET
bridge_id = 'DELETED',
modified_date = ".$anvil->Database->quote($anvil->data->{sys}{database}{timestamp})."
WHERE
bridge_uuid = ".$anvil->Database->quote($bridge_uuid)."
;";
$anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__}); $anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__});
} }
return($bridge_uuid); return($bridge_uuid);
@ -2606,7 +2614,15 @@ AND
if ($old_bond_operational ne "DELETED") if ($old_bond_operational ne "DELETED")
{ {
my $query = "UPDATE bonds SET bond_operational = 'DELETED' WHERE bond_uuid = ".$anvil->Database->quote($bond_uuid).";"; my $query = "
UPDATE
bonds
SET
bond_operational = 'DELETED',
modified_date = ".$anvil->Database->quote($anvil->data->{sys}{database}{timestamp})."
WHERE
bond_uuid = ".$anvil->Database->quote($bond_uuid)."
;";
$anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__}); $anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__});
} }
return($bond_uuid); return($bond_uuid);
@ -3828,7 +3844,15 @@ AND
if ($old_ip_address_note ne "DELETED") if ($old_ip_address_note ne "DELETED")
{ {
my $query = "UPDATE ip_addresses SET ip_address_note = 'DELETED' WHERE ip_address_uuid = ".$anvil->Database->quote($ip_address_uuid).";"; my $query = "
UPDATE
ip_addresses
SET
ip_address_note = 'DELETED',
modified_date = ".$anvil->Database->quote($anvil->data->{sys}{database}{timestamp})."
WHERE
ip_address_uuid = ".$anvil->Database->quote($ip_address_uuid)."
;";
$anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__}); $anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__});
} }
return($ip_address_uuid); return($ip_address_uuid);
@ -4644,7 +4668,15 @@ WHERE
if ($old_mail_server_helo_domain ne "DELETED") if ($old_mail_server_helo_domain ne "DELETED")
{ {
my $query = "UPDATE mail_servers SET mail_server_helo_domain = 'DELETED' WHERE mail_server_uuid = ".$anvil->Database->quote($mail_server_uuid).";"; my $query = "
UPDATE
mail_servers
SET
mail_server_helo_domain = 'DELETED',
modified_date = ".$anvil->Database->quote($anvil->data->{sys}{database}{timestamp})."
WHERE
mail_server_uuid = ".$anvil->Database->quote($mail_server_uuid)."
;";
$anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__}); $anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__});
} }
return($mail_server_uuid); return($mail_server_uuid);
@ -5014,7 +5046,15 @@ AND
if ($old_network_interface_operational ne "DELETED") if ($old_network_interface_operational ne "DELETED")
{ {
my $query = "UPDATE network_interfaces SET network_interface_operational = 'DELETED' WHERE network_interface_uuid = ".$anvil->Database->quote($network_interface_uuid).";"; my $query = "
UPDATE
network_interfaces
SET
network_interface_operational = 'DELETED',
modified_date = ".$anvil->Database->quote($anvil->data->{sys}{database}{timestamp})."
WHERE
network_interface_uuid = ".$anvil->Database->quote($network_interface_uuid)."
;";
$anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__}); $anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__});
} }
return($network_interface_uuid); return($network_interface_uuid);
@ -5726,7 +5766,7 @@ sub insert_or_update_recipients
} }
# Make sure the recipient_new_level is 0, 1, 2 or 3 # Make sure the recipient_new_level is 0, 1, 2 or 3
if (($recipient_new_level ne "0") && ($recipient_new_level ne "1") && ($recipient_new_level ne "3") && ($recipient_new_level ne "3")) if (($recipient_new_level ne "0") && ($recipient_new_level ne "1") && ($recipient_new_level ne "2") && ($recipient_new_level ne "3"))
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "error_0108", variables => { recipient_new_level => $recipient_new_level }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "error_0108", variables => { recipient_new_level => $recipient_new_level }});
return(""); return("");
@ -5784,7 +5824,15 @@ WHERE
if ($old_recipient_name ne "DELETED") if ($old_recipient_name ne "DELETED")
{ {
my $query = "UPDATE recipients SET recipient_name = 'DELETED' WHERE recipient_uuid = ".$anvil->Database->quote($recipient_uuid).";"; my $query = "
UPDATE
recipients
SET
recipient_name = 'DELETED',
modified_date = ".$anvil->Database->quote($anvil->data->{sys}{database}{timestamp})."
WHERE
recipient_uuid = ".$anvil->Database->quote($recipient_uuid)."
;";
$anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__}); $anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__});
} }
return($recipient_uuid); return($recipient_uuid);

@ -692,7 +692,6 @@ WHERE
class => $recipient_name_class, class => $recipient_name_class,
extra => "", extra => "",
}}); }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { recipient_name_form => $recipient_name_form }});
# Email # Email
my $recipient_email_class = $anvil->data->{cgi}{recipient_email}{alert} ? "input_alert" : "input_clear"; my $recipient_email_class = $anvil->data->{cgi}{recipient_email}{alert} ? "input_alert" : "input_clear";
@ -706,7 +705,6 @@ WHERE
class => $recipient_email_class, class => $recipient_email_class,
extra => "", extra => "",
}}); }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { recipient_email_form => $recipient_email_form }});
# Language (select) # Language (select)
$anvil->Words->language_list(); $anvil->Words->language_list();

@ -352,7 +352,7 @@
#!string!striker_0191!# #!string!striker_0191!#
</td> </td>
<td class="column_row_value_fixed"> <td class="column_row_value_fixed">
&nbsp; #!variable!say_alert_level!# &nbsp; #!variable!say_recipient_new_level!#
<input type="hidden" name="recipient_new_level" id="recipient_new_level" value="#!variable!recipient_new_level!#"/> <input type="hidden" name="recipient_new_level" id="recipient_new_level" value="#!variable!recipient_new_level!#"/>
</td> </td>
</tr> </tr>
@ -398,7 +398,7 @@
</div> </div>
<input type="hidden" name="email" id="email" value="true" /> <input type="hidden" name="email" id="email" value="true" />
<input type="hidden" name="save" id="save" value="true" /> <input type="hidden" name="save" id="save" value="true" />
<input type="hidden" name="task" id="task" value="email_server" /> <input type="hidden" name="task" id="task" value="email_recipient" />
</form> </form>
</table> </table>
<!-- end recipient-confirm --> <!-- end recipient-confirm -->

@ -1051,7 +1051,7 @@ If you are comfortable that the target has changed for a known reason, you can s
<key name="striker_0188">Clear the form</key> <key name="striker_0188">Clear the form</key>
<key name="striker_0189">Are you sure that you want to delete:</key> <key name="striker_0189">Are you sure that you want to delete:</key>
<key name="striker_0190">Alert Recipient</key> <key name="striker_0190">Alert Recipient</key>
<key name="striker_0191">Alert level for future Anvil! systems</key> <key name="striker_0191">Alert level</key>
<key name="striker_0192">Language</key> <key name="striker_0192">Language</key>
<key name="striker_0193">Units</key> <key name="striker_0193">Units</key>
<key name="striker_0194">Recipient's Name</key> <key name="striker_0194">Recipient's Name</key>

Loading…
Cancel
Save