diff --git a/resources/switch.php b/resources/switch.php index 550cb5de92..4bca43190b 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -1816,13 +1816,13 @@ function save_module_xml() { $prev_module_cat = ''; $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); foreach ($result as $row) { - if ($prev_module_cat != $row['module_cat']) { - $xml .= "\n \n"; + if ($prev_module_cat != $row['module_category']) { + $xml .= "\n \n"; } if ($row['module_enabled'] == "true"){ $xml .= " \n"; } - $prev_module_cat = $row['module_cat']; + $prev_module_cat = $row['module_category']; } $xml .= "\n"; $xml .= " \n"; @@ -1958,6 +1958,19 @@ function outbound_route_to_bridge ($domain_uuid, $destination_number) { return $bridge_array; unset ($prep_statement); } + +function email_validate($strEmail){ + $validRegExp = '/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]{2,3}$/'; + // search email text for regular exp matches + preg_match($validRegExp, $strEmail, $matches, PREG_OFFSET_CAPTURE); + + if (count($matches) == 0) { + return 0; + } + else { + return 1; + } +} //$destination_number = '1231234'; //$bridge_array = outbound_route_to_bridge ($domain_uuid, $destination_number); //foreach ($bridge_array as &$bridge) { @@ -3648,4 +3661,4 @@ if (!function_exists('save_switch_xml')) { } } -?> \ No newline at end of file +?>