diff --git a/core/notifications/notification_edit.php b/core/notifications/notification_edit.php index a839242d46..7000d577d6 100644 --- a/core/notifications/notification_edit.php +++ b/core/notifications/notification_edit.php @@ -122,16 +122,16 @@ else { $url .= "&os_info_1=".urlencode($os_info_1); $url .= "&os_info_2=".urlencode($os_info_2); - if (function_exists('curl_version')) { + if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) { + $response = file_get_contents($url); + } + else if (function_exists('curl_version')) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); } - else if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) { - $response = file_get_contents($url); - } // parse response $response = json_decode($response, true); @@ -174,16 +174,16 @@ else { if ($current_project_notifications == 'true') { // remove remote server record $url = "https://".$software_url."/app/notifications/notifications_manage.php?id=".$software_uuid."&action=delete"; - if (function_exists('curl_version')) { + if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) { + $response = file_get_contents($url); + } + else if (function_exists('curl_version')) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); } - else if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) { - $response = file_get_contents($url); - } // parse response $response = json_decode($response, true); @@ -208,6 +208,7 @@ else { ($project_notification_method == 'email' && $project_notification_recipient == '') ) { $_SESSION["postback"] = $_POST; + $_SESSION["message_mood"] = 'negative'; $_SESSION["message"] = $text['message-invalid_recipient']; header("Location: notification_edit.php"); exit; @@ -233,16 +234,16 @@ else { $url .= "&os_info_1=".urlencode($os_info_1); $url .= "&os_info_2=".urlencode($os_info_2); - if (function_exists('curl_version')) { + if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) { + $response = file_get_contents($url); + } + else if (function_exists('curl_version')) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); } - else if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) { - $response = file_get_contents($url); - } // parse response $response = json_decode($response, true); @@ -260,8 +261,8 @@ else { $project_events == 'false' && $project_news == 'false' ) { - $_SESSION["message"] = $_SESSION["message"]." - ".$text['message-no_channels']; $_SESSION["message_mood"] = 'alert'; + $_SESSION["message"] = $_SESSION["message"]." - ".$text['message-no_channels']; } // redirect header("Location: notification_edit.php"); @@ -291,16 +292,16 @@ else { // get current project notification preferences $url = "https://".$software_url."/app/notifications/notifications_manage.php?id=".$software_uuid; - if (function_exists('curl_version')) { + if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) { + $response = file_get_contents($url); + } + else if (function_exists('curl_version')) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); } - else if (file_get_contents(__FILE__) && ini_get('allow_url_fopen')) { - $response = file_get_contents($url); - } // parse response $setting = json_decode($response, true); @@ -405,32 +406,35 @@ $document['title'] = $text['title-notifications']; echo " \n"; echo " \n"; + echo " \n"; + /* + echo " \n"; + echo " \n"; + echo $text['label-project_notification_method']."\n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo $text['description-project_notification_method']."\n"; + echo " \n"; + echo " \n"; + */ + + echo " \n"; + echo " \n"; + echo $text['label-project_notification_recipient']."\n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo $text['description-project_notification_recipient']."\n"; + echo " \n"; + echo " \n"; + echo "\n"; echo "\n"; echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; echo "
\n"; - echo $text['label-project_notification_method']."\n"; - echo " \n"; - echo "
\n"; - echo $text['description-project_notification_method']."\n"; - echo "
\n"; - echo $text['label-project_notification_recipient']."\n"; - echo " \n"; - echo "
\n"; - echo $text['description-project_notification_recipient']."\n"; - echo "
\n"; echo " ".$text['message-disclaimer']."\n";