diff --git a/app/music_on_hold/app_languages.php b/app/music_on_hold/app_languages.php
index d7f305537a..ee941e34e8 100644
--- a/app/music_on_hold/app_languages.php
+++ b/app/music_on_hold/app_languages.php
@@ -781,25 +781,25 @@ $text['header-music_on_hold_settings']['ru-ru'] = "Музыка на удерж
$text['header-music_on_hold_settings']['sv-se'] = "Väntmusik inställningar";
$text['header-music_on_hold_settings']['uk-ua'] = "Музика на утриманні настройки";
-$text['desc-music_on_hold']['en-us'] = "Music on hold can be in WAV or MP3 format. To play an MP3 file you must have mod_shout enabled on the 'Modules' tab. You can adjust the volume of the MP3 audio from the 'Settings' tab. For best performance upload 16 bit, 8/16/32/48 kHz mono WAV files.";
-$text['desc-music_on_hold']['ar-eg'] = "";
-$text['desc-music_on_hold']['de-at'] = "Haltemusik können Dateien im WAV oder MP3 Format sein. Um MP3 Dateien abzuspielen zu können, muss mod_shout installiert und aktiviert sein. Sie können die Lautstärke der MP3 Dateien in den Einstellungen verändern. Für beste Funktionalität laden Sie 16bit, 8/16/32/48 kHz mono WAV Dateien hoch."; //copied from de-de
-$text['desc-music_on_hold']['de-ch'] = "Haltemusik können Dateien im WAV oder MP3 Format sein. Um MP3 Dateien abzuspielen zu können, muss mod_shout installiert und aktiviert sein. Sie können die Lautstärke der MP3 Dateien in den Einstellungen verändern. Für beste Funktionalität laden Sie 16bit, 8/16/32/48 kHz mono WAV Dateien hoch."; //copied from de-de
-$text['desc-music_on_hold']['de-de'] = "Haltemusik können Dateien im WAV oder MP3 Format sein. Um MP3 Dateien abzuspielen zu können, muss mod_shout installiert und aktiviert sein. Sie können die Lautstärke der MP3 Dateien in den Einstellungen verändern. Für beste Funktionalität laden Sie 16bit, 8/16/32/48 kHz mono WAV Dateien hoch.";
-$text['desc-music_on_hold']['es-cl'] = "La música en espera puede estar en formato WAV o MP3. Para reproducir un archivo en frmato MP3 debe tener activado el módulo mod_shout. Puede ajustar el volumen del MP3 desde la pestaña 'Configuraciones'. Para el mejor rendimiento se recomienda utilizar archivos en formato WAV 16 bit, 8/16/32/48 kHz mono.";
-$text['desc-music_on_hold']['es-mx'] = "La música en espera puede estar en formato WAV o MP3. Para reproducir un archivo en frmato MP3 debe tener activado el módulo mod_shout. Puede ajustar el volumen del MP3 desde la pestaña 'Configuraciones'. Para el mejor rendimiento se recomienda utilizar archivos en formato WAV 16 bit, 8/16/32/48 kHz mono."; //copied from es-cl
-$text['desc-music_on_hold']['fr-ca'] = "La Musique d'attente peut être en WAV ou en MP3. Pour le MP3, mod_shout doit être activé dans la section modules. Le volume peut être réglé dans la partie configuration. Pour de meilleures performances, utiliser des fichiers WAV 16 bit, 8/16/32/48 kHz mono."; //copied from fr-fr
-$text['desc-music_on_hold']['fr-fr'] = "La Musique d'attente peut être en WAV ou en MP3. Pour le MP3, mod_shout doit être activé dans la section modules. Le volume peut être réglé dans la partie configuration. Pour de meilleures performances, utiliser des fichiers WAV 16 bit, 8/16/32/48 kHz mono.";
-$text['desc-music_on_hold']['he-il'] = "";
-$text['desc-music_on_hold']['it-it'] = "La musica di attesa può essere in formato WAV o MP3. Per suonare i file MP3 è necessario avere mod_shout abilitato nella sezione 'Moduli'. Si può regolare il volume dei file MP3 dalla sezione Parametri. Per una migliore qualità caricare file 16 bit, 8/16/32/48 kHz mono WAV files.";
-$text['desc-music_on_hold']['nl-nl'] = "Wachtmuziek mag in WAV of MP3 formaat zijn. Om een MP3 bestand te spelen moet mod_shout aan staan bij de Modulen tab. Het volume van de MP3 audio kan op de instellingen tab ingevoerd worden. Voor de beste prestaties gebruik 16 bit, 8/16/32/48 kHz mono WAV files.";
-$text['desc-music_on_hold']['pl-pl'] = "Muzyka na czekanie może być w formacie wav lub mp3. Aby odtwarzać mp3 konieczne jest zainstalowanie modułu mod_shout (można to zrobić w zakładce Moduły). Można także zmienić głośność formatu mp3 w zakładce Ustawienia. W celu osiągniecia najlepszej jakości prześlij pliki w formacie wav o następującej specyfikacji: 16 bit, 8/16/32/48 kHz mono.";
-$text['desc-music_on_hold']['pt-br'] = "Música em espera pode ser com base em arquivos com o formato WAV ou MP3. Para ouvir um ficheiro MP3 deverá ter o mod_shout activado na tab 'Módulos'. Pode ajustar o volume do áudio MP3 a partir da tab 'Definições'. Para um melhor desempenho carregue ficheiros WAV de 16 bit, 8/16/32/48 kHz mono.";
-$text['desc-music_on_hold']['pt-pt'] = "Música em espera pode ser com base em ficheiros com o formato WAV ou MP3. Para ouvir um ficheiro MP3 deverá ter o mod_shout activado na tab 'Módulos'. Pode ajustar o volume do áudio MP3 a partir da tab 'Definições'. Para um melhor desempenho carregue ficheiros WAV de 16 bit, 8/16/32/48 kHz mono.";
-$text['desc-music_on_hold']['ro-ro'] = "";
-$text['desc-music_on_hold']['ru-ru'] = "Музыка на удержании может быть в формате WAV или MP3. Чтобы воспроизвести файл MP3, на вкладке «Модули» необходимо включить mod_shout. Вы можете отрегулировать громкость звука MP3 на вкладке «Настройки». Для лучшей производительности загружайте 16-битные, 8/16/32/48 кГц моно i> файлы WAV.";
-$text['desc-music_on_hold']['sv-se'] = "Väntmusik kan vara i formaten WAV eller MP3. För att spela upp en MP3 fil så måste 'mod_shout' vara aktiverat i 'moduler' fliken. Du kan justera volymen på MP3 filerna genom inställnings fliken. För bästa prestanda, ladda upp 16 bit, 8/16/32/48 kHz mono WAV filer.";
-$text['desc-music_on_hold']['uk-ua'] = "Музика на утриманні може бути в WAV або MP3 формат. Для відтворення файлів MP3 ви повинні включити mod_shout на вкладці 'модулі'. Ви можете налаштувати гучність MP3-аудіо на вкладці «Налаштування». Для кращої продуктивності завантаження 16 біт, моно 8/16/32/48 кГц WAV файлів.";
+$text['title_description-music_on_hold']['en-us'] = "Music on hold can be in WAV or MP3 format. To play an MP3 file you must have mod_shout enabled on the 'Modules' tab. You can adjust the volume of the MP3 audio from the 'Settings' tab. For best performance upload 16 bit, 8/16/32/48 kHz mono WAV files.";
+$text['title_description-music_on_hold']['ar-eg'] = "";
+$text['title_description-music_on_hold']['de-at'] = "Haltemusik können Dateien im WAV oder MP3 Format sein. Um MP3 Dateien abzuspielen zu können, muss mod_shout installiert und aktiviert sein. Sie können die Lautstärke der MP3 Dateien in den Einstellungen verändern. Für beste Funktionalität laden Sie 16bit, 8/16/32/48 kHz mono WAV Dateien hoch."; //copied from de-de
+$text['title_description-music_on_hold']['de-ch'] = "Haltemusik können Dateien im WAV oder MP3 Format sein. Um MP3 Dateien abzuspielen zu können, muss mod_shout installiert und aktiviert sein. Sie können die Lautstärke der MP3 Dateien in den Einstellungen verändern. Für beste Funktionalität laden Sie 16bit, 8/16/32/48 kHz mono WAV Dateien hoch."; //copied from de-de
+$text['title_description-music_on_hold']['de-de'] = "Haltemusik können Dateien im WAV oder MP3 Format sein. Um MP3 Dateien abzuspielen zu können, muss mod_shout installiert und aktiviert sein. Sie können die Lautstärke der MP3 Dateien in den Einstellungen verändern. Für beste Funktionalität laden Sie 16bit, 8/16/32/48 kHz mono WAV Dateien hoch.";
+$text['title_description-music_on_hold']['es-cl'] = "La música en espera puede estar en formato WAV o MP3. Para reproducir un archivo en frmato MP3 debe tener activado el módulo mod_shout. Puede ajustar el volumen del MP3 desde la pestaña 'Configuraciones'. Para el mejor rendimiento se recomienda utilizar archivos en formato WAV 16 bit, 8/16/32/48 kHz mono.";
+$text['title_description-music_on_hold']['es-mx'] = "La música en espera puede estar en formato WAV o MP3. Para reproducir un archivo en frmato MP3 debe tener activado el módulo mod_shout. Puede ajustar el volumen del MP3 desde la pestaña 'Configuraciones'. Para el mejor rendimiento se recomienda utilizar archivos en formato WAV 16 bit, 8/16/32/48 kHz mono."; //copied from es-cl
+$text['title_description-music_on_hold']['fr-ca'] = "La Musique d'attente peut être en WAV ou en MP3. Pour le MP3, mod_shout doit être activé dans la section modules. Le volume peut être réglé dans la partie configuration. Pour de meilleures performances, utiliser des fichiers WAV 16 bit, 8/16/32/48 kHz mono."; //copied from fr-fr
+$text['title_description-music_on_hold']['fr-fr'] = "La Musique d'attente peut être en WAV ou en MP3. Pour le MP3, mod_shout doit être activé dans la section modules. Le volume peut être réglé dans la partie configuration. Pour de meilleures performances, utiliser des fichiers WAV 16 bit, 8/16/32/48 kHz mono.";
+$text['title_description-music_on_hold']['he-il'] = "";
+$text['title_description-music_on_hold']['it-it'] = "La musica di attesa può essere in formato WAV o MP3. Per suonare i file MP3 è necessario avere mod_shout abilitato nella sezione 'Moduli'. Si può regolare il volume dei file MP3 dalla sezione Parametri. Per una migliore qualità caricare file 16 bit, 8/16/32/48 kHz mono WAV files.";
+$text['title_description-music_on_hold']['nl-nl'] = "Wachtmuziek mag in WAV of MP3 formaat zijn. Om een MP3 bestand te spelen moet mod_shout aan staan bij de Modulen tab. Het volume van de MP3 audio kan op de instellingen tab ingevoerd worden. Voor de beste prestaties gebruik 16 bit, 8/16/32/48 kHz mono WAV files.";
+$text['title_description-music_on_hold']['pl-pl'] = "Muzyka na czekanie może być w formacie wav lub mp3. Aby odtwarzać mp3 konieczne jest zainstalowanie modułu mod_shout (można to zrobić w zakładce Moduły). Można także zmienić głośność formatu mp3 w zakładce Ustawienia. W celu osiągniecia najlepszej jakości prześlij pliki w formacie wav o następującej specyfikacji: 16 bit, 8/16/32/48 kHz mono.";
+$text['title_description-music_on_hold']['pt-br'] = "Música em espera pode ser com base em arquivos com o formato WAV ou MP3. Para ouvir um ficheiro MP3 deverá ter o mod_shout activado na tab 'Módulos'. Pode ajustar o volume do áudio MP3 a partir da tab 'Definições'. Para um melhor desempenho carregue ficheiros WAV de 16 bit, 8/16/32/48 kHz mono.";
+$text['title_description-music_on_hold']['pt-pt'] = "Música em espera pode ser com base em ficheiros com o formato WAV ou MP3. Para ouvir um ficheiro MP3 deverá ter o mod_shout activado na tab 'Módulos'. Pode ajustar o volume do áudio MP3 a partir da tab 'Definições'. Para um melhor desempenho carregue ficheiros WAV de 16 bit, 8/16/32/48 kHz mono.";
+$text['title_description-music_on_hold']['ro-ro'] = "";
+$text['title_description-music_on_hold']['ru-ru'] = "Музыка на удержании может быть в формате WAV или MP3. Чтобы воспроизвести файл MP3, на вкладке «Модули» необходимо включить mod_shout. Вы можете отрегулировать громкость звука MP3 на вкладке «Настройки». Для лучшей производительности загружайте 16-битные, 8/16/32/48 кГц моно i> файлы WAV.";
+$text['title_description-music_on_hold']['sv-se'] = "Väntmusik kan vara i formaten WAV eller MP3. För att spela upp en MP3 fil så måste 'mod_shout' vara aktiverat i 'moduler' fliken. Du kan justera volymen på MP3 filerna genom inställnings fliken. För bästa prestanda, ladda upp 16 bit, 8/16/32/48 kHz mono WAV filer.";
+$text['title_description-music_on_hold']['uk-ua'] = "Музика на утриманні може бути в WAV або MP3 формат. Для відтворення файлів MP3 ви повинні включити mod_shout на вкладці 'модулі'. Ви можете налаштувати гучність MP3-аудіо на вкладці «Налаштування». Для кращої продуктивності завантаження 16 біт, моно 8/16/32/48 кГц WAV файлів.";
$text['button-upload']['en-us'] = "Upload";
$text['button-upload']['ar-eg'] = "";
diff --git a/app/music_on_hold/music_on_hold.php b/app/music_on_hold/music_on_hold.php
index 8efdcbba9f..64c5da6638 100644
--- a/app/music_on_hold/music_on_hold.php
+++ b/app/music_on_hold/music_on_hold.php
@@ -28,9 +28,9 @@
//includes
include "root.php";
require_once "resources/require.php";
+ require_once "resources/check_auth.php";
//check permissions
- require_once "resources/check_auth.php";
if (permission_exists('music_on_hold_view')) {
//access granted
}
@@ -56,6 +56,27 @@
$database = new database;
$streams = $database->select($sql, $parameters, 'all');
+//get the http post data
+ if (is_array($_POST['moh']) || is_array($_POST['moh_files'])) {
+ $action = $_POST['action'];
+ $moh = $_POST['moh'];
+ }
+
+//process the http post data by action
+ if ($action != '' && is_array($moh) && @sizeof($moh) != 0) {
+ switch ($action) {
+ case 'delete':
+ if (permission_exists('music_on_hold_delete')) {
+ $obj = new switch_music_on_hold;
+ $obj->delete($moh);
+ }
+ break;
+ }
+
+ header('Location: music_on_hold.php');
+ exit;
+ }
+
//download music on hold file
if ($_GET['action'] == "download"
&& is_uuid($_GET['id'])
@@ -88,7 +109,6 @@
$stream_full_path = path_join($stream_path, $stream_file);
//download the file
- session_cache_limiter('public');
if (file_exists($stream_full_path)) {
$fd = fopen($stream_full_path, "rb");
if ($_GET['t'] == "bin") {
@@ -121,6 +141,14 @@
&& is_array($streams)
&& @sizeof($streams) != 0) {
+ //validate the token
+ $token = new token;
+ if (!$token->validate($_SERVER['PHP_SELF'])) {
+ message::add($text['message-invalid_token'],'negative');
+ header('Location: music_on_hold.php');
+ exit;
+ }
+
//determine name
if ($_POST['name_new'] != '') {
//set the action
@@ -192,14 +220,13 @@
}
//define default path
- $stream_path = path_join($_SESSION['switch']['sounds']['dir'], 'music', $_SESSION['domain_name'],$stream_name, $path_rate);
+ $stream_path = path_join($_SESSION['switch']['sounds']['dir'], 'music', $_SESSION['domain_name'], $stream_name, $path_rate);
//find whether the path already exists
$stream_new_name = true;
foreach ($streams as $row) {
$alternate_path = str_replace('$${sounds_dir}', $_SESSION['switch']['sounds']['dir'], $row['music_on_hold_path']);
- if ($stream_path == $row['music_on_hold_path']
- || $stream_path == $alternate_path) {
+ if ($stream_path == $row['music_on_hold_path'] || $stream_path == $alternate_path) {
$stream_new_name = false;
break;
}
@@ -260,6 +287,7 @@
exit;
}
+/*
//delete the music on hold file
if ($_GET['action'] == "delete"
&& is_uuid($_GET['id'])
@@ -314,165 +342,128 @@
header("Location: music_on_hold.php");
exit;
}
+*/
+
+//create token
+ $object = new token;
+ $token = $object->create($_SERVER['PHP_SELF']);
//include the header
- require_once "resources/header.php";
$document['title'] = $text['title-music_on_hold'];
+ require_once "resources/header.php";
+//script
echo "\n";
- echo "\n";
+ echo "";
- echo "".$text['label-music_on_hold']."";
- echo "