diff --git a/app/destinations/app_languages.php b/app/destinations/app_languages.php index df70380356..5f99482d3a 100644 --- a/app/destinations/app_languages.php +++ b/app/destinations/app_languages.php @@ -61,6 +61,26 @@ $text['title-destination-add']['ru-ru'] = "Направление"; $text['title-destination-add']['sv-se'] = "Destination"; $text['title-destination-add']['uk-ua'] = "Номер"; +$text['title-destination_import']['en-us'] = "Destination Import"; +$text['title-destination_import']['ar-eg'] = ""; +$text['title-destination_import']['de-at'] = "Importieren"; //copied from de-de +$text['title-destination_import']['de-ch'] = "Importieren"; //copied from de-de +$text['title-destination_import']['de-de'] = "Importieren"; +$text['title-destination_import']['es-cl'] = "Importar"; +$text['title-destination_import']['es-mx'] = "Importar"; //copied from es-cl +$text['title-destination_import']['fr-ca'] = "Importe"; //copied from fr-fr +$text['title-destination_import']['fr-fr'] = "Importe"; +$text['title-destination_import']['he-il'] = ""; +$text['title-destination_import']['it-it'] = ""; +$text['title-destination_import']['nl-nl'] = "Importeer Bestemmingen"; +$text['title-destination_import']['pl-pl'] = "Importuj"; +$text['title-destination_import']['pt-br'] = "Importar"; //copied from pt-pt +$text['title-destination_import']['pt-pt'] = "Importar"; +$text['title-destination_import']['ro-ro'] = ""; +$text['title-destination_import']['ru-ru'] = "Импорт"; +$text['title-destination_import']['sv-se'] = "Importera"; +$text['title-destination_import']['uk-ua'] = "Імпортувати"; + $text['button-outbound']['en-us'] = "Outbound"; $text['button-outbound']['ar-eg'] = "صادر"; $text['button-outbound']['de-at'] = "Ausgehend"; //copied from de-de @@ -781,7 +801,7 @@ $text['header-destination-add']['ru-ru'] = "Направление"; $text['header-destination-add']['sv-se'] = "Destination"; $text['header-destination-add']['uk-ua'] = "Номер"; -$text['header-destination_import']['en-us'] = "Import Destinations"; +$text['header-destination_import']['en-us'] = "Destination Import"; $text['header-destination_import']['ar-eg'] = ""; $text['header-destination_import']['de-at'] = "Importieren"; //copied from de-de $text['header-destination_import']['de-ch'] = "Importieren"; //copied from de-de diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 87aebe888b..32ddc493bc 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -697,10 +697,10 @@ if ($action == "update") { message::add($text['message-update']); } - header("Location: destination_edit.php?id=".escape($destination_uuid)."&type=".$destination_type); + header("Location: destination_edit.php?id=".urlencode($destination_uuid)."&type=".urlencode($destination_type)); return; - } //(count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) + } //initialize the destinations object $destination = new destinations; @@ -773,7 +773,7 @@ unset($limit); //remove previous fax details - $x=0; + $x = 0; foreach($dialplan_details as $row) { if ($row['dialplan_detail_data'] == "tone_detect_hits=1") { unset($dialplan_details[$x]); @@ -807,14 +807,14 @@ $object = new token; $token = $object->create($_SERVER['PHP_SELF']); -//show the header - require_once "resources/header.php"; +//include the header if ($action == "update") { $document['title'] = $text['title-destination-edit']; } else if ($action == "add") { $document['title'] = $text['title-destination-add']; } + require_once "resources/header.php"; //js controls echo "\n"; //show the content - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + + echo "
\n"; + echo "
"; if ($action == "add") { - echo "
\n"; + echo "".$text['header-destination-add'].""; } if ($action == "update") { - echo "\n"; + echo "".$text['header-destination-edit'].""; } - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
\n"; + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'style'=>'margin-right: 15px;','link'=>'destinations.php?type='.urlencode($destination_type)]); + echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save']]); + echo "
\n"; + echo "
\n"; + echo "\n"; + + echo $text['description-destinations']."\n"; + echo "

\n"; + + echo "
".$text['header-destination-add']."".$text['header-destination-edit'].""; - echo " "; - echo " \n"; - echo "
\n"; - echo $text['description-destinations']."

\n"; - echo "
\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo " \n"; - echo " \n"; - echo " "; + echo "
\n"; + echo "\n"; echo " ".$text['label-destination_type']."\n"; echo "\n"; + echo "\n"; echo "
\n"; - if ($action == "update") { - echo " \n"; - echo " \n"; - echo " \n"; - } - echo " \n"; - echo "
"; - echo " \n"; - echo "
"; echo "

