bug fix on module category listings and new email_validate function

This commit is contained in:
Nuno Miguel Reis
2013-07-29 17:22:43 +00:00
parent 834a8624c7
commit 8c932ebae3

View File

@@ -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 <!-- ".$row['module_cat']." -->\n";
if ($prev_module_cat != $row['module_category']) {
$xml .= "\n <!-- ".$row['module_category']." -->\n";
}
if ($row['module_enabled'] == "true"){
$xml .= " <load module=\"".$row['module_name']."\"/>\n";
}
$prev_module_cat = $row['module_cat'];
$prev_module_cat = $row['module_category'];
}
$xml .= "\n";
$xml .= " </modules>\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')) {
}
}
?>
?>