Since Firefox's autocomplete mechanism fires after the window.onload, you cannot do value='' in the JS, instead you should do a setAttribute. Here is a patch that applies the correction.
Code:
diff -u cacti-0.8.7b/host.php cacti-patched/host.php
--- cacti-0.8.7b/host.php 2008-02-11 19:57:48.000000000 -0500
+++ cacti-patched/host.php 2008-09-29 10:24:11.000000000 -0400
@@ -878,6 +878,8 @@
function setSNMP(snmp_type) {
switch(snmp_type) {
case "None":
+ document.getElementById('snmp_username').setAttribute('autocomplete', 'off');
+ document.getElementById('snmp_password').setAttribute('autocomplete', 'off');
document.getElementById('row_snmp_username').style.display = "none";
document.getElementById('row_snmp_password').style.display = "none";
document.getElementById('row_snmp_community').style.display = "none";
@@ -891,6 +893,8 @@
break;
case "v1v2":
+ document.getElementById('snmp_username').setAttribute('autocomplete', 'off');
+ document.getElementById('snmp_password').setAttribute('autocomplete', 'off');
document.getElementById('row_snmp_username').style.display = "none";
document.getElementById('row_snmp_password').style.display = "none";
document.getElementById('row_snmp_community').style.display = "";
Even though I posted the patch code above, due to tab->space conversion in this forum, I suggest using the attached file instead.
The easiest way to apply this patch is to cd to your cacti directory and:
1. THIS IS IMPORTANT. Verify the validity of the URI like this:
Code:
curl -L http://forums.cacti.net/download.php?id=14681
2. If it looks like a safe patch, then apply it directly from that URI via curl:
Code:
curl -L http://forums.cacti.net/download.php?id=14681|patch -p1 -N