From 6998a2ee109495085c914c134b6d9c77a0686e73 Mon Sep 17 00:00:00 2001 From: stan Date: Sun, 15 Feb 2004 19:44:31 +0000 Subject: [PATCH] Merged in monitor name restriction feature. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@852 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm_html_view_monitor.php | 11 +++++++++++ web/zm_lang_en_gb.php | 1 + 2 files changed, 12 insertions(+) diff --git a/web/zm_html_view_monitor.php b/web/zm_html_view_monitor.php index 32d6352dc..adbd537c7 100644 --- a/web/zm_html_view_monitor.php +++ b/web/zm_html_view_monitor.php @@ -109,6 +109,17 @@ opener.location.reload(true); window.focus(); function validateForm(Form) { + var errors = new Array(); + + if ( Form.elements['new_monitor[Name]'].value.search( /[^\w-]/ ) >= 0 ) + { + errors[errors.length] = ""; + } + if ( errors.length ) + { + alert( errors.join( "\n" ) ); + return( false ); + } return( true ); } diff --git a/web/zm_lang_en_gb.php b/web/zm_lang_en_gb.php index 923fadb74..92c2e38f4 100644 --- a/web/zm_lang_en_gb.php +++ b/web/zm_lang_en_gb.php @@ -107,6 +107,7 @@ $zmSlangAutoEmailEvents = 'Automatically email details of all matching even $zmSlangAutoMessageEvents = 'Automatically message details of all matching events'; $zmSlangAutoUploadEvents = 'Automatically upload all matching events'; $zmSlangAvgBrScore = 'Avg.
Score'; +$zmSlangBadMonitorChars = 'Monitor Names may only contain alphanumeric characters plus hyphen and underscore'; $zmSlangBandwidth = 'Bandwidth'; $zmSlangBlobPx = 'Blob Px'; $zmSlangBlobs = 'Blobs';