"; + + if ($action == "update") { + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "\n"; + echo "
"; //adjust form if outbound destination @@ -1214,4 +1214,4 @@ //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/app/destinations/destination_imports.php b/app/destinations/destination_imports.php index 3c0c9a3665..f400553a8d 100644 --- a/app/destinations/destination_imports.php +++ b/app/destinations/destination_imports.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2018 - 2019 + Portions created by the Initial Developer are Copyright (C) 2018-2019 the Initial Developer. All Rights Reserved. Contributor(s): @@ -25,7 +25,7 @@ */ //includes - include "root.php"; + require_once "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; @@ -147,8 +147,13 @@ //upload the destination csv if (file_exists($_SESSION['file']) && $action == 'add') { - //form to match the fields to the column names - //require_once "resources/header.php"; + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: destination_imports.php'); + exit; + } //user selected fields $fields = $_POST['fields']; @@ -444,68 +449,24 @@ $message = $database->message; } - //send the redirect header - header("Location: destinations.php?type=".$destination_type); - return; } - //show the header - require_once "resources/header.php"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
".$text['header-destinations_import']."\n"; - echo " \n"; - echo "
\n"; - echo " ".$text['message-results']."

\n"; - echo "
\n"; - - //show the results - echo "\n"; - echo "\n"; - echo " \n"; - echo " \n"; - //echo " \n"; - echo " \n"; - echo "\n"; - if ($results) { - foreach($results as $row) { - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "\n"; - } - } - echo "
".$text['label-destination_name']."".$text['label-destination_organization']."".$text['label-destination_email']."".$text['label-destination_url']."
\n"; - echo escape($row['FirstName'])." ".escape($row['LastName']); - echo " \n"; - echo escape($row['Company'])." \n"; - echo " \n"; - echo escape($row['EmailAddress'])." \n"; - echo " \n"; - echo escape($row['Web Page'])." \n"; - echo "
\n"; - - //include the footer - require_once "resources/footer.php"; - - //end the script + //send the redirect header + header("Location: destinations.php?type=".$destination_type); exit; - } + } //upload the destination csv if (file_exists($_SESSION['file']) && $action == 'delete') { - //form to match the fields to the column names - //require_once "resources/header.php"; + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: destination_imports.php'); + exit; + } //user selected fields $fields = $_POST['fields']; @@ -686,34 +647,31 @@ //match the column names to the field names if (strlen($delimiter) > 0 && file_exists($_SESSION['file']) && ($action !== 'add' or $action !== 'delete')) { - //form to match the fields to the column names + //create token + $object = new token; + $token = $object->create($_SERVER['PHP_SELF']); + + //include the header + $document['title'] = $text['title-destination_import']; require_once "resources/header.php"; - echo "
\n"; + //form to match the fields to the column names + echo "\n"; + + echo "
\n"; + echo "
".$text['header-destination_import']."
\n"; + echo "
\n"; + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'style'=>'margin-right: 15px;','link'=>'destination_imports.php']); + echo button::create(['type'=>'submit','label'=>$text['button-import'],'icon'=>$_SESSION['theme']['button_icon_import']]); + echo "
\n"; + echo "
\n"; + echo "
\n"; + + echo $text['description-destination_import']."\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"; - //loop through user columns $x = 0; foreach ($line_fields as $line_field) { @@ -748,10 +706,10 @@ } echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo "
\n"; - echo " ".$text['header-destination_import']."
\n"; - echo "
\n"; - echo " \n"; - echo " \n"; - echo "
\n"; - echo " ".$text['description-destination_import']."\n"; - echo "
".$text['header-destinations_import']."\n"; - //echo " \n"; - //echo "
\n"; + echo "\n"; echo " ".$text['label-destination_type']."\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"; + require_once "resources/footer.php"; //normalize the column names @@ -891,33 +847,36 @@ exit; } +//create token + $object = new token; + $token = $object->create($_SERVER['PHP_SELF']); + //include the header + $document['title'] = $text['title-destination_import']; require_once "resources/header.php"; -//begin the content - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
\n"; - echo " ".$text['header-destination_import']."
\n"; - echo " ".$text['description-destination_import']."\n"; - echo "
\n"; - echo " \n"; - //echo " \n"; - echo "
"; +//show the content + echo "
\n"; - echo "
\n"; + echo "
\n"; + echo "
".$text['header-destination_import']."
\n"; + echo "
\n"; + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'style'=>'margin-right: 15px;','link'=>'destinations.php']); + echo button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>$_SESSION['theme']['button_icon_upload']]); + echo "
\n"; + echo "
\n"; + echo "
\n"; - echo "\n"; - echo " \n"; + echo $text['description-destination_import']."\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-import_data']."\n"; echo "\n"; + echo "\n"; echo " \n"; echo "
\n"; echo $text['description-import_data']."\n"; @@ -983,20 +942,15 @@ echo "
\n"; - echo " \n"; - echo " \n"; - echo "
\n"; - echo " \n"; - echo "
\n"; + echo "\n"; echo "

"; + + echo "\n"; + echo "\n"; + echo "
"; //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file