Bläddra i källkod

AMBARI-264. Nagios Admin Contact should be checked to ensure it is always an email address

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1339702 13f79535-47bb-0310-9956-ffa450edef68
Ramya Sunil 13 år sedan
förälder
incheckning
9544e8be4f
2 ändrade filer med 5 tillägg och 0 borttagningar
  1. 3 0
      CHANGES.txt
  2. 2 0
      hmc/php/frontend/configUtils.php

+ 3 - 0
CHANGES.txt

@@ -2,6 +2,9 @@ Ambari Change log
 
 Release 0.x.x - unreleased
 
+  AMBARI-264. Nagios Admin Contact should be checked to ensure it is always an 
+  email address (Vinod via ramya)
+
   AMBARI-242. Change code layout to ensure unit tests are not part of final
   built rpm. (Hitesh via ramya)
 

+ 2 - 0
hmc/php/frontend/configUtils.php

@@ -214,6 +214,8 @@ function validateConfigs($svcConfigs) {
       } else if ($key == "nagios_contact") {
         if ($val == "") {
           $errors[$key] = array ( "error" => "Empty nagios contact specified");
+        } else if (0 == preg_match("/^(\w+((-\w+)|(\w.\w+))*)\@(\w+((\.|-)\w+)*\.\w+$)/",$val)) {
+          $errors[$key] = array ( "error" => "Not a valid email address");
         }
       } else if ($key == "hadoop_heapsize") {
         $check = basicNumericCheck($val, FALSE);