Переглянути джерело

Remove old outdated features

root 7 роки тому
батько
коміт
e39dca3e8f

+ 0 - 1
hot_desking/README.md

@@ -1 +0,0 @@
-This is considered deprecated in favor of the new hot desking.

+ 0 - 37
hot_desking/app_config.php

@@ -1,37 +0,0 @@
-<?php
-
-	//application details
-		$apps[$x]['name'] = "Hot Desking";
-		$apps[$x]['uuid'] = "f4ae30f0-68ff-46d2-afd3-34caff2887c9";
-		$apps[$x]['category'] = "Switch";;
-		$apps[$x]['subcategory'] = "";
-		$apps[$x]['version'] = "";
-		$apps[$x]['license'] = "Mozilla Public License 1.1";
-		$apps[$x]['url'] = "http://www.fusionpbx.com";
-		$apps[$x]['description']['en-us'] = "Login into hot desking with an ID and your voicemail password to direct your calls to a remote extension. Then make and receive calls as if you were at your extension.";
-		$apps[$x]['description']['es-cl'] = "Ingrese en un escritorio con un ID y la contaseña para direccionar las llamadas a una extensión remota. Hace y recibe llamadas";
-		$apps[$x]['description']['es-mx'] = "Firmarse en un escritorio con un ID y la contaseña para direccionar las llamadas a una extensión remota. Hace y recibe llamadas";
-		$apps[$x]['description']['de-de'] = "";
-		$apps[$x]['description']['de-ch'] = "";
-		$apps[$x]['description']['de-at'] = "";
-		$apps[$x]['description']['fr-fr'] = "S'identifier au bureau avec un ID et un mot de passe pour diriger touts les appels vers autre poste. Passer et recevoir appels."; 
-		$apps[$x]['description']['fr-ca'] = "S'identifier au bureau avec un ID et la mot de passe pour diriger touts les appels vers autre bureau lointain.  Faites et recevoyez appels.";
-		$apps[$x]['description']['fr-ch'] = "";
-		$apps[$x]['description']['pt-pt'] = "Habilitar o escritório remoto recorrendo a um ID e à password do correio de voz para encaminhar as chamadas para uma extensão remota. Em seguida, fazer e receber ligações como se estivesse a utilizar a sua extensão.";
-		$apps[$x]['description']['pt-br'] = "";
-
-	//permission details
-		$apps[$x]['permissions'][0]['name'] = "hot_desk_view";
-		$apps[$x]['permissions'][0]['menu']['uuid'] = "baa57691-37d4-4c7d-b227-f2929202b480";
-		$apps[$x]['permissions'][0]['groups'][] = "superadmin";
-
-		$apps[$x]['permissions'][1]['name'] = "hot_desk_add";
-		$apps[$x]['permissions'][1]['groups'][] = "superadmin";
-
-		$apps[$x]['permissions'][2]['name'] = "hot_desk_edit";
-		$apps[$x]['permissions'][2]['groups'][] = "superadmin";
-
-		$apps[$x]['permissions'][3]['name'] = "hot_desk_delete";
-		$apps[$x]['permissions'][3]['groups'][] = "superadmin";
-
-?>

+ 0 - 246
hot_desking/app_languages.php

@@ -1,246 +0,0 @@
-<?php
-
-$text['title-hot_desking']['en-us'] = "Hot Desking";
-$text['title-hot_desking']['es-cl'] = "Escritorio Remoto";
-$text['title-hot_desking']['pt-pt'] = "Escritório Remoto";
-$text['title-hot_desking']['fr-fr'] = "Itinérance";
-$text['title-hot_desking']['pt-br'] = "Escritório remoto";
-$text['title-hot_desking']['sv-se'] = "Hot Desking ";
-$text['title-hot_desking']['pl'] = "Gorące biurka";
-$text['title-hot_desking']['de-at'] = "Mobiler Arbeitsplatz";
-
-$text['message-update']['en-us'] = "Update Completed";
-$text['message-update']['es-cl'] = "Actualización Completada";
-$text['message-update']['pt-pt'] = "Actualização Efectuada";
-$text['message-update']['fr-fr'] = "Mis à jour";
-$text['message-update']['pt-br'] = "Atualização Efetuada";
-$text['message-update']['sv-se'] = "Uppdatering Klar ";
-$text['message-update']['pl'] = "Zaktualizowano poprawnie";
-$text['message-update']['de-at'] = "Aktualisierung durchgeführt";
-
-$text['message-unique']['en-us'] = "The Unique ID is not unique.  Please provide a numeric ID not already in use by a different extension.";
-$text['message-unique']['es-cl'] = "El ID no es único. Por favor ingrese un ID numérico que no este asignado actualmente a una extensión diferente.";
-$text['message-unique']['pt-pt'] = "O ID único não é único. Por favor indique um ID numérico que ainda não esteja em utilização noutra extensão.";
-$text['message-unique']['fr-fr'] = "Le 'Unique ID' n'est pas unique. Merci d'indiquer un identifiant numérique n'étant pas déjà utilisé par une autre extension.";
-$text['message-unique']['pt-br'] = "O ID informado já esta sendo utilizado, favor informar outro ID.";
-$text['message-unique']['sv-se'] = "Det unika ID:t är inte unikt. Ange ett numeriskt ID som inte redan används av någon annan anknytning. ";
-$text['message-unique']['pl'] = "Ten identyfikator nie jest unikalny. Proszę podać numeryczne ID, które nie  już używane przez inny numer wewnętrzny.";
-$text['message-unique']['de-at'] = "Die Eindeutige ID existiert bereits. Bitte geben Sie eine Numerische ID an, die noch einer anderen Nebenstelle zugewiesen wurde.";
-
-$text['message-required']['en-us'] = "Please provide: ";
-$text['message-required']['es-cl'] = "Por favor ingrese: ";
-$text['message-required']['pt-pt'] = "Por favor indique: ";
-$text['message-required']['fr-fr'] = "Merci d'indiquer: ";
-$text['message-required']['pt-br'] = "Por favor Indique:";
-$text['message-required']['sv-se'] = "Var god uppge: ";
-$text['message-required']['pl'] = "Wpisz:";
-$text['message-required']['de-at'] = "Bitte geben Sie folgendes an:";
-
-$text['message-delete']['en-us'] = "Delete Completed";
-$text['message-delete']['es-cl'] = "Eliminación Completada";
-$text['message-delete']['pt-pt'] = "Remoção Efectuada";
-$text['message-delete']['fr-fr'] = "Supprimé";
-$text['message-delete']['pt-br'] = "Remoção Efetuada";
-$text['message-delete']['sv-se'] = "Borttagning Klar ";
-$text['message-delete']['pl'] = "Usunięto poprawnie";
-$text['message-delete']['de-at'] = "Erfolgreich gelöscht";
-
-$text['message-add']['en-us'] = "Add Completed";
-$text['message-add']['es-cl'] = "Agregar Completado";
-$text['message-add']['pt-pt'] = "Adição Efectuada";
-$text['message-add']['fr-fr'] = "Ajouté";
-$text['message-add']['pt-br'] = "Criação Efetuada";
-$text['message-add']['sv-se'] = "Tillagd ";
-$text['message-add']['pl'] = "Dodano poprawnie";
-$text['message-add']['de-at'] = "Erfolgreich hinzugefügt";
-
-$text['label-voicemail_password']['en-us'] = "Voicemail Password";
-$text['label-voicemail_password']['es-cl'] = "Contraseña de correo de voz";
-$text['label-voicemail_password']['pt-pt'] = "Password do Correio de Voz";
-$text['label-voicemail_password']['fr-fr'] = "Mot de passe de la messagerie";
-$text['label-voicemail_password']['pt-br'] = "Senha do correio de voz";
-$text['label-voicemail_password']['sv-se'] = "Röstbrevlåda Lösenord ";
-$text['label-voicemail_password']['pl'] = "Hasło poczty głosowej";
-$text['label-voicemail_password']['de-at'] = "Mailbox Passwort";
-
-$text['label-unique_id']['en-us'] = "Unique ID";
-$text['label-unique_id']['es-cl'] = "ID Único";
-$text['label-unique_id']['pt-pt'] = "ID Único";
-$text['label-unique_id']['fr-fr'] = "Unique ID";
-$text['label-unique_id']['pt-br'] = "ID Único";
-$text['label-unique_id']['sv-se'] = "Unikt ID ";
-$text['label-unique_id']['pl'] = "Unikalne ID";
-$text['label-unique_id']['de-at'] = "Eindeutige ID";
-
-$text['label-forward_to']['en-us'] = "Forward To";
-$text['label-forward_to']['es-cl'] = "Dirigir A";
-$text['label-forward_to']['pt-pt'] = "Encaminhar Para";
-$text['label-forward_to']['fr-fr'] = "Renvoyé vers";
-$text['label-forward_to']['pt-br'] = "Encaminhar para";
-$text['label-forward_to']['sv-se'] = "Vidarekoppla Till ";
-$text['label-forward_to']['pl'] = "Przekieruj na";
-$text['label-forward_to']['de-at'] = "Weiterleiten An";
-
-$text['label-extension']['en-us'] = "Extension";
-$text['label-extension']['es-cl'] = "Extensión";
-$text['label-extension']['pt-pt'] = "Extensão";
-$text['label-extension']['fr-fr'] = "Extension";
-$text['label-extension']['pt-br'] = "Ramal";
-$text['label-extension']['sv-se'] = "Anknytning ";
-$text['label-extension']['pl'] = "Numer wewnętrzny";
-$text['label-extension']['de-at'] = "Nebenstelle";
-
-$text['label-dial_string']['en-us'] = "Dial String";
-$text['label-dial_string']['es-cl'] = "Cadena de Marcado";
-$text['label-dial_string']['pt-pt'] = "Dial String";
-$text['label-dial_string']['fr-fr'] = "numérotation";
-$text['label-dial_string']['pt-br'] = "Dial String";
-$text['label-dial_string']['sv-se'] = "Ringa Sträng ";
-$text['label-dial_string']['pl'] = "Opcje polecenia DIAL";
-$text['label-dial_string']['de-at'] = "Wahl Zeichenkette";
-
-$text['label-description']['en-us'] = "Description";
-$text['label-description']['es-cl'] = "Descripción";
-$text['label-description']['pt-pt'] = "Descrição";
-$text['label-description']['fr-fr'] = "Description";
-$text['label-description']['pt-br'] = "Descrição";
-$text['label-description']['sv-se'] = "Beskrivning ";
-$text['label-description']['pl'] = "Opis";
-$text['label-description']['de-at'] = "Beschreibung";
-
-$text['header-message']['en-us'] = "Message";
-$text['header-message']['es-cl'] = "Mensaje";
-$text['header-message']['pt-pt'] = "Mensagem";
-$text['header-message']['fr-fr'] = "Message";
-$text['header-message']['pt-br'] = "Mensagem";
-$text['header-message']['sv-se'] = "Meddelande ";
-$text['header-message']['pl'] = "Wiadomość";
-$text['header-message']['de-at'] = "Nachricht";
-
-$text['header-hot_desking']['en-us'] = "Hot Desking";
-$text['header-hot_desking']['es-cl'] = "Escritorio Remoto";
-$text['header-hot_desking']['pt-pt'] = "Escritório Remoto";
-$text['header-hot_desking']['fr-fr'] = "Itinérance";
-$text['header-hot_desking']['pt-br'] = "Escritório remoto";
-$text['header-hot_desking']['sv-se'] = "Hot Desking ";
-$text['header-hot_desking']['pl'] = "Gorące biurka (Hot desking)";
-$text['header-hot_desking']['de-at'] = "Mobiler Arbeitsplatz";
-
-$text['description-voicemail_password']['en-us'] = "Enter the voicemail password here.";
-$text['description-voicemail_password']['es-cl'] = "Ingrese la contraseña del correo de voz aquí.";
-$text['description-voicemail_password']['pt-pt'] = "Introduza a password do correio de voz aqui.";
-$text['description-voicemail_password']['fr-fr'] = "Insérer le Mot de passe de la messagerie ici.";
-$text['description-voicemail_password']['pt-br'] = "Introduza uma senha númerica para o correio de voz aqui";
-$text['description-voicemail_password']['sv-se'] = "Ange det numeriska röstbrevlåde-lösenordet här. ";
-$text['description-voicemail_password']['pl'] = "Dodaj numeryczne hasło poczty głosowej";
-$text['description-voicemail_password']['de-at'] = "Geben Sie das numerische Mailbox Passwort an.";
-
-$text['description-unique_id']['en-us'] = "A unique NUMERIC ID to identify the extension and domain.";
-$text['description-unique_id']['es-cl'] = "Un ID numérico único para identificar la extensión y dominio.";
-$text['description-unique_id']['pt-pt'] = "Um ID único numérico para identificar a extensão e o domínio.";
-$text['description-unique_id']['fr-fr'] = "Un Identifiant numérique Unique afin d'identifier l'extension et le domaine.";
-$text['description-unique_id']['pt-br'] = "Um ID numérico para identificar a extensão do dominio";
-$text['description-unique_id']['sv-se'] = "Ett unikt NUMERISKT ID för att indetifiera anknytning och domän. ";
-$text['description-unique_id']['pl'] = "Unikalne numeryczne ID identyfikujące numer wew oraz domenę.";
-$text['description-unique_id']['de-at'] = "Eine numerische ID zur eindeutigen Identifikation der Nebenstelle und Domain.";
-
-$text['description-password']['en-us'] = "Password";
-$text['description-password']['es-cl'] = "Contraseña";
-$text['description-password']['pt-pt'] = "Password";
-$text['description-password']['fr-fr'] = "Mot de passe";
-$text['description-password']['pt-br'] = "Introduza a senha";
-$text['description-password']['sv-se'] = "Lösenord ";
-$text['description-password']['pl'] = "Hasło";
-$text['description-password']['de-at'] = "Geben Sie das Passwort ein.";
-
-$text['description-hot_desking']['en-us'] = "Log in to hot desking with a unique ID and your voicemail password to direct your calls to a remote extension. Then, make and receive calls as if you were at your extension.";
-$text['description-hot_desking']['es-cl'] = "Ingrese en un escritorio con un ID y la contaseña para direccionar las llamadas a una extensión remota. Hace y recibe llamadas";
-$text['description-hot_desking']['pt-pt'] = "Habilite o escritório remoto recorrendo a um ID único e à sua password do correio de voz para encaminhar as suas chamadas para uma extensão remota. Depois, faça e receba chamadas como se estivesse na sua extensão.";
-$text['description-hot_desking']['fr-fr'] = "Se connecter à l'itinérance avec votre Identifiant et votre mot de passe de messagerie pour rediriger vos appels vers une extensions distante. Alors, passez et recevez des appels comme si vous étiez sur votre extensions. ";
-$text['description-hot_desking']['pt-br'] = "Habilite o escritório remoto recorrendo a um ID único e à sua senha do correio de voz para encaminhar as suas chamadas para uma extensão remota. Depois, faça e receba chamadas como se estivesse na sua extensão. ";
-$text['description-hot_desking']['sv-se'] = "Logg ain på Hot Desking med ett unikt ID och ditt röstbrevlåde lösenord för att vidarebefordra dina samtal till en annan anknytning. Ring och svara sedan som om du var på din egna anknytning.";
-$text['description-hot_desking']['pl'] = "Aby kierować połączenia do zdalnego numeru wewnętrznego zaloguj się do Gorących Biurek z unikalnym ID i hasłem poczty głosowej. Następnie, dzwoń i odbieraj rozmowy, tak jak z własnego telefonu.";
-$text['description-hot_desking']['de-at'] = "Melden Sie sich mit Ihrer Eindeutigen ID und dem Mailbox Passwort beim mobilen Arbeitsplatz an um alle Anrufe an eine andere Nebenstelle umzuleiten. Sie können von dieser Nebenstelle dann telefonieren, als wäre es Ihre eigene.";
-
-$text['description-extension-edit']['en-us'] = "Extension number.";
-$text['description-extension-edit']['es-cl'] = "Número de Extensión.";
-$text['description-extension-edit']['pt-pt'] = "Número da Extensão.";
-$text['description-extension-edit']['fr-fr'] = "Numéro d'extension.";
-$text['description-extension-edit']['pt-br'] = "Edite o número da extensão";
-$text['description-extension-edit']['sv-se'] = "Anknytningsnummer";
-$text['description-extension-edit']['pl'] = "Numer wewnętrzny";
-$text['description-extension-edit']['de-at'] = "Nebenstellen Nummer";
-
-$text['description-extension-add']['en-us'] = "Select the extension number.";
-$text['description-extension-add']['es-cl'] = "Seleccione el número de extensión.";
-$text['description-extension-add']['pt-pt'] = "Escolha o número da extensão.";
-$text['description-extension-add']['fr-fr'] = "Choisir le numéro d'extension.";
-$text['description-extension-add']['pt-br'] = "Adicione o número da extensão";
-$text['description-extension-add']['sv-se'] = "Välj anknytningsnummer";
-$text['description-extension-add']['pl'] = "Wybierz numer wew";
-$text['description-extension-add']['de-at'] = "Wählen Sie die Nebenstellen Nummer.";
-
-$text['description-dial_string']['en-us'] = "Location of the endpoint.";
-$text['description-dial_string']['es-cl'] = "Localización del extremo.";
-$text['description-dial_string']['pt-pt'] = "Localização do terminal.";
-$text['description-dial_string']['fr-fr'] = "Localisation de l'équipement.";
-$text['description-dial_string']['pt-br'] = "Lolicação do ponto final";
-$text['description-dial_string']['sv-se'] = "Plats för enheten.";
-$text['description-dial_string']['pl'] = "Lokalizacja klienta SIP";
-$text['description-dial_string']['de-at'] = "Standort des Endgeräts";
-
-$text['confirm-delete']['en-us'] = "Do you really want to delete this?";
-$text['confirm-delete']['es-cl'] = "¿Realmente desea eliminar esto?";
-$text['confirm-delete']['pt-pt'] = "Deseja realmente remover isto?";
-$text['confirm-delete']['fr-fr'] = "Voulez-vous vraiment supprimer cela?";
-$text['confirm-delete']['pt-br'] = "Deseja realmente remover isto?";
-$text['confirm-delete']['sv-se'] = "Vill du verkligen ta bort detta?";
-$text['confirm-delete']['pl'] = "Czy na pewno chcesz to usunąć?";
-$text['confirm-delete']['de-at'] = "Wollen Sie das wirklich löschen?";
-
-$text['button-save']['en-us'] = "Save";
-$text['button-save']['es-cl'] = "Guardar";
-$text['button-save']['pt-pt'] = "Guardar";
-$text['button-save']['fr-fr'] = "Sauvegarder";
-$text['button-save']['pt-br'] = "Salvar";
-$text['button-save']['sv-se'] = "Spara";
-$text['button-save']['pl'] = "Zachowaj";
-$text['button-save']['de-at'] = "Speichern";
-
-$text['button-edit']['en-us'] = "Edit";
-$text['button-edit']['es-cl'] = "Editar";
-$text['button-edit']['pt-pt'] = "Editar";
-$text['button-edit']['fr-fr'] = "Editer";
-$text['button-edit']['pt-br'] = "Editar";
-$text['button-edit']['sv-se'] = "Editera";
-$text['button-edit']['pl'] = "Edytuj";
-$text['button-edit']['de-at'] = "Bearbeiten";
-
-$text['button-delete']['en-us'] = "Delete";
-$text['button-delete']['es-cl'] = "Eliminar";
-$text['button-delete']['pt-pt'] = "Remover";
-$text['button-delete']['fr-fr'] = "Supprimer";
-$text['button-delete']['pt-br'] = "Remover";
-$text['button-delete']['sv-se'] = "Ta Bort";
-$text['button-delete']['pl'] = "Usuń";
-$text['button-delete']['de-at'] = "Löschen";
-
-$text['button-back']['en-us'] = "Back";
-$text['button-back']['es-cl'] = "Volver";
-$text['button-back']['pt-pt'] = "Voltar";
-$text['button-back']['fr-fr'] = "Retour";
-$text['button-back']['pt-br'] = "Voltar";
-$text['button-back']['sv-se'] = "Tillbaka";
-$text['button-back']['pl'] = "Wróć";
-$text['button-back']['de-at'] = "Zurück";
-
-$text['button-add']['en-us'] = "Add";
-$text['button-add']['es-cl'] = "Agregar";
-$text['button-add']['pt-pt'] = "Adicionar";
-$text['button-add']['fr-fr'] = "Ajouter";
-$text['button-add']['pt-br'] = "Adicionar";
-$text['button-add']['sv-se'] = "Lägg Till";
-$text['button-add']['pl'] = "Dodaj";
-$text['button-add']['de-at'] = "Hinzufügen";
-
-?>

+ 0 - 19
hot_desking/app_menu.php

@@ -1,19 +0,0 @@
-<?php
-
-$apps[$x]['menu'][0]['title']['en-us'] = "Hot Desking";
-$apps[$x]['menu'][0]['title']['es-cl'] = "Escritorio remoto";
-$apps[$x]['menu'][0]['title']['es-mx'] = "Escritorio remoto";
-$apps[$x]['menu'][0]['title']['fr-fr'] = "Itinérance";
-$apps[$x]['menu'][0]['title']['fr-ca'] = "Bureau Lointain";
-$apps[$x]['menu'][0]['title']['pt-pt'] = "Escritório Remoto";
-$apps[$x]['menu'][0]['title']['pt-br'] = "Escritório remoto";
-$apps[$x]['menu'][0]['title']['sv-se'] = "Hot Desking ";
-$apps[$x]['menu'][0]['title']['pl'] = "Gorące biurka";
-$apps[$x]['menu'][0]['title']['de-at'] = "Mobiler Arbeitsplatz";
-$apps[$x]['menu'][0]['uuid'] = "baa57691-37d4-4c7d-b227-f2929202b480";
-$apps[$x]['menu'][0]['parent_uuid'] = "fd29e39c-c936-f5fc-8e2b-611681b266b5";
-$apps[$x]['menu'][0]['category'] = "internal";
-$apps[$x]['menu'][0]['path'] = "/app/hot_desking/index.php";
-$apps[$x]['menu'][0]['groups'][] = "superadmin";
-
-?>

+ 0 - 81
hot_desking/extension_delete.php

@@ -1,81 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2015
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-if (permission_exists('extension_delete')) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//get the id
-	if (count($_GET) > 0) {
-		$id = check_str($_GET["id"]);
-	}
-
-//delete the hot desking information
-	if (strlen($id) > 0) {
-		$sql = "update v_extensions set ";
-		$sql .= "unique_id = null, ";
-		$sql .= "dial_user = null, ";
-		$sql .= "dial_domain = null, ";
-		$sql .= "dial_string = null ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and extension_uuid = '$id' ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		unset($prep_statement, $sql);
-	}
-
-//get the extension
-	$sql = "select extension from v_extensions ";
-	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and extension_uuid = '$id' ";
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	foreach ($result as &$row) {
-		$extension = $row["extension"];
-	}
-	unset ($prep_statement);
-
-//clear the cache
-	$cache = new cache;
-	$cache->delete("directory:".$extension."@".$_SESSION['domain_name']);
-
-//redirect the user
-	$_SESSION["message"] = $text['message-delete'];
-	header("Location: index.php");
-	return;
-
-?>

+ 0 - 327
hot_desking/extension_edit.php

@@ -1,327 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Copyright (C) 2008-2015 All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-	Luis Daniel Lucio Quiroz <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-if (permission_exists('extension_add') || permission_exists('extension_edit')) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//set the action as an add or an update
-	if (isset($_REQUEST["id"])) {
-		$action = "update";
-		$extension_uuid = check_str($_REQUEST["id"]);
-	}
-	else {
-		$action = "add";
-	}
-
-//get the http values and set them as php variables
-	if (count($_POST) > 0) {
-		//get the values from the HTTP POST and save them as PHP variables
-		$extension_uuid = check_str($_POST["extension_uuid"]);
-		$unique_id = check_str($_POST["unique_id"]);
-		$vm_password = check_str($_POST["vm_password"]);
-		$dial_string = check_str($_POST["dial_string"]);
-	}
-
-if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
-
-	//check for all required data
-		if (strlen($extension_uuid) == 0) { $msg .= $text['message-required'].$text['label-extension']."<br>\n"; }
-		if (strlen($unique_id) == 0) { $msg .= $text['message-required'].$text['label-unique_id']."<br>\n"; }
-	//get the number of rows in v_extensions
-		$sql = "select count(*) as num_rows from v_extensions ";
-		$sql .= "where unique_id = '".$unique_id."' and ";
-		$sql .= "extension_uuid <> '".$extension_uuid."'";
-		$prep_statement = $db->prepare(check_sql($sql));
-		if ($prep_statement) {
-			$prep_statement->execute();
-			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-			if ($row['num_rows'] > 0) {
-				$msg .= $text['message-unique']."<br>\n";
-			}
-		}
-		unset($prep_statement, $result);
-		if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
-			require_once "resources/header.php";
-			require_once "resources/persist_form_var.php";
-			echo "<div align='center'>\n";
-			echo "<table><tr><td>\n";
-			echo $msg."<br />";
-			echo "</td></tr></table>\n";
-			persistformvar($_POST);
-			echo "</div>\n";
-			require_once "resources/footer.php";
-			return;
-		}
-
-	//set the default user context
-		if (if_group("superadmin")) {
-			//allow a user assigned to super admin to change the user_context
-		}
-		else {
-			//if the user_context was not set then set the default value
-			if (strlen($user_context) == 0) {
-				if (count($_SESSION["domains"]) > 1) {
-					$user_context = $_SESSION['domain_name'];
-				}
-				else {
-					$user_context = "default";
-				}
-			}
-		}
-
-	//add or update the database
-	if ($_POST["persistformvar"] != "true") {
-
-		//get the extension
-			$sql = "select * from v_extensions ";
-			$sql .= "where domain_uuid = '$domain_uuid' ";
-			$sql .= "and extension_uuid = '$extension_uuid' ";
-			$prep_statement = $db->prepare(check_sql($sql));
-			$prep_statement->execute();
-			$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-			foreach ($result as &$row) {
-				$extension = $row["extension"];
-				$number_alias = $row["number_alias"];
-			}
-			unset ($prep_statement);
-
-		//update the extension and voicemail
-			if (($action == "add" && permission_exists('extension_add')) || ($action == "update" && permission_exists('extension_edit'))) {
-				//update the extension
-					$sql = "update v_extensions set ";
-					$sql .= "unique_id = '$unique_id' ";
-					$sql .= "where domain_uuid = '$domain_uuid' ";
-					$sql .= "and extension_uuid = '$extension_uuid'";
-					$db->exec(check_sql($sql));
-					unset($sql);
-
-				//update the voicemail
-					if (strlen($vm_password) > 0) {
-						$sql = "update v_voicemails set ";
-						$sql .= "voicemail_password = '$vm_password' ";
-						$sql .= "where domain_uuid = '$domain_uuid' ";
-						if (is_numeric($extension)) {
-							$sql .= "and voicemail_id = '$extension'";
-						}
-						else {
-							$sql .= "and voicemail_id = '$number_alias'";
-						}
-						$db->exec(check_sql($sql));
-						unset($sql);
-					}
-			}
-
-		//clear the cache
-			$cache = new cache;
-			$cache->delete("directory:".$extension."@".$_SESSION['domain_name']);
-
-		//set message and redirect user
-			if ($action == "add") {
-				$_SESSION["message"] = $text['message-add'];
-			}
-			if ($action == "update") {
-				$_SESSION["message"] = $text['message-update'];
-			}
-			header("Location: index.php");
-			return;
-
-	} //if ($_POST["persistformvar"] != "true")
-} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
-
-//pre-populate the form
-	if ($_POST["persistformvar"] != "true") {
-		//get the extension data
-			$sql = "select * from v_extensions ";
-			$sql .= "where domain_uuid = '$domain_uuid' ";
-			$sql .= "and extension_uuid = '$extension_uuid' ";
-			$prep_statement = $db->prepare(check_sql($sql));
-			$prep_statement->execute();
-			$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-			foreach ($result as &$row) {
-				$extension = $row["extension"];
-				$dial_string = $row["dial_string"];
-				$unique_id = $row["unique_id"];
-			}
-			unset ($prep_statement);
-
-		//get the voicemail data
-			$sql = "select * from v_voicemails ";
-			$sql .= "where domain_uuid = '$domain_uuid' ";
-			if (is_numeric($extension)) {
-				$sql .= "and voicemail_id = '$extension' ";
-			}
-			else {
-				$sql .= "and voicemail_id = '$number_alias' ";
-			}
-			//$sql .= "and voicemail_enabled = 'true' ";
-			$prep_statement = $db->prepare(check_sql($sql));
-			$prep_statement->execute();
-			$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-			foreach ($result as &$row) {
-				$vm_password = $row["voicemail_password"];
-			}
-			unset ($prep_statement);
-	}
-
-//set the defaults
-	if (strlen($limit_max) == 0) { $limit_max = '5'; }
-
-//begin the page content
-	require_once "resources/header.php";
-
-	echo "<script type=\"text/javascript\" language=\"JavaScript\">\n";
-	echo "\n";
-	echo "function enable_change(enable_over) {\n";
-	echo "	var endis;\n";
-	echo "	endis = !(document.iform.enable.checked || enable_over);\n";
-	echo "	document.iform.range_from.disabled = endis;\n";
-	echo "	document.iform.range_to.disabled = endis;\n";
-	echo "}\n";
-	echo "\n";
-	echo "function show_advanced_config() {\n";
-	echo "	document.getElementById(\"show_advanced_box\").innerHTML='';\n";
-	echo "	aodiv = document.getElementById('show_advanced');\n";
-	echo "	aodiv.style.display = \"block\";\n";
-	echo "}\n";
-	echo "\n";
-	echo "function hide_advanced_config() {\n";
-	echo "	document.getElementById(\"show_advanced_box\").innerHTML='';\n";
-	echo "	aodiv = document.getElementById('show_advanced');\n";
-	echo "	aodiv.style.display = \"none\";\n";
-	echo "}\n";
-	echo "</script>";
-
-	echo "<form method='post' name='frm' action=''>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "	<td width='30%' nowrap='nowrap' align='left' valign='top'>\n";
-	echo "		<b>".$text['header-hot_desking']."</b>\n";
-	echo "	</td>\n";
-	echo "	<td width='70%' align='right' valign='top'>\n";
-	echo "		<input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='index.php'\" value='".$text['button-back']."'>\n";
-	echo "		<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
-	echo "	</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "    ".$text['label-extension']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	if ($action == "add") {
-		echo "<select id=\"extension_uuid\" name=\"extension_uuid\" class='formfld' \">\n";
-		echo "<option value=''></option>\n";
-		$sql = "select extension, extension_uuid, description FROM v_extensions ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "order by extension asc ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-		$result_count = count($result);
-		if ($result_count > 0) {
-			foreach($result as $row) {
-				if ($extension_uuid == $row['extension_uuid']) {
-					echo "<option value=\"".$row['extension_uuid']."\" selected>".$row['extension']." ".$row['description']."</option>\n";
-				}
-				else {
-					echo "<option value=\"".$row['extension_uuid']."\">".$row['extension']." ".$row['description']."</option>\n";
-				}
-			}
-		}
-		unset($sql, $result, $result_count);
-		echo  "</select><br />\n";
-		echo $text['description-extension-add']."\n";
-	}
-	if ($action == "update") {
-		echo "    $extension<br />\n";
-		echo $text['description-extension-edit']."\n";
-	}
-	echo "<br />\n";
-
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "    ".$text['label-unique_id']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='number' name='unique_id' autocomplete='off' maxlength='255' min='0' step='1' required='required' value=\"$unique_id\">\n";
-	echo "<br />\n";
-	echo $text['description-unique_id']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	if ($action == "update") {
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-		echo "    ".$text['label-voicemail_password']."\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "    <input class='formfld' type='password' name='vm_password' id='vm_password' onmouseover=\"this.type='text';\" onfocus=\"this.type='text';\" onmouseout=\"if (!$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" maxlength='255' value='$vm_password'>\n";
-		echo "    <br />\n";
-		echo "    ".$text['description-voicemail_password']."\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-		echo "    ".$text['label-dial_string']."\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "    <input class='formfld' type='text' name='dial_string' maxlength='255' value=\"$dial_string\">\n";
-		echo "<br />\n";
-		echo $text['description-dial_string']."\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "<input type='hidden' name='extension_uuid' maxlength='255' value=\"$extension_uuid\">\n";
-	}
-
-	echo "<tr>\n";
-	echo "<td colspan='2' align='right'>\n";
-	echo "	<br>";
-	echo "	<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "</table>";
-	echo "<br><br>";
-	echo "</form>";
-
-require_once "resources/footer.php";
-?>

+ 0 - 176
hot_desking/index.php

@@ -1,176 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-if (permission_exists('extension_view')) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//includes and title
-	require_once "resources/header.php";
-	$document['title'] = $text['title-hot_desking'];
-	require_once "resources/paging.php";
-
-//get the http values and set them as variables
-	if (isset($_GET["order_by"])) {
-		$order_by = check_str($_GET["order_by"]);
-		$order = check_str($_GET["order"]);
-	}
-
-//show the content
-	echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
-	echo "  <tr>\n";
-	echo "	<td align='left'><b>".$text['header-hot_desking']."</b><br>\n";
-	echo "		".$text['description-hot_desking']."\n";
-	echo "	</td>\n";
-	echo "  </tr>\n";
-	echo "</table>\n";
-	echo "<br />";
-
-	//get the number of rows in v_extensions
-		$sql = "select count(*) as num_rows from v_extensions ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and unique_id is not null ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		if ($prep_statement) {
-			$prep_statement->execute();
-			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-			if ($row['num_rows'] > 0) {
-				$num_rows = $row['num_rows'];
-			}
-			else {
-				$num_rows = '0';
-			}
-		}
-		unset($prep_statement, $result);
-
-	//prepare to page the results
-		$rows_per_page = 150;
-		$param = "";
-		if (!isset($_GET['page'])) { $_GET['page'] = 0; }
-		$_GET['page'] = check_str($_GET['page']);
-		list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
-		$offset = $rows_per_page * $_GET['page'];
-
-	//get the extension list
-		$sql = "select * from v_extensions ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and unique_id is not null ";
-		if (isset($order_by)) {
-			$sql .= "order by $order_by $order ";
-		}
-		else {
-			$sql .= "order by extension asc ";
-		}
-		$sql .= " limit $rows_per_page offset $offset ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-		$result_count = count($result);
-		unset ($prep_statement, $sql);
-
-		$c = 0;
-		$row_style["0"] = "row_style0";
-		$row_style["1"] = "row_style1";
-
-		echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-		echo "<tr>\n";
-		echo th_order_by('extension', $text['label-extension'], $order_by, $order);
-		echo th_order_by('unique_id', $text['label-unique_id'], $order_by, $order);
-		echo th_order_by('dial_user', $text['label-forward_to'], $order_by, $order);
-		echo th_order_by('description', $text['label-description'], $order_by, $order);
-		echo "<td class='list_control_icons'>";
-		if (permission_exists('extension_add')) {
-			echo "<a href='extension_edit.php' alt='".$text['message-add']."'>$v_link_label_add</a>";
-		}
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		if ($result_count > 0) {
-			foreach($result as $row) {
-				$tr_link = (permission_exists('extension_edit')) ? "href='extension_edit.php?id=".$row['extension_uuid']."'" : null;
-				echo "<tr ".$tr_link.">\n";
-				echo "	<td valign='top' class='".$row_style[$c]."'>";
-				if (permission_exists('extension_edit')) {
-					echo "<a href='extension_edit.php?id=".$row['extension_uuid']."'>".$row['extension']."</a>";
-				}
-				else {
-					echo $row['extension'];
-				}
-				echo "	</td>\n";
-				echo "	<td valign='top' class='".$row_style[$c]."'>".$row['unique_id']."&nbsp;</td>\n";
-				if (strlen($row['dial_user']) > 0) {
-					echo "	<td valign='top' class='".$row_style[$c]."'>".$row['dial_user']."@".$row['dial_domain']."&nbsp;</td>\n";
-				}
-				else {
-					echo "	<td valign='top' class='".$row_style[$c]."'>&nbsp;</td>\n";
-				}
-				echo "	<td valign='top' class='row_stylebg' width='30%'>".$row['description']."&nbsp;</td>\n";
-				echo "	<td class='list_control_icons'>";
-				if (permission_exists('extension_edit')) {
-					echo "<a href='extension_edit.php?id=".$row['extension_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
-				}
-				if (permission_exists('extension_delete')) {
-					echo "<a href='extension_delete.php?id=".$row['extension_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
-				}
-				echo "	</td>\n";
-				echo "</tr>\n";
-				if ($c==0) { $c=1; } else { $c=0; }
-			} //end foreach
-			unset($sql, $result, $row_count);
-		} //end if results
-
-		echo "<tr>\n";
-		echo "<td colspan='6' align='left'>\n";
-		echo "	<table border='0' width='100%' cellpadding='0' cellspacing='0'>\n";
-		echo "	<tr>\n";
-		echo "		<td width='33.3%' nowrap>&nbsp;</td>\n";
-		echo "		<td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
-		echo "		<td class='list_control_icons'>";
-		if (permission_exists('extension_add')) {
-			echo 		"<a href='extension_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
-		}
-		echo "		</td>\n";
-		echo "	</tr>\n";
-		echo "	</table>\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "</table>";
-		echo "<br><br>";
-
-//show the footer
-	require_once "resources/footer.php";
-?>

+ 0 - 8
hot_desking/resources/switch/conf/dialplan/470_hot-desk-login.xml

@@ -1,8 +0,0 @@
-<context name="{v_context}">
-	<extension name="hot-desk-login" number="*072" continue="false" app_uuid="89aec992-e3bb-43a1-a64b-ca70800e30fd" enabled="false">
-		<condition field="destination_number" expression="^\*072$" >
-			<action application="set" data="direction=in" />
-			<action application="lua" data="dial_string.lua" />
-		</condition>
-	</extension>
-</context>

+ 0 - 8
hot_desking/resources/switch/conf/dialplan/475_hot-desk-logout.xml

@@ -1,8 +0,0 @@
-<context name="{v_context}">
-	<extension name="hot-desk-logout" number="*073" continue="false" app_uuid="97e920d9-dddc-458f-bae0-837a48c3f401" enabled="false">
-		<condition field="destination_number" expression="^\*073$" >
-			<action application="set" data="direction=out" />
-			<action application="lua" data="dial_string.lua" />
-		</condition>
-	</extension>
-</context>

+ 0 - 50
hot_desking/root.php

@@ -1,50 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-// make sure the PATH_SEPARATOR is defined
-	if (!defined("PATH_SEPARATOR")) {
-		if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); }
-	}
-
-// make sure the document_root is set
-	$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]);
-	$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
-	$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
-	//echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."<br />\n";
-	//echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."<br />\n";
-	//echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."<br />\n";
-
-// if the project directory exists then add it to the include path otherwise add the document root to the include path
-	if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){
-		if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', '/fusionpbx'); }
-		set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' );
-	}
-	else {
-		if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', ''); }
-		set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );
-	}
-
-?>

+ 0 - 1
hunt_groups/README.md

@@ -1 +0,0 @@
-This feature is deprecated and likely to be removed in the future.

+ 0 - 265
hunt_groups/app_config.php

@@ -1,265 +0,0 @@
-<?php
-
-	//application details
-		$apps[$x]['name'] = "Hunt Group";
-		$apps[$x]['uuid'] = '0610f841-2e27-4c5f-7926-08ab3aad02e0';
-		$apps[$x]['category'] = 'Switch';;
-		$apps[$x]['subcategory'] = '';
-		$apps[$x]['version'] = '';
-		$apps[$x]['license'] = 'Mozilla Public License 1.1';
-		$apps[$x]['url'] = 'http://www.fusionpbx.com';
-		$apps[$x]['description']['en-us'] = 'A Hunt Group is a list of destinations that can be called in sequence or simultaneously.';
-		$apps[$x]['description']['es-mx'] = 'Un grupo en caza es una lista de destinos que pueden ser llamados en sequencia o simultáneamente.';
-		$apps[$x]['description']['de-de'] = '';
-		$apps[$x]['description']['de-ch'] = '';
-		$apps[$x]['description']['de-at'] = '';
-		$apps[$x]['description']['fr-fr'] = "Un groupe chasse est une liste de destinataires qui peuvent être appellés en séquence ou simultanément.";
-		$apps[$x]['description']['fr-ca'] = '';
-		$apps[$x]['description']['fr-ch'] = '';
-		$apps[$x]['description']['pt-pt'] = 'Um grupo de busca é uma lista de destinos que podem ser chamados em sequência ou simultaneamente.';
-		$apps[$x]['description']['pt-br'] = '';
-
-	//permission details
-		$apps[$x]['permissions'][0]['name'] = 'hunt_group_view';
-		$apps[$x]['permissions'][0]['groups'][] = 'admin';
-		$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
-
-		$apps[$x]['permissions'][1]['name'] = 'hunt_group_add';
-		$apps[$x]['permissions'][1]['groups'][] = 'admin';
-		$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
-
-		$apps[$x]['permissions'][2]['name'] = 'hunt_group_edit';
-		$apps[$x]['permissions'][2]['groups'][] = 'admin';
-		$apps[$x]['permissions'][2]['groups'][] = 'superadmin';
-
-		$apps[$x]['permissions'][3]['name'] = 'hunt_group_delete';
-		$apps[$x]['permissions'][3]['groups'][] = 'admin';
-		$apps[$x]['permissions'][3]['groups'][] = 'superadmin';
-
-		$apps[$x]['permissions'][4]['name'] = 'hunt_group_call_forward';
-
-	//schema details
-		$y = 0; //table array index
-		$z = 0; //field array index
-		$apps[$x]['db'][$y]['table'] = 'v_hunt_groups';
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'hunt_group_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'dialplan_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_dialplans';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'dialplan_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_extension';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgroupextension';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_name';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgroupname';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_type';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgrouptype';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_context';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgroupcontext';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_timeout';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgrouptimeout';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_timeout_destination';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgrouptimeoutdestination';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_timeout_type';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgrouptimeouttype';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_ringback';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgroupringback';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_cid_name_prefix';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgroupcidnameprefix';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_pin';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgrouppin';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_caller_announce';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgroupcallerannounce';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'hunt_group_call_prompt';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'hunt_group_user_list';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'hunt_group_enabled';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'hunt_group_description';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'huntgroup_desc';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-
-		$y = 1; //table array index
-		$z = 0; //field array index
-		$apps[$x]['db'][$y]['table'] = 'v_hunt_group_destinations';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'hunt_group_destination_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'hunt_group_destination_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'hunt_group_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'hunt_group_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'destination_data';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'destinationdata';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'destination_type';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'destinationtype';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'destination_profile';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'destinationprofile';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'destination_timeout';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'destination_order';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'destinationorder';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'destination_enabled';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'destination_description';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'destinationdescr';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-
-		$y = 2; //table array index
-		$z = 0; //field array index
-		$apps[$x]['db'][$y]['table'] = 'v_hunt_group_users';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'hunt_group_user_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'hunt_group_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_hunt_groups';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'hunt_group_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'user_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_users';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'user_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
-
-?>

+ 0 - 97
hunt_groups/app_languages.php

@@ -1,97 +0,0 @@
-<?php
-
-//Hunt Groups
-
-$text['title-hunt_groups']['en-us'] = 'Hunt Groups';
-$text['title-hunt_group']['en-us'] = 'Hunt Group';
-$text['title-hunt_group_destination_add']['en-us'] = 'Destination Add';
-$text['title-hunt_group_destination_edit']['en-us'] = 'Destination Edit';
-$text['title-hunt-group_call_forward']['en-us'] = 'Hunt Group Call Forward';
-
-$text['header-hunt_groups']['en-us'] = 'Hunt Groups';
-$text['header-hunt_group']['en-us'] = 'Hunt Group';
-$text['header-hunt_group_destinations']['en-us'] = 'Destinations';
-$text['header-hunt_group_destination_add']['en-us'] = 'Destination Add';
-$text['header-hunt_group_destination_edit']['en-us'] = 'Destination Edit';
-$text['header-hunt-group_call_forward']['en-us'] = 'Hunt Group Call Forward';
-
-$text['description-hunt_groups']['en-us'] = 'A Hunt Group is a list of destinations that can be called in sequence or simultaneously.';
-$text['description-hunt_group']['en-us'] = 'Specify the attributes of your Hunt Group below.';
-$text['description-hunt_group_destinations']['en-us'] = 'The following destinations will be called.';
-$text['description-hunt_group_call_forward']['en-us'] = 'Use the links to configure hunt group call forward. The following hunt groups have been assigned to this user account.';
-$text['description-hunt_group_call_forward_edit']['en-us'] = 'Directs incoming calls for extension';
-
-$text['label-name']['en-us'] = 'Name';
-$text['label-extension']['en-us'] = 'Extension';
-$text['label-strategy']['en-us'] = 'Strategy';
-$text['label-timeout']['en-us'] = 'Timeout';
-$text['label-timeout_destination']['en-us'] = 'Timeout Destination';
-$text['label-timeout_type']['en-us'] = 'Timeout Type';
-$text['label-ring_back']['en-us'] = 'Ring Back';
-$text['label-caller_id_name_prefix']['en-us'] = 'Caller ID Name Prefix';
-$text['label-pin_number']['en-us'] = 'PIN Number';
-$text['label-caller_announce']['en-us'] = 'Caller Announce';
-$text['label-user_list']['en-us'] = 'User List';
-$text['label-enabled']['en-us'] = 'Enabled';
-$text['label-description']['en-us'] = 'Description';
-$text['label-destination']['en-us'] = 'Destination';
-$text['label-type']['en-us'] = 'Type';
-$text['label-profile']['en-us'] = 'Profile';
-$text['label-order']['en-us'] = 'Order';
-$text['label-tools']['en-us'] = 'Tools';
-$text['label-call_forward']['en-us'] = 'Call Forward';
-$text['label-call_prompt']['en-us'] = 'Call Prompt';
-$text['label-number']['en-us'] = 'Number';
-
-$text['description-name']['en-us'] = 'Enter a name for this hunt group.';
-$text['description-extension']['en-us'] = 'Enter an extension for this hunt group. (eg. 7002)';
-$text['description-strategy']['en-us'] = 'Select a ring strategy.';
-$text['description-timeout']['en-us'] = 'The timeout sets the time in seconds to continue to call before timing out.';
-$text['description-timeout_destination']['en-us'] = 'Enter the timeout destination. (eg. 1001)';
-$text['description-timeout_type']['en-us'] = 'Select the timeout destination type.';
-$text['description-ring_back']['en-us'] = 'Select what the caller will hear while the destination is being called.';
-$text['description-caller_id_name_prefix']['en-us'] = 'Set a prefix on the caller ID name.';
-$text['description-pin_number']['en-us'] = 'If this is provided then the caller will be required to enter the PIN number.';
-$text['description-user_list_select']['en-us'] = 'Select users above to add to the user list below. This will assign users to this hunt group extension.';
-$text['description-user_list_textarea']['en-us'] = 'Assign the users that can manage this hunt group extension.';
-$text['description-enabled']['en-us'] = 'Set the status of this hunt group.';
-$text['description-description']['en-us'] = 'Enter a description here, if desired (not parsed).';
-$text['description-destination_timeout']['en-us'] = 'Select the destination timeout in seconds.';
-$text['description-destination_order']['en-us'] = 'The processing of each destination is determined by the order specified above.';
-$text['description-destination_examples']['en-us'] = 'Example Values';
-$text['description-destination_example_extension']['en-us'] = 'Extension';
-$text['description-destination_example_voicemail']['en-us'] = 'Voicemail';
-$text['description-destination_example_sip_uri_voicemail']['en-us'] = 'SIP URI (Voicemail)';
-$text['description-destination_example_sip_uri_external_number']['en-us'] = 'SIP URI (External Number)';
-$text['description-destination_example_sip_uri_auto_attendant']['en-us'] = 'SIP URI (Auto Attendant)';
-$text['description-destination_example_sip_uri_user']['en-us'] = 'SIP URI (User)';
-
-$text['option-true']['en-us'] = 'True';
-$text['option-false']['en-us'] = 'False';
-$text['option-simultaneous']['en-us'] = 'Simultaneous';
-$text['option-sequential']['en-us'] = 'Sequential';
-$text['option-extension']['en-us'] = 'Extension';
-$text['option-voicemail']['en-us'] = 'Voicemail';
-$text['option-sip_uri']['en-us'] = 'SIP URI';
-$text['option-enabled']['en-us'] = 'Enabled';
-$text['option-disabled']['en-us'] = 'Disabled';
-
-$text['button-add']['en-us'] = 'Add';
-$text['button-edit']['en-us'] = 'Edit';
-$text['button-delete']['en-us'] = 'Delete';
-$text['button-advanced']['en-us'] = 'Advanced';
-$text['button-copy']['en-us'] = 'Copy';
-$text['button-back']['en-us'] = 'Back';
-$text['button-save']['en-us'] = 'Save';
-
-$text['confirm-delete']['en-us'] = 'Do you really want to delete this?';
-$text['confirm-copy']['en-us'] = 'Do you really want to copy this?';
-
-$text['message-add']['en-us'] = 'Add Completed';
-$text['message-update']['en-us'] = 'Update Completed';
-$text['message-delete']['en-us'] = 'Delete Completed';
-$text['message-copy']['en-us'] = 'Copy Completed';
-$text['message_extension']['en-us'] = 'Enter the new Extension to use...';
-$text['message-required']['en-us'] = 'Please provide: ';
-
-?>

+ 0 - 20
hunt_groups/app_menu.php

@@ -1,20 +0,0 @@
-<?php
-
-	$apps[$x]['menu'][0]['title']['en-us'] = 'Hunt Groups';
-	$apps[$x]['menu'][0]['title']['es-mx'] = 'Grupos de Caza';
-	$apps[$x]['menu'][0]['title']['de-de'] = '';
-	$apps[$x]['menu'][0]['title']['de-ch'] = '';
-	$apps[$x]['menu'][0]['title']['de-at'] = '';
-	$apps[$x]['menu'][0]['title']['fr-fr'] = 'Group chasse';
-	$apps[$x]['menu'][0]['title']['fr-ca'] = '';
-	$apps[$x]['menu'][0]['title']['fr-ch'] = '';
-	$apps[$x]['menu'][0]['title']['pt-pt'] = 'Grupo de Busca';
-	$apps[$x]['menu'][0]['title']['pt-br'] = '';
-	$apps[$x]['menu'][0]['uuid'] = '632f87de-7f86-b68f-c629-4c2d2b3ce545';
-	$apps[$x]['menu'][0]['parent_uuid'] = 'fd29e39c-c936-f5fc-8e2b-611681b266b5';
-	$apps[$x]['menu'][0]['category'] = 'internal';
-	$apps[$x]['menu'][0]['path'] = '/app/hunt_groups/hunt_groups.php';
-	$apps[$x]['menu'][0]['groups'][] = 'admin';
-	$apps[$x]['menu'][0]['groups'][] = 'superadmin';
-
-?>

+ 0 - 131
hunt_groups/hunt_group_call_forward.php

@@ -1,131 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-
-//check permissions
-if (permission_exists('hunt_group_call_forward')) {
-
-	require_once "resources/header.php";
-	$page["title"] = $text['title-hunt-group_call_forward'];
-	require_once "resources/paging.php";
-
-	//add multi-lingual support
-		$language = new text;
-		$text = $language->get();
-
-	$order_by = $_GET["order_by"];
-	$order = $_GET["order"];
-
-	echo "<div align='center'>";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
-	echo "<tr class='border'>\n";
-	echo "	<td align=\"center\">\n";
-
-	if ($is_included != "true") {
-		echo "	<br>";
-		echo "	<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
-		echo "	<tr>\n";
-		echo "	<td align='left'><b>".$text['header-hunt-group_call_forward']."</b><br>\n";
-		echo "		".$text['description-hunt_group_call_forward']."\n";
-		echo "	</td>\n";
-		echo "	</tr>\n";
-		echo "	</table>\n";
-		echo "	<br />";
-	}
-
-	$sql = "select * from v_hunt_groups ";
-	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and hunt_group_type <> 'dnd' ";
-	$sql .= "and hunt_group_type <> 'call_forward' ";
-	$sql .= "and hunt_group_type <> 'follow_me_simultaneous' ";
-	$sql .= "and hunt_group_type <> 'follow_me_sequence' ";
-	if (!(permission_exists('hunt_group_add') || permission_exists('hunt_group_edit'))) {
-		$sql .= "and hunt_group_user_list like '%|".$_SESSION["username"]."|%' ";
-	}
-	if (strlen($order_by)> 0) {
-		$sql .= "order by $order_by $order ";
-	}
-	else {
-		$sql .= "order by hunt_group_extension asc ";
-	}
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	$result_count = count($result);
-	unset ($prep_statement, $sql);
-
-	$c = 0;
-	$row_style["0"] = "row_style0";
-	$row_style["1"] = "row_style1";
-
-	if ($is_included == "true" && $result_count == 0) {
-		//hide this when there is no result
-	}
-	else {
-		echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-		echo "<tr>\n";
-		echo "<th>".$text['label-extension']."</th>\n";
-		echo "<th>".$text['label-tools']."</th>\n";
-		echo "<th>".$text['label-description']."</th>\n";
-		echo "</tr>\n";
-	}
-
-	if ($result_count > 0) {
-		foreach($result as $row) {
-			echo "<tr >\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['hunt_group_extension']."</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>\n";
-			echo "		<a href='".PROJECT_PATH."/app/hunt_group/hunt_group_call_forward_edit.php?id=".$row['hunt_group_uuid']."&a=call_forward' alt='".$text['label-call_forward']."'>".$text['label-call_forward']."</a> \n";
-			echo "	</td>\n";
-			echo "	<td valign='top' class='row_stylebg' width='40%'>".$row['hunt_group_description']."&nbsp;</td>\n";
-			echo "</tr>\n";
-			if ($c==0) { $c=1; } else { $c=0; }
-		}
-		unset($sql, $result, $row_count);
-	} //end if results
-
-	if ($is_included == "true" && $result_count == 0) {
-		//hide this when there is no result
-	}
-	else {
-		echo "</table>";
-
-		echo "<br>";
-		echo "<br>";
-		echo "<br>";
-	}
-
-	echo "</table>";
-	echo "</div>";
-
-	if ($is_included != "true") {
-		require_once "resources/footer.php";
-	}
-}
-
-?>

+ 0 - 493
hunt_groups/hunt_group_call_forward_edit.php

@@ -1,493 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-require_once "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('hunt_group_add') || permission_exists('hunt_group_edit') || permission_exists('hunt_group_call_forward')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-function destination_select($select_name, $select_value, $select_default) {
-	if (strlen($select_value) == 0) { $select_value = $select_default; }
-	echo "	<select class='formfld' style='width: 40px;' name='$select_name'>\n";
-	echo "	<option value=''></option>\n";
-
-	$i=5;
-	while($i<=100) {
-		if ($select_value == $i) {
-			echo "	<option value='$i' selected='selected'>$i</option>\n";
-		}
-		else {
-			echo "	<option value='$i'>$i</option>\n";
-		}
-		$i=$i+5;
-	}
-	echo "</select>\n";
-}
-
-//show the header
-	require_once "resources/header.php";
-	$page["title"] = $text['title-hunt-group_call_forward'];
-
-//get the hunt_group_uuid
-	$hunt_group_uuid = $_REQUEST["id"];
-
-//hunt_group information used to determine if this is an add or an update
-	$sql = "select * from v_hunt_groups ";
-	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and hunt_group_uuid = '$hunt_group_uuid' ";
-	if (!(permission_exists('hunt_group_add') || permission_exists('hunt_group_edit'))) {
-		$sql .= "and hunt_group_user_list like '%|".$_SESSION["username"]."|%' ";
-	}
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	foreach ($result as &$row) {
-		$hunt_group_uuid = $row["hunt_group_uuid"];
-		$hunt_group_extension = $row["hunt_group_extension"];
-	}
-	unset ($prep_statement);
-
-if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
-
-	//get http post variables and set them to php variables
-		if (count($_POST)>0) {
-			$call_forward_enabled = check_str($_POST["call_forward_enabled"]);
-			$call_forward_number = check_str($_POST["call_forward_number"]);
-			$hunt_group_call_prompt = check_str($_POST["hunt_group_call_prompt"]);
-
-			if (strlen($call_forward_number) > 0) {
-				$call_forward_number = preg_replace("~[^0-9]~", "",$call_forward_number);
-			}
-
-			//set the default
-				if (strlen($hunt_group_call_prompt) == 0) {
-					$hunt_group_call_prompt = 'false';
-				}
-		}
-
-	//check for all required data
-		//if (strlen($call_forward_enabled) == 0) { $msg .= $text['message-required'].$text['label-call_forward']."<br>\n"; }
-		//if (strlen($call_forward_number) == 0) { $msg .= $text['message-required'].$text['label-number']."<br>\n"; }
-		//if (strlen($hunt_group_call_prompt) == 0) { $msg .= $text['message-required'].$text['label-call_prompt']."<br>\n"; }
-		if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
-			require_once "resources/header.php";
-			require_once "resources/persist_form_var.php";
-			echo "<div align='center'>\n";
-			echo "<table><tr><td>\n";
-			echo $msg."<br />";
-			echo "</td></tr></table>\n";
-			persistformvar($_POST);
-			echo "</div>\n";
-			require_once "resources/footer.php";
-			return;
-		}
-
-	//call forward is enabled so disable the hunt group
-		if ($call_forward_enabled == "true") {
-			$sql = "update v_hunt_groups set hunt_group_enabled = 'false' ";
-			$sql .= "where hunt_group_extension = '$hunt_group_extension' ";
-			$sql .= "and (hunt_group_type = 'simultaneous' or hunt_group_type = 'sequentially') ";
-			$db->exec(check_sql($sql));
-		}
-
-	//call forward is disabled so enable the hunt group
-		if ($call_forward_enabled == "false" || $call_forward_enabled == "") {
-			$sql = "update v_hunt_groups set hunt_group_enabled = 'true' ";
-			$sql .= "where hunt_group_extension = '$hunt_group_extension' ";
-			$sql .= "and (hunt_group_type = 'simultaneous' or hunt_group_type = 'sequentially') ";
-			$db->exec(check_sql($sql));
-		}
-
-	//set the default action to add
-		$call_forward_action = "add";
-
-	//hunt_group information used to determine if this is an add or an update
-		$sql = "select * from v_hunt_groups ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and hunt_group_type = 'call_forward' ";
-		$sql .= "and hunt_group_extension in ( ";
-		$sql .= "select hunt_group_extension from v_hunt_groups ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and hunt_group_uuid = '$hunt_group_uuid' ";
-		if (!(permission_exists('hunt_group_add') || permission_exists('hunt_group_edit'))) {
-			$sql .= "and hunt_group_user_list like '%|".$_SESSION["username"]."|%' ";
-		}
-		$sql .= ") ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-		foreach ($result as &$row) {
-			if ($row["hunt_group_type"] == 'call_forward') {
-				$call_forward_action = "update";
-				$call_forward_uuid = $row["hunt_group_uuid"];
-			}
-		}
-		unset ($prep_statement);
-
-	//call forward config
-		$huntgroup_name = 'call_forward_'.$hunt_group_extension;
-		$hunt_group_type = 'call_forward';
-		$hunt_group_context = $_SESSION['context'];
-		$hunt_group_timeout = '3600';
-		$hunt_group_timeout_destination = $hunt_group_extension;
-		$hunt_group_timeout_type = 'voicemail';
-		$hunt_group_ring_back = 'us-ring';
-		$hunt_group_cid_name_prefix = '';
-		$hunt_group_pin = '';
-		$huntgroup_caller_announce = 'false';
-		$hunt_group_user_list = '';
-		$hunt_group_enabled = $call_forward_enabled;
-		$hunt_group_description = 'call forward '.$hunt_group_extension;
-
-		if ($call_forward_action == "add" && permission_exists('hunt_group_add')) {
-			$call_forward_uuid = uuid();
-			$sql = "insert into v_hunt_groups ";
-			$sql .= "(";
-			$sql .= "domain_uuid, ";
-			$sql .= "hunt_group_uuid, ";
-			$sql .= "hunt_group_extension, ";
-			$sql .= "hunt_group_name, ";
-			$sql .= "hunt_group_type, ";
-			$sql .= "hunt_group_context, ";
-			$sql .= "hunt_group_timeout, ";
-			$sql .= "hunt_group_timeout_destination, ";
-			$sql .= "hunt_group_timeout_type, ";
-			$sql .= "hunt_group_ringback, ";
-			$sql .= "hunt_group_cid_name_prefix, ";
-			$sql .= "hunt_group_pin, ";
-			$sql .= "hunt_group_call_prompt, ";
-			$sql .= "hunt_group_caller_announce, ";
-			$sql .= "hunt_group_user_list, ";
-			$sql .= "hunt_group_enabled, ";
-			$sql .= "hunt_group_description ";
-			$sql .= ")";
-			$sql .= "values ";
-			$sql .= "(";
-			$sql .= "'$domain_uuid', ";
-			$sql .= "'$call_forward_uuid', ";
-			$sql .= "'$hunt_group_extension', ";
-			$sql .= "'$huntgroup_name', ";
-			$sql .= "'$hunt_group_type', ";
-			$sql .= "'$hunt_group_context', ";
-			$sql .= "'$hunt_group_timeout', ";
-			$sql .= "'$hunt_group_timeout_destination', ";
-			$sql .= "'$hunt_group_timeout_type', ";
-			$sql .= "'$hunt_group_ring_back', ";
-			$sql .= "'$hunt_group_cid_name_prefix', ";
-			$sql .= "'$hunt_group_pin', ";
-			$sql .= "'$hunt_group_call_prompt', ";
-			$sql .= "'$huntgroup_caller_announce', ";
-			$sql .= "'$hunt_group_user_list', ";
-			$sql .= "'$hunt_group_enabled', ";
-			$sql .= "'$hunt_group_description' ";
-			$sql .= ")";
-			if ($v_debug) {
-				echo $sql."<br />";
-			}
-			$db->exec(check_sql($sql));
-			unset($sql);
-
-		//delete related v_hunt_group_destinations
-			$sql = "delete from v_hunt_group_destinations where hunt_group_uuid = '$call_forward_uuid' ";
-			$db->exec(check_sql($sql));
-
-		if (extension_exists($call_forward_number)) {
-			$destination_data = $call_forward_number;
-			$destination_type = 'extension';
-		}
-		$destination_profile = 'internal';
-		$destination_timeout = '';
-		$destination_order = '1';
-		$destination_enabled = 'true';
-		$destination_description = 'call forward';
-
-		$hunt_group_destination_uuid = uuid();
-		$sql = "insert into v_hunt_group_destinations ";
-		$sql .= "(";
-		$sql .= "domain_uuid, ";
-		$sql .= "hunt_group_uuid, ";
-		$sql .= "hunt_group_destination_uuid, ";
-		$sql .= "destination_data, ";
-		$sql .= "destination_type, ";
-		$sql .= "destination_profile, ";
-		$sql .= "destination_timeout, ";
-		$sql .= "destination_order, ";
-		$sql .= "destination_enabled, ";
-		$sql .= "destination_description ";
-		$sql .= ")";
-		$sql .= "values ";
-		$sql .= "(";
-		$sql .= "'$domain_uuid', ";
-		$sql .= "'$call_forward_uuid', ";
-		$sql .= "'$hunt_group_destination_uuid', ";
-		$sql .= "'$destination_data', ";
-		$sql .= "'$destination_type', ";
-		$sql .= "'$destination_profile', ";
-		$sql .= "'$destination_timeout', ";
-		$sql .= "'$destination_order', ";
-		$sql .= "'$destination_enabled', ";
-		$sql .= "'$destination_description' ";
-		$sql .= ")";
-		$db->exec(check_sql($sql));
-		unset($sql);
-	} //if ($call_forward_action == "add")
-
-	if ($call_forward_action == "update" && permission_exists('hunt_group_call_forward')) {
-		$sql = "update v_hunt_groups set ";
-		$sql .= "hunt_group_extension = '$hunt_group_extension', ";
-		$sql .= "hunt_group_name = '$huntgroup_name', ";
-		$sql .= "hunt_group_type = '$hunt_group_type', ";
-		$sql .= "hunt_group_context = '$hunt_group_context', ";
-		$sql .= "hunt_group_timeout = '$hunt_group_timeout', ";
-		$sql .= "hunt_group_timeout_destination = '$hunt_group_timeout_destination', ";
-		$sql .= "hunt_group_timeout_type = '$hunt_group_timeout_type', ";
-		$sql .= "hunt_group_ringback = '$hunt_group_ring_back', ";
-		$sql .= "hunt_group_cid_name_prefix = '$hunt_group_cid_name_prefix', ";
-		$sql .= "hunt_group_pin = '$hunt_group_pin', ";
-		$sql .= "hunt_group_call_prompt = '$hunt_group_call_prompt', ";
-		$sql .= "hunt_group_caller_announce = '$huntgroup_caller_announce', ";
-		$sql .= "hunt_group_user_list = '$hunt_group_user_list', ";
-		$sql .= "hunt_group_enabled = '$hunt_group_enabled', ";
-		$sql .= "hunt_group_description = '$hunt_group_description' ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and hunt_group_uuid = '$call_forward_uuid'";
-		$db->exec(check_sql($sql));
-		unset($sql);
-
-		//set the variables
-			$destination_data = $call_forward_number;
-			if (extension_exists($call_forward_number)) {
-				$destination_type = 'extension';
-			}
-			else {
-				$destination_type = 'sip uri';
-			}
-			$destination_profile = 'internal';
-			$destination_timeout = '';
-			$destination_order = '1';
-			$destination_enabled = 'true';
-			$destination_description = 'call forward';
-
-		//delete related v_hunt_group_destinations
-			$sql = "delete from v_hunt_group_destinations where hunt_group_uuid = '$call_forward_uuid' ";
-			$db->exec(check_sql($sql));
-
-		//insert the v_hunt_group_destinations
-			$hunt_group_destination_uuid = uuid();
-			$sql = "insert into v_hunt_group_destinations ";
-			$sql .= "(";
-			$sql .= "hunt_group_destination_uuid, ";
-			$sql .= "domain_uuid, ";
-			$sql .= "hunt_group_uuid, ";
-			$sql .= "destination_data, ";
-			$sql .= "destination_type, ";
-			$sql .= "destination_profile, ";
-			$sql .= "destination_timeout, ";
-			$sql .= "destination_order, ";
-			$sql .= "destination_enabled, ";
-			$sql .= "destination_description ";
-			$sql .= ")";
-			$sql .= "values ";
-			$sql .= "(";
-			$sql .= "'$hunt_group_destination_uuid', ";
-			$sql .= "'$domain_uuid', ";
-			$sql .= "'$call_forward_uuid', ";
-			$sql .= "'$destination_data', ";
-			$sql .= "'$destination_type', ";
-			$sql .= "'$destination_profile', ";
-			$sql .= "'$destination_timeout', ";
-			$sql .= "'$destination_order', ";
-			$sql .= "'$destination_enabled', ";
-			$sql .= "'$destination_description' ";
-			$sql .= ")";
-			$db->exec(check_sql($sql));
-			unset($sql);
-	} //if ($call_forward_action == "update")
-
-	//synchronize the xml config
-		save_hunt_group_xml();
-
-	//synchronize the xml config
-		save_dialplan_xml();
-
-	//redirect the user
-		require_once "resources/header.php";
-		echo "<meta http-equiv=\"refresh\" content=\"3;url=".PROJECT_PATH."/app/hunt_group/hunt_group_call_forward.php\">\n";
-		echo "<div align='center'>\n";
-		echo $text['message-update']."<br />\n";
-		echo "</div>\n";
-		require_once "resources/footer.php";
-		return;
-} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
-
-
-
-//pre-populate the form
-	$sql = "select * from v_hunt_groups ";
-	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and hunt_group_type = 'call_forward' ";
-	$sql .= "and hunt_group_extension = '$hunt_group_extension' ";
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	foreach ($result as &$row) {
-		$hunt_group_uuid = $row["hunt_group_uuid"];
-		$hunt_group_extension = $row["hunt_group_extension"];
-		$huntgroup_name = $row["hunt_group_name"];
-		$hunt_group_type = $row["hunt_group_type"];
-		$hunt_group_context = $row["hunt_group_context"];
-		$hunt_group_timeout = $row["hunt_group_timeout"];
-		$hunt_group_timeout_destination = $row["hunt_group_timeout_destination"];
-		$hunt_group_timeout_type = $row["hunt_group_timeout_type"];
-		$hunt_group_ring_back = $row["hunt_group_ringback"];
-		$hunt_group_cid_name_prefix = $row["hunt_group_cid_name_prefix"];
-		$hunt_group_pin = $row["hunt_group_pin"];
-		$hunt_group_call_prompt = $row["hunt_group_call_prompt"];
-		$huntgroup_caller_announce = $row["hunt_group_caller_announce"];
-		$hunt_group_user_list = $row["hunt_group_user_list"];
-		$hunt_group_enabled = $row["hunt_group_enabled"];
-		$hunt_group_description = $row["hunt_group_description"];
-
-		if ($row["hunt_group_type"] == 'call_forward') {
-			$call_forward_enabled = $hunt_group_enabled;
-		}
-
-		if ($row["hunt_group_type"] == 'call_forward') {
-			$sql = "select * from v_hunt_group_destinations ";
-			$sql .= "where hunt_group_uuid = '$hunt_group_uuid' ";
-			$prep_statement_2 = $db->prepare(check_sql($sql));
-			$prep_statement_2->execute();
-			$result2 = $prep_statement_2->fetchAll(PDO::FETCH_NAMED);
-			$x=1;
-			foreach ($result2 as &$row2) {
-				if ($row["hunt_group_type"] == 'call_forward') {
-					if (strlen($row2["destination_data"]) > 0) {
-						$call_forward_number = $row2["destination_data"];
-					}
-				}
-			}
-			unset ($prep_statement_2);
-		}
-	}
-	unset ($prep_statement);
-
-//show the content
-	echo "<div align='center'>";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
-	echo "<tr class='border'>\n";
-	echo "	<td align=\"center\">\n";
-	echo "		<br>";
-
-	echo "<form method='post' name='frm' action=''>\n";
-	echo "<table width='100%'  border='0' cellpadding='6' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "<td align='left' width='30%' nowrap>\n";
-	echo "	<b>".$text['header-hunt-group_call_forward']."</b>\n";
-	echo "</td>\n";
-	echo "<td width='70%' align='right'>\n";
-	echo "	<input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='hunt_group_call_forward.php'\" value='".$text['button-back']."'>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-	echo "<tr>\n";
-	echo "<td colspan='2'>\n";
-	echo "	".$text['description-hunt_group_call_forward_edit']." ".$hunt_group_extension."<br /><br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-	echo "	<strong>".$text['label-call_forward'].":</strong>\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	if ($call_forward_enabled == "true") {
-		echo "	<input type='radio' name='call_forward_enabled' value='true' checked='checked'/> ".$text['option-enabled']." \n";
-	}
-	else {
-		echo "	<input type='radio' name='call_forward_enabled' value='true' /> ".$text['option-enabled']." \n";
-	}
-	if ($call_forward_enabled == "false" || $call_forward_enabled == "") {
-		echo "	<input type='radio' name='call_forward_enabled' value='false' checked='checked' /> ".$text['option-disabled']." \n";
-	}
-	else {
-		echo "	<input type='radio' name='call_forward_enabled' value='false' /> ".$text['option-disabled']." \n";
-	}
-	echo "<br />\n";
-	echo "<br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-	echo "	".$text['label-number'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	<input class='formfld' type='text' name='call_forward_number' maxlength='255' value=\"$call_forward_number\">\n";
-	echo "<br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td colspan='2'>\n";
-	echo "	<br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td colspan='2'>\n";
-	echo "	<br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "	<tr>\n";
-	echo "		<td colspan='2' align='right'>\n";
-	if ($action == "update") {
-		echo "				<input type='hidden' name='id' value='$call_forward_uuid'>\n";
-	}
-	echo "				<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
-	echo "		</td>\n";
-	echo "	</tr>";
-	echo "</table>";
-	echo "</form>";
-
-	echo "	</td>";
-	echo "	</tr>";
-	echo "</table>";
-	echo "</div>";
-
-//show the footer
-	require_once "resources/footer.php";
-?>

+ 0 - 182
hunt_groups/hunt_group_copy.php

@@ -1,182 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-require_once "resources/paging.php";
-
-//check permissions
-	if (permission_exists('hunt_group_add')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//set the http get/post variable(s) to a php variable
-	if (isset($_REQUEST["id"])) {
-		$hunt_group_uuid = check_str($_REQUEST["id"]);
-		$hunt_group_extension_new = check_str($_REQUEST["ext"]);
-	}
-
-//get the v_hunt_group data
-	$sql = "select * from v_hunt_groups ";
-	$sql .= "where hunt_group_uuid = '$hunt_group_uuid' ";
-	$sql .= "and domain_uuid = '$domain_uuid' ";
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	foreach ($result as &$row) {
-		$hunt_group_extension = $row["hunt_group_extension"];
-		$hunt_group_name = $row["hunt_group_name"]."_copy";
-		$hunt_group_type = $row["hunt_group_type"];
-		$hunt_group_context = $row["hunt_group_context"];
-		$hunt_group_timeout = $row["hunt_group_timeout"];
-		$hunt_group_timeout_destination = $row["hunt_group_timeout_destination"];
-		$hunt_group_timeout_type = $row["hunt_group_timeout_type"];
-		$hunt_group_ringback = $row["hunt_group_ringback"];
-		$hunt_group_cid_name_prefix = $row["hunt_group_cid_name_prefix"];
-		$hunt_group_pin = $row["hunt_group_pin"];
-		$hunt_group_caller_announce = $row["hunt_group_caller_announce"];
-		$hunt_group_user_list = $row["hunt_group_user_list"];
-		$hunt_group_enabled = $row["hunt_group_enabled"];
-		$hunt_group_description = "copy: ".$row["hunt_group_description"];
-		break; //limit to 1 row
-	}
-	unset ($prep_statement);
-
-	//copy the hunt group
-		$hunt_group_uuid_new = uuid();
-		$sql = "insert into v_hunt_groups ";
-		$sql .= "(";
-		$sql .= "hunt_group_uuid, ";
-		$sql .= "domain_uuid, ";
-		$sql .= "hunt_group_extension, ";
-		$sql .= "hunt_group_name, ";
-		$sql .= "hunt_group_type, ";
-		$sql .= "hunt_group_context, ";
-		$sql .= "hunt_group_timeout, ";
-		$sql .= "hunt_group_timeout_destination, ";
-		$sql .= "hunt_group_timeout_type, ";
-		$sql .= "hunt_group_ringback, ";
-		$sql .= "hunt_group_cid_name_prefix, ";
-		$sql .= "hunt_group_pin, ";
-		$sql .= "hunt_group_caller_announce, ";
-		$sql .= "hunt_group_user_list, ";
-		$sql .= "hunt_group_enabled, ";
-		$sql .= "hunt_group_description ";
-		$sql .= ")";
-		$sql .= "values ";
-		$sql .= "(";
-		$sql .= "'$hunt_group_uuid_new', ";
-		$sql .= "'$domain_uuid', ";
-		$sql .= "'$hunt_group_extension_new', ";
-		$sql .= "'$hunt_group_name', ";
-		$sql .= "'$hunt_group_type', ";
-		$sql .= "'$hunt_group_context', ";
-		$sql .= "'$hunt_group_timeout', ";
-		$sql .= "'$hunt_group_timeout_destination', ";
-		$sql .= "'$hunt_group_timeout_type', ";
-		$sql .= "'$hunt_group_ringback', ";
-		$sql .= "'$hunt_group_cid_name_prefix', ";
-		$sql .= "'$hunt_group_pin', ";
-		$sql .= "'$hunt_group_caller_announce', ";
-		$sql .= "'$hunt_group_user_list', ";
-		$sql .= "'$hunt_group_enabled', ";
-		$sql .= "'$hunt_group_description' ";
-		$sql .= ")";
-		$db->exec(check_sql($sql));
-		unset($sql);
-
-	//get the the hunt group destinations
-		$sql = "select * from v_hunt_group_destinations ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and hunt_group_uuid = '$hunt_group_uuid' ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-		foreach ($result as &$row) {
-			$destination_data = $row["destination_data"];
-			$destination_type = $row["destination_type"];
-			$destination_profile = $row["destination_profile"];
-			$destination_timeout = $row["destination_timeout"];
-			$destination_order = $row["destination_order"];
-			$destination_enabled = $row["destination_enabled"];
-			$destination_description = $row["destination_description"];
-
-			//copy the hunt group destinations
-				$hunt_group_destination_uuid = uuid();
-				$sql = "insert into v_hunt_group_destinations ";
-				$sql .= "(";
-				$sql .= "domain_uuid, ";
-				$sql .= "hunt_group_uuid, ";
-				$sql .= "hunt_group_destination_uuid, ";
-				$sql .= "destination_data, ";
-				$sql .= "destination_type, ";
-				$sql .= "destination_profile, ";
-				$sql .= "destination_timeout, ";
-				$sql .= "destination_order, ";
-				$sql .= "destination_enabled, ";
-				$sql .= "destination_description ";
-				$sql .= ")";
-				$sql .= "values ";
-				$sql .= "(";
-				$sql .= "'$domain_uuid', ";
-				$sql .= "'$hunt_group_uuid_new', ";
-				$sql .= "'$hunt_group_destination_uuid', ";
-				$sql .= "'$destination_data', ";
-				$sql .= "'$destination_type', ";
-				$sql .= "'$destination_profile', ";
-				$sql .= "'$destination_timeout', ";
-				$sql .= "'$destination_order', ";
-				$sql .= "'$destination_enabled', ";
-				$sql .= "'$destination_description' ";
-				$sql .= ")";
-				$db->exec(check_sql($sql));
-				//echo $sql."<br><br>";
-				//exit();
-				unset($sql);
-		}
-		unset ($prep_statement);
-
-	//synchronize the xml config
-		save_hunt_group_xml();
-
-	//redirect the user
-		require_once "resources/header.php";
-		echo "<meta http-equiv=\"refresh\" content=\"2;url=hunt_groups.php\">\n";
-		echo "<div align='center'>\n";
-		echo $text['message-copy']."\n";
-		echo "</div>\n";
-		require_once "resources/footer.php";
-		return;
-
-?>

+ 0 - 117
hunt_groups/hunt_group_delete.php

@@ -1,117 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-
-//check permissions
-if (permission_exists('hunt_group_delete')) {
-	//access granted
-}
-else {
-	echo "access denied";
-	exit;
-}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//get the id
-	if (count($_GET)>0) {
-		$id = $_GET["id"];
-	}
-
-if (strlen($id)>0) {
-
-	//start the atomic transaction
-		$count = $db->exec("BEGIN;");
-
-	//get the dialplan uuid
-		$sql = "select * from v_hunt_groups ";
-		$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-		$sql .= "and hunt_group_uuid = '$id' ";
-		$prep_statement = $db->prepare($sql);
-		$prep_statement->execute();
-		while($row = $prep_statement->fetch(PDO::FETCH_ASSOC)) {
-			$dialplan_uuid = $row['dialplan_uuid'];
-		}
-
-	//delete child data
-		$sql = "delete from v_hunt_group_destinations ";
-		$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-		$sql .= "and hunt_group_uuid = '$id' ";
-		$db->query($sql);
-		unset($sql);
-
-	//delete parent data
-		$sql = "delete from v_hunt_groups ";
-		$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-		$sql .= "and hunt_group_uuid = '$id' ";
-		$db->query($sql);
-		unset($sql);
-
-	//delete the dialplan entry
-		$sql = "delete from v_dialplans ";
-		$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-		$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
-		//echo $sql."<br>\n";
-		$db->query($sql);
-		unset($sql);
-
-	//delete the dialplan details
-		$sql = "delete from v_dialplan_details ";
-		$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-		$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
-		//echo $sql."<br>\n";
-		$db->query($sql);
-		unset($sql);
-
-	//commit the atomic transaction
-		$count = $db->exec("COMMIT;");
-
-	//synchronize the xml config
-		save_hunt_group_xml();
-
-	//delete the dialplan context from memcache
-		$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
-		if ($fp) {
-			$switch_cmd = "memcache delete dialplan:".$_SESSION["context"]."@".$_SESSION['domain_name'];
-			$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
-		}
-
-}
-
-//redirect the user
-	require_once "resources/header.php";
-	echo "<meta http-equiv=\"refresh\" content=\"2;url=hunt_groups.php\">\n";
-	echo "<div align='center'>\n";
-	echo $text['message-delete']."\n";
-	echo "</div>\n";
-	require_once "resources/footer.php";
-	return;
-
-?>

+ 0 - 70
hunt_groups/hunt_group_destination_delete.php

@@ -1,70 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('hunt_group_delete')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-if (count($_GET)>0) {
-	$id = $_GET["id"];
-	$hunt_group_uuid = check_str($_REQUEST["id2"]);
-}
-
-if (strlen($id)>0) {
-	//delete the data
-		$sql = "delete from v_hunt_group_destinations ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and hunt_group_destination_uuid = '$id' ";
-		$sql .= "and hunt_group_uuid = '$hunt_group_uuid' ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		unset($sql);
-	//synchronize the xml config
-		save_hunt_group_xml();
-}
-
-//redirect the user
-	require_once "resources/header.php";
-	echo "<meta http-equiv=\"refresh\" content=\"2;url=hunt_group_edit.php?id=".$hunt_group_uuid."\">\n";
-	echo "<div align='center'>\n";
-	echo $text['message-delete']."\n";
-	echo "</div>\n";
-	require_once "resources/footer.php";
-	return;
-
-?>

+ 0 - 374
hunt_groups/hunt_group_destination_edit.php

@@ -1,374 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('hunt_group_add') || permission_exists('hunt_group_edit')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//set the action as an add or an update
-	if (isset($_REQUEST["id"])) {
-		$action = "update";
-		$hunt_group_destination_uuid = check_str($_REQUEST["id"]);
-	}
-	else {
-		$action = "add";
-	}
-
-	if (isset($_REQUEST["id2"])) {
-		$hunt_group_uuid = check_str($_REQUEST["id2"]);
-	}
-
-//get the http values and set them as variables
-	if (count($_POST)>0) {
-		if (isset($_POST["hunt_group_uuid"])) {
-			$hunt_group_uuid = check_str($_POST["hunt_group_uuid"]);
-		}
-		$destination_data = check_str($_POST["destination_data"]);
-		$destination_type = check_str($_POST["destination_type"]);
-		$destination_timeout = check_str($_POST["destination_timeout"]);
-		$destination_order = check_str($_POST["destination_order"]);
-		$destination_enabled = check_str($_POST["destination_enabled"]);
-		$destination_description = check_str($_POST["destination_description"]);
-	}
-
-if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
-
-	$msg = '';
-	if ($action == "update") {
-		$hunt_group_destination_uuid = check_str($_POST["hunt_group_destination_uuid"]);
-	}
-
-	//check for all required data
-		if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid<br>\n"; }
-		if (strlen($destination_data) == 0) { $msg .= $text['message-required'].$text['label-destination']."<br>\n"; }
-		if (strlen($destination_type) == 0) { $msg .= $text['message-required'].$text['label-type']."<br>\n"; }
-		//if (strlen($destination_timeout) == 0) { $msg .= $text['message-required'].$text['label-timeout']."<br>\n"; }
-		//if (strlen($destination_order) == 0) { $msg .= $text['message-required'].$text['label-order']."<br>\n"; }
-		//if (strlen($destination_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."<br>\n"; }
-		//if (strlen($destination_description) == 0) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; }
-		if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
-			require_once "resources/header.php";
-			require_once "resources/persist_form_var.php";
-			echo "<div align='center'>\n";
-			echo "<table><tr><td>\n";
-			echo $msg."<br />";
-			echo "</td></tr></table>\n";
-			persistformvar($_POST);
-			echo "</div>\n";
-			require_once "resources/footer.php";
-			return;
-		}
-
-	//add or update the database
-		if ($_POST["persistformvar"] != "true") {
-			if ($action == "add" && permission_exists('hunt_group_add')) {
-				$hunt_group_destination_uuid = uuid();
-				$sql = "insert into v_hunt_group_destinations ";
-				$sql .= "(";
-				$sql .= "domain_uuid, ";
-				$sql .= "hunt_group_uuid, ";
-				$sql .= "hunt_group_destination_uuid, ";
-				$sql .= "destination_data, ";
-				$sql .= "destination_type, ";
-				$sql .= "destination_timeout, ";
-				$sql .= "destination_order, ";
-				$sql .= "destination_enabled, ";
-				$sql .= "destination_description ";
-				$sql .= ")";
-				$sql .= "values ";
-				$sql .= "(";
-				$sql .= "'$domain_uuid', ";
-				$sql .= "'$hunt_group_uuid', ";
-				$sql .= "'$hunt_group_destination_uuid', ";
-				$sql .= "'$destination_data', ";
-				$sql .= "'$destination_type', ";
-				$sql .= "'$destination_timeout', ";
-				$sql .= "'$destination_order', ";
-				$sql .= "'$destination_enabled', ";
-				$sql .= "'$destination_description' ";
-				$sql .= ")";
-				$db->exec(check_sql($sql));
-				unset($sql);
-
-				//synchronize the xml config
-				save_hunt_group_xml();
-
-				require_once "resources/header.php";
-				echo "<meta http-equiv=\"refresh\" content=\"2;url=hunt_group_edit.php?id=".$hunt_group_uuid."\">\n";
-				echo "<div align='center'>\n";
-				echo $text['message-add']."\n";
-				echo "</div>\n";
-				require_once "resources/footer.php";
-				return;
-			} //if ($action == "add")
-
-			if ($action == "update" && permission_exists('hunt_group_edit')) {
-				$sql = "update v_hunt_group_destinations set ";
-				$sql .= "domain_uuid = '$domain_uuid', ";
-				$sql .= "hunt_group_uuid = '$hunt_group_uuid', ";
-				$sql .= "destination_data = '$destination_data', ";
-				$sql .= "destination_type = '$destination_type', ";
-				$sql .= "destination_timeout = '$destination_timeout', ";
-				$sql .= "destination_order = '$destination_order', ";
-				$sql .= "destination_enabled = '$destination_enabled', ";
-				$sql .= "destination_description = '$destination_description' ";
-				$sql .= "where domain_uuid = '$domain_uuid' ";
-				$sql .= "and hunt_group_destination_uuid = '$hunt_group_destination_uuid'";
-				$db->exec(check_sql($sql));
-
-				//synchronize the xml config
-				save_hunt_group_xml();
-
-				require_once "resources/header.php";
-				echo "<meta http-equiv=\"refresh\" content=\"2;url=hunt_group_edit.php?id=".$hunt_group_uuid."\">\n";
-				echo "<div align='center'>\n";
-				echo $text['message-update']."\n";
-				echo "</div>\n";
-				require_once "resources/footer.php";
-				return;
-			} //if ($action == "update")
-		} //if ($_POST["persistformvar"] != "true")
-} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
-
-//pre-populate the form
-	if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
-		$hunt_group_destination_uuid = $_GET["id"];
-		$sql = "select * from v_hunt_group_destinations ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and hunt_group_destination_uuid = '$hunt_group_destination_uuid' ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-		foreach ($result as &$row) {
-			$hunt_group_uuid = $row["hunt_group_uuid"];
-			$destination_data = $row["destination_data"];
-			$destination_type = $row["destination_type"];
-			$destination_timeout = $row["destination_timeout"];
-			$destination_order = $row["destination_order"];
-			$destination_enabled = $row["destination_enabled"];
-			$destination_description = $row["destination_description"];
-			break; //limit to 1 row
-		}
-		unset ($prep_statement);
-	}
-
-//show the header
-	require_once "resources/header.php";
-	if ($action == "add") {
-		$page["title"] = $text['title-hunt_group_destination_add'];
-	}
-	if ($action == "update") {
-		$page["title"] = $text['title-hunt_group_destination_edit'];
-	}
-
-//show the content
-	echo "<div align='center'>";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
-
-	echo "<tr class='border'>\n";
-	echo "	<td align=\"left\">\n";
-	echo "      <br>";
-
-	echo "<form method='post' name='frm' action=''>\n";
-
-	echo "<div align='center'>\n";
-	echo "<table width='100%'  border='0' cellpadding='6' cellspacing='0'>\n";
-
-	echo "<tr>\n";
-	if ($action == "add") {
-		echo "<td align='left' width='30%' nowrap><b>".$text['header-hunt_group_destination_add']."</b></td>\n";
-	}
-	if ($action == "update") {
-		echo "<td align='left' width='30%' nowrap><b>".$text['header-hunt_group_destination_edit']."</b></td>\n";
-	}
-	echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='hunt_group_edit.php?id=".$hunt_group_uuid."'\" value='".$text['button-back']."'></td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    ".$text['label-destination'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='destination_data' maxlength='255' value=\"$destination_data\">\n";
-	echo "<br />\n";
-	echo "<b>".$text['description-destination_examples']."</b>...<br>\n";
-	echo $text['description-destination_example_extension'].": 1001<br />\n";
-	echo $text['description-destination_example_voicemail'].": 1001<br />\n";
-	echo $text['description-destination_example_sip_uri_voicemail'].": sofia/internal/*98@\${domain}<br />\n";
-	echo $text['description-destination_example_sip_uri_external_number'].": sofia/gateway/gatewayname/12081231234<br />\n";
-	echo $text['description-destination_example_sip_uri_auto_attendant'].": sofia/internal/5002@\${domain}<br />\n";
-	echo $text['description-destination_example_sip_uri_user'].": /user/1001@\${domain}\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    ".$text['label-type'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "                <select name='destination_type' class='formfld'>\n";
-	echo "                <option></option>\n";
-	if ($destination_type == "extension") {
-		echo "                <option selected='yes' value='extension'>".$text['option-extension']."</option>\n";
-	}
-	else {
-		echo "                <option value='extension'>".$text['option-extension']."</option>\n";
-	}
-	if ($destination_type == "voicemail") {
-		echo "                <option selected='yes' value='voicemail'>".$text['option-voicemail']."</option>\n";
-	}
-	else {
-		echo "                <option value='voicemail'>".$text['option-voicemail']."</option>\n";
-	}
-	if ($destination_type == "sip uri") {
-		echo "                <option selected='yes' value='sip uri'>".$text['option-sip_uri']."</option>\n";
-	}
-	else {
-		echo "                <option value='sip uri'>".$text['option-sip_uri']."</option>\n";
-	}
-	echo "                </select>\n";
-	echo "<br />\n";
-	echo "\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-	echo "    ".$text['label-timeout'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "              <select name='destination_timeout' class='formfld'>\n";
-	echo "              <option></option>\n";
-	if (strlen($destination_timeout)> 0) {
-		echo "              <option selected='yes' value='".htmlspecialchars($destination_timeout)."'>".htmlspecialchars($destination_timeout)."</option>\n";
-	}
-	$i=0;
-	while($i<=301) {
-		echo "              <option value='$i'>$i</option>\n";
-		$i++;
-	}
-	echo "              </select>\n";
-	echo "<br />\n";
-	echo $text['description-destination_timeout']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    ".$text['label-order'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "              <select name='destination_order' class='formfld'>\n";
-	if (strlen($destination_order)> 0) {
-		echo "              <option selected='yes' value='".htmlspecialchars($destination_order)."'>".htmlspecialchars($destination_order)."</option>\n";
-	}
-	$i=0;
-	while($i<=301) {
-		if (strlen($i) == 1) {
-			echo "              <option value='00$i'>00$i</option>\n";
-		}
-		if (strlen($i) == 2) {
-			echo "              <option value='0$i'>0$i</option>\n";
-		}
-		if (strlen($i) == 3) {
-			echo "              <option value='$i'>$i</option>\n";
-		}
-		$i++;
-	}
-	echo "              </select>\n";
-	echo "<br />\n";
-	echo $text['description-destination_order']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "    ".$text['label-enabled'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <select class='formfld' name='destination_enabled'>\n";
-	echo "    <option value=''></option>\n";
-	if ($destination_enabled == "true" || strlen($destination_enabled) == 0) {
-		echo "    <option value='true' selected >".$text['option-true']."</option>\n";
-	}
-	else {
-		echo "    <option value='true'>".$text['option-true']."</option>\n";
-	}
-	if ($destination_enabled == "false") {
-		echo "    <option value='false' selected >".$text['option-false']."</option>\n";
-	}
-	else {
-		echo "    <option value='false'>".$text['option-false']."</option>\n";
-	}
-	echo "    </select>\n";
-	echo "<br />\n";
-	echo "\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-	echo "    ".$text['label-description'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "    <input class='formfld' type='text' name='destination_description' maxlength='255' value=\"$destination_description\">\n";
-	echo "<br />\n";
-	echo $text['description-description']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "	<tr>\n";
-	echo "		<td colspan='2' align='right'>\n";
-	echo "				<input type='hidden' name='hunt_group_uuid' value='$hunt_group_uuid'>\n";
-	if ($action == "update") {
-		echo "				<input type='hidden' name='hunt_group_destination_uuid' value='$hunt_group_destination_uuid'>\n";
-	}
-	echo "				<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
-	echo "		</td>\n";
-	echo "	</tr>";
-	echo "</table>";
-	echo "</form>";
-
-	echo "	</td>";
-	echo "	</tr>";
-	echo "</table>";
-	echo "</div>";
-
-//show the footer
-	require_once "resources/footer.php";
-?>

+ 0 - 744
hunt_groups/hunt_group_edit.php

@@ -1,744 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-require_once "resources/paging.php";
-
-//check permissions
-	if (permission_exists('hunt_group_add') || permission_exists('hunt_group_edit')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//action add or update
-	if (isset($_REQUEST["id"])) {
-		$action = "update";
-		$hunt_group_uuid = check_str($_REQUEST["id"]);
-		$dialplan_uuid = check_str($_REQUEST["dialplan_uuid"]);
-	}
-	else {
-		$action = "add";
-	}
-
-//get the http values and set them as variables
-	if (count($_POST)>0) {
-		$hunt_group_extension = check_str($_POST["hunt_group_extension"]);
-		$hunt_group_name = check_str($_POST["hunt_group_name"]);
-		$hunt_group_type = check_str($_POST["hunt_group_type"]);
-		$hunt_group_timeout = check_str($_POST["hunt_group_timeout"]);
-		$hunt_group_timeout_destination = check_str($_POST["hunt_group_timeout_destination"]);
-		$hunt_group_timeout_type = check_str($_POST["hunt_group_timeout_type"]);
-		$hunt_group_ringback = check_str($_POST["hunt_group_ringback"]);
-		$hunt_group_cid_name_prefix = check_str($_POST["hunt_group_cid_name_prefix"]);
-		$hunt_group_pin = check_str($_POST["hunt_group_pin"]);
-		$hunt_group_caller_announce = check_str($_POST["hunt_group_caller_announce"]);
-
-		//prepare the user list for the database
-		$hunt_group_user_list = $_POST["hunt_group_user_list"];
-		if (strlen($hunt_group_user_list) > 0) {
-			$hunt_group_user_list_array = explode("\n", $hunt_group_user_list);
-			if (count($hunt_group_user_list_array) == 0) {
-				$hunt_group_user_list = '';
-			}
-			else {
-				$hunt_group_user_list = '|';
-				foreach($hunt_group_user_list_array as $user){
-					if(strlen(trim($user)) > 0) {
-						$hunt_group_user_list .= check_str(trim($user))."|";
-					}
-				}
-			}
-		}
-
-		$hunt_group_enabled = check_str($_POST["hunt_group_enabled"]);
-		$hunt_group_description = check_str($_POST["hunt_group_description"]);
-
-		//remove invalid characters
-		$hunt_group_cid_name_prefix = str_replace(":", "-", $hunt_group_cid_name_prefix);
-		$hunt_group_cid_name_prefix = str_replace("\"", "", $hunt_group_cid_name_prefix);
-		$hunt_group_cid_name_prefix = str_replace("@", "", $hunt_group_cid_name_prefix);
-		$hunt_group_cid_name_prefix = str_replace("\\", "", $hunt_group_cid_name_prefix);
-		$hunt_group_cid_name_prefix = str_replace("/", "", $hunt_group_cid_name_prefix);
-
-		//set default
-		if (strlen($hunt_group_caller_announce) == 0) { $hunt_group_caller_announce = "false"; }
-	}
-
-if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
-
-	$msg = '';
-	if ($action == "update") {
-		$hunt_group_uuid = check_str($_POST["hunt_group_uuid"]);
-	}
-
-	//check for all required data
-		if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid<br>\n"; }
-		if (strlen($hunt_group_extension) == 0) { $msg .= $text['message-required'].$text['label-extension']."<br>\n"; }
-		if (strlen($hunt_group_name) == 0) { $msg .= $text['message-required'].$text['label-name']."<br>\n"; }
-		if (strlen($hunt_group_type) == 0) { $msg .= $text['message-required'].$text['label-strategy']."<br>\n"; }
-		if (strlen($hunt_group_timeout) == 0) { $msg .= $text['message-required'].$text['label-timeout']."<br>\n"; }
-		if (strlen($hunt_group_timeout_destination) == 0) { $msg .= $text['message-required'].$text['label-timeout_destination']."<br>\n"; }
-		if (strlen($hunt_group_timeout_type) == 0) { $msg .= $text['message-required'].$text['label-timeout_type']."<br>\n"; }
-		//if (strlen($hunt_group_ringback) == 0) { $msg .= $text['message-required'].$text['label-ring_back']."<br>\n"; }
-		//if (strlen($hunt_group_cid_name_prefix) == 0) { $msg .= $text['message-required'].$text['label-caller_id_name_prefix']."<br>\n"; }
-		//if (strlen($hunt_group_pin) == 0) { $msg .= $text['message-required'].$text['label-pin_number']."<br>\n"; }
-		if (strlen($hunt_group_caller_announce) == 0) { $msg .= $text['message-required'].$text['label-caller_announce']."<br>\n"; }
-		//if (strlen($hunt_group_user_list) == 0) { $msg .= $text['message-required'].$text['label-user_list']."<br>\n"; }
-		//if (strlen($hunt_group_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."<br>\n"; }
-		//if (strlen($hunt_group_description) == 0) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; }
-		if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
-			require_once "resources/header.php";
-			require_once "resources/persist_form_var.php";
-			echo "<div align='center'>\n";
-			echo "<table><tr><td>\n";
-			echo $msg."<br />";
-			echo "</td></tr></table>\n";
-			persistformvar($_POST);
-			echo "</div>\n";
-			require_once "resources/footer.php";
-			return;
-		}
-
-	//add or update the database
-		if ($_POST["persistformvar"] != "true") {
-			if ($action == "add" && permission_exists('hunt_group_add')) {
-				//add to the table
-					$dialplan_uuid = uuid();
-					$hunt_group_uuid = uuid();
-					$sql = "insert into v_hunt_groups ";
-					$sql .= "(";
-					$sql .= "domain_uuid, ";
-					$sql .= "dialplan_uuid, ";
-					$sql .= "hunt_group_uuid, ";
-					$sql .= "hunt_group_extension, ";
-					$sql .= "hunt_group_name, ";
-					$sql .= "hunt_group_type, ";
-					$sql .= "hunt_group_context, ";
-					$sql .= "hunt_group_timeout, ";
-					$sql .= "hunt_group_timeout_destination, ";
-					$sql .= "hunt_group_timeout_type, ";
-					$sql .= "hunt_group_ringback, ";
-					$sql .= "hunt_group_cid_name_prefix, ";
-					$sql .= "hunt_group_pin, ";
-					$sql .= "hunt_group_caller_announce, ";
-					$sql .= "hunt_group_user_list, ";
-					$sql .= "hunt_group_enabled, ";
-					$sql .= "hunt_group_description ";
-					$sql .= ")";
-					$sql .= "values ";
-					$sql .= "(";
-					$sql .= "'$domain_uuid', ";
-					$sql .= "'$dialplan_uuid', ";
-					$sql .= "'$hunt_group_uuid', ";
-					$sql .= "'$hunt_group_extension', ";
-					$sql .= "'$hunt_group_name', ";
-					$sql .= "'$hunt_group_type', ";
-					$sql .= "'".$_SESSION['context']."', ";
-					$sql .= "'$hunt_group_timeout', ";
-					$sql .= "'$hunt_group_timeout_destination', ";
-					$sql .= "'$hunt_group_timeout_type', ";
-					$sql .= "'$hunt_group_ringback', ";
-					$sql .= "'$hunt_group_cid_name_prefix', ";
-					$sql .= "'$hunt_group_pin', ";
-					$sql .= "'$hunt_group_caller_announce', ";
-					$sql .= "'$hunt_group_user_list', ";
-					$sql .= "'$hunt_group_enabled', ";
-					$sql .= "'$hunt_group_description' ";
-					$sql .= ")";
-					$db->exec(check_sql($sql));
-					unset($sql);
-
-				//synchronize the xml config
-					save_hunt_group_xml();
-
-				//redirect the user
-					require_once "resources/header.php";
-					echo "<meta http-equiv=\"refresh\" content=\"2;url=hunt_groups.php\">\n";
-					echo "<div align='center'>\n";
-					echo $text['message-add']."\n";
-					echo "</div>\n";
-					require_once "resources/footer.php";
-					return;
-			} //if ($action == "add")
-
-			if ($action == "update" && permission_exists('hunt_group_edit')) {
-				//update the table
-					$sql = "update v_hunt_groups set ";
-					$sql .= "hunt_group_extension = '$hunt_group_extension', ";
-					$sql .= "hunt_group_name = '$hunt_group_name', ";
-					$sql .= "hunt_group_type = '$hunt_group_type', ";
-					$sql .= "hunt_group_context = '".$_SESSION['context']."', ";
-					$sql .= "hunt_group_timeout = '$hunt_group_timeout', ";
-					$sql .= "hunt_group_timeout_destination = '$hunt_group_timeout_destination', ";
-					$sql .= "hunt_group_timeout_type = '$hunt_group_timeout_type', ";
-					$sql .= "hunt_group_ringback = '$hunt_group_ringback', ";
-					$sql .= "hunt_group_cid_name_prefix = '$hunt_group_cid_name_prefix', ";
-					$sql .= "hunt_group_pin = '$hunt_group_pin', ";
-					$sql .= "hunt_group_caller_announce = '$hunt_group_caller_announce', ";
-					if (if_group("admin") || if_group("superadmin")) {
-						$sql .= "hunt_group_user_list = '$hunt_group_user_list', ";
-					}
-					$sql .= "hunt_group_enabled = '$hunt_group_enabled', ";
-					$sql .= "hunt_group_description = '$hunt_group_description' ";
-					$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-					$sql .= "and hunt_group_uuid = '$hunt_group_uuid'";
-					$db->exec(check_sql($sql));
-					unset($sql);
-
-				//update the dialplan entry
-					require_once "resources/classes/dialplan.php";
-					$dialplan = new dialplan;
-					$dialplan->domain_uuid = $_SESSION['domain_uuid'];
-					$dialplan->app_uuid = $app_uuid;
-					$dialplan->dialplan_uuid = $dialplan_uuid;
-					$dialplan->dialplan_name = $hunt_group_name;
-					//$dialplan->dialplan_continue = $dialplan_continue;
-					//$dialplan->dialplan_order = '330';
-					$dialplan->dialplan_context = $_SESSION['context'];
-					$dialplan->dialplan_enabled = $hunt_group_enabled;
-					$dialplan->dialplan_description = $hunt_group_description;
-					$dialplan->dialplan_update();
-					unset($dialplan);
-
-					//update the condition
-					$sql = "update v_dialplan_details set ";
-					$sql .= "dialplan_detail_data = '^".$hunt_group_extension."$' ";
-					$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-					$sql .= "and dialplan_detail_tag = 'condition' ";
-					$sql .= "and dialplan_detail_type = 'destination_number' ";
-					$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
-					$sql .= "and dialplan_detail_group = '1' ";
-					$db->query($sql);
-					unset($sql);
-
-					//update the action
-					$sql = "update v_dialplan_details set ";
-					$sql .= "dialplan_detail_data = 'v_huntgroup_".$_SESSION['domain_name']."_".$hunt_group_extension.".lua', ";
-					$sql .= "dialplan_detail_type = 'lua' ";
-					$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-					$sql .= "and dialplan_detail_tag = 'action' ";
-					$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
-					$sql .= "and dialplan_detail_type = 'lua' ";
-					$sql .= "and dialplan_detail_group = '1' ";
-					$db->query($sql);
-
-				//synchronize the xml config
-					save_hunt_group_xml();
-
-				//delete the dialplan context from memcache
-					$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
-					if ($fp) {
-						$switch_cmd = "memcache delete dialplan:".$_SESSION["context"]."@".$_SESSION['domain_name'];
-						$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
-					}
-
-				//rediret the user
-					require_once "resources/header.php";
-					echo "<meta http-equiv=\"refresh\" content=\"2;url=hunt_groups.php\">\n";
-					echo "<div align='center'>\n";
-					echo $text['message-update']."\n";
-					echo "</div>\n";
-					require_once "resources/footer.php";
-					return;
-			} //if ($action == "update")
-		} //if ($_POST["persistformvar"] != "true")
-} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
-
-//pre-populate the form
-	if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
-		$hunt_group_uuid = $_GET["id"];
-		$sql = "select * from v_hunt_groups ";
-		$sql .= "where hunt_group_uuid = '$hunt_group_uuid' ";
-		$sql .= "and domain_uuid = '$domain_uuid' ";
-		$sql .- "hunt_group_enabled = 'true' ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-		foreach ($result as &$row) {
-			$dialplan_uuid = $row["dialplan_uuid"];
-			$hunt_group_extension = $row["hunt_group_extension"];
-			$hunt_group_name = $row["hunt_group_name"];
-			$hunt_group_type = $row["hunt_group_type"];
-			$hunt_group_timeout = $row["hunt_group_timeout"];
-			$hunt_group_timeout_destination = $row["hunt_group_timeout_destination"];
-			$hunt_group_timeout_type = $row["hunt_group_timeout_type"];
-			$hunt_group_ringback = $row["hunt_group_ringback"];
-			$hunt_group_cid_name_prefix = $row["hunt_group_cid_name_prefix"];
-			$hunt_group_pin = $row["hunt_group_pin"];
-			$hunt_group_caller_announce = $row["hunt_group_caller_announce"];
-			$hunt_group_user_list = $row["hunt_group_user_list"];
-			$hunt_group_enabled = $row["hunt_group_enabled"];
-			$hunt_group_description = $row["hunt_group_description"];
-			break; //limit to 1 row
-		}
-		unset ($prep_statement);
-	}
-
-//show the header
-	require_once "resources/header.php";
-	$page["title"] = $text['title-hunt_group'];
-
-
-//show the content
-	echo "<div align='center'>";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
-	echo "<tr class='border'>\n";
-	echo "<td align=\"left\">\n";
-	echo "<br>";
-
-	echo "<form method='post' name='frm' action=''>\n";
-	echo "<div align='center'>\n";
-	echo "<table width='100%'  border='0' cellpadding='6' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "<td align='left' colspan='2'>\n";
-
-	echo "<table width='100%'>\n";
-	echo "<tr>\n";
-	echo "<td align='left' width='30%' nowrap>\n";
-	echo "	<span class='vexpl'>\n";
-	echo "		<strong>".$text['header-hunt_group']."</strong><br>\n";
-	echo "	</span>\n";
-	echo "</td>\n";
-	echo "<td width='70%' align='right'>\n";
-	if ($action != "add") {
-		echo "	<input type='button' class='btn' name='' alt='".$text['button-copy']."' onclick=\"var new_ext = prompt('".$text['message_extension']."'); if (new_ext != null) { window.location='hunt_group_copy.php?id=".$hunt_group_uuid."&ext=' + new_ext; }\" value='".$text['button-copy']."'>\n";
-	}
-	echo "	<input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='hunt_groups.php'\" value='".$text['button-back']."'>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td align='left' colspan='2'>\n";
-	echo "		  ".$text['description-hunt_group']."\n";
-	echo "		  </span><br />\n";
-	echo "<br />\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-	echo "</table>\n";
-
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	 ".$text['label-name'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	 <input class='formfld' type='text' name='hunt_group_name' maxlength='255' value=\"$hunt_group_name\">\n";
-	echo "<br />\n";
-	echo $text['description-name']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	 ".$text['label-extension'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	 <input class='formfld' type='text' name='hunt_group_extension' maxlength='255' value=\"$hunt_group_extension\">\n";
-	echo "<br />\n";
-	echo $text['description-extension']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	 ".$text['label-strategy'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	 <select class='formfld' name='hunt_group_type'>\n";
-	echo "	 <option value=''></option>\n";
-	if ($hunt_group_type == "simultaneous") {
-		echo "	 <option value='simultaneous' selected='selected'>".$text['option-simultaneous']."</option>\n";
-	}
-	else {
-		echo "	 <option value='simultaneous'>".$text['option-simultaneous']."</option>\n";
-	}
-	if ($hunt_group_type == "sequentially") {
-		echo "	 <option value='sequentially' selected='selected'>".$text['option-sequential']."</option>\n";
-	}
-	else {
-		echo "	 <option value='sequentially'>".$text['option-sequential']."</option>\n";
-	}
-	echo "	 </select>\n";
-	echo "<br />\n";
-	echo "\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	 ".$text['label-timeout'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	 <input class='formfld' type='text' name='hunt_group_timeout' maxlength='255' value=\"$hunt_group_timeout\">\n";
-	echo "<br />\n";
-	echo $text['description-timeout']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	 ".$text['label-timeout_destination'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	 <input class='formfld' type='text' name='hunt_group_timeout_destination' maxlength='255' value=\"$hunt_group_timeout_destination\">\n";
-	echo "<br />\n";
-	echo $text['description-timeout_destination']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	 ".$text['label-timeout_type'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	 <select class='formfld' name='hunt_group_timeout_type'>\n";
-	echo "	 <option value=''></option>\n";
-	if ($hunt_group_timeout_type == "extension") {
-		echo "	 <option value='extension' SELECTED >".$text['option-extension']."</option>\n";
-	}
-	else {
-		echo "	 <option value='extension'>".$text['option-extension']."</option>\n";
-	}
-	if ($hunt_group_timeout_type == "voicemail") {
-		echo "	 <option value='voicemail' SELECTED >".$text['option-voicemail']."</option>\n";
-	}
-	else {
-		echo "	 <option value='voicemail'>".$text['option-voicemail']."</option>\n";
-	}
-	if ($hunt_group_timeout_type == "sip uri") {
-		echo "	 <option value='sip uri' SELECTED >".$text['option-sip_uri']."</option>\n";
-	}
-	else {
-		echo "	 <option value='sip uri'>".$text['option-sip_uri']."</option>\n";
-	}
-	echo "	 </select>\n";
-	echo "<br />\n";
-	echo $text['description-timeout_type']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	 ".$text['label-ring_back'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-
-	$select_options = "";
-	if ($hunt_group_ringback == "\${us-ring}" || $hunt_group_ringback == "us-ring") {
-		$select_options .= "		<option value='\${us-ring}' selected='selected'>us-ring</option>\n";
-	}
-	else {
-		$select_options .= "		<option value='\${us-ring}'>us-ring</option>\n";
-	}
-	if ($hunt_group_ringback == "\${fr-ring}" || $hunt_group_ringback == "fr-ring") {
-		$select_options .= "		<option value='\${fr-ring}' selected='selected'>fr-ring</option>\n";
-	}
-	else {
-		$select_options .= "		<option value='\${fr-ring}'>fr-ring</option>\n";
-	}
-	if ($hunt_group_ringback == "\${uk-ring}" || $hunt_group_ringback == "uk-ring") {
-		$select_options .= "		<option value='\${uk-ring}' selected='selected'>uk-ring</option>\n";
-	}
-	else {
-		$select_options .= "		<option value='\${uk-ring}'>uk-ring</option>\n";
-	}
-	if ($hunt_group_ringback == "\${rs-ring}" || $hunt_group_ringback == "rs-ring") {
-		$select_options .= "		<option value='\${rs-ring}' selected='selected'>rs-ring</option>\n";
-	}
-	else {
-		$select_options .= "		<option value='\${rs-ring}'>rs-ring</option>\n";
-	}
-	if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/music_on_hold')) {
-		require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php";
-		$moh = new switch_music_on_hold;
-		$moh->select_name = "hunt_group_ringback";
-		$moh->select_value = $hunt_group_ringback;
-		$moh->select_options = $select_options;
-		echo $moh->select();
-	}
-	else {
-		echo "	<select class='formfld' name='hunt_group_ringback'>\n";
-		//echo "	<option value=''></option>\n";
-		echo $select_options;
-		echo "	</select>\n";
-	}
-	echo "<br />\n";
-	echo $text['description-ring_back']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-	echo "	 ".$text['label-caller_id_name_prefix'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	 <input class='formfld' type='text' name='hunt_group_cid_name_prefix' maxlength='255' value=\"$hunt_group_cid_name_prefix\">\n";
-	echo "<br />\n";
-	echo $text['description-caller_id_name_prefix']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-	echo "	 ".$text['label-pin_number'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	 <input class='formfld' type='text' name='hunt_group_pin' maxlength='255' value=\"$hunt_group_pin\">\n";
-	echo "<br />\n";
-	echo $text['description-pin_number']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	if (!$fp) {
-		$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
-	}
-	if (switch_module_is_running($fp, 'mod_spidermonkey')) {
-		echo "<tr>\n";
-		echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-		echo "	 ".$text['label-caller_announce'].":\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		echo "	 <select class='formfld' name='hunt_group_caller_announce'>\n";
-		echo "	 <option value=''></option>\n";
-		if ($hunt_group_caller_announce == "true") {
-			echo "	 <option value='true' selected='selected'>".$text['option-true']."</option>\n";
-		}
-		else {
-			echo "	 <option value='true'>".$text['option-true']."</option>\n";
-		}
-		if ($hunt_group_caller_announce == "false") {
-			echo "	 <option value='false' selected='selected'>".$text['option-false']."</option>\n";
-		}
-		else {
-			echo "	 <option value='false'>".$text['option-false']."</option>\n";
-		}
-		echo "	 </select>\n";
-		echo "<br />\n";
-		echo "\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-	}
-
-	if (if_group("admin") || if_group("superadmin")) {
-		echo "<tr>\n";
-		echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-		echo "		".$text['label-user_list'].":\n";
-		echo "</td>\n";
-		echo "<td class='vtable' align='left'>\n";
-		$onchange = "document.getElementById('hunt_group_user_list').value += document.getElementById('username').value + '\\n';";
-		$table_name = 'v_users'; $field_name = 'username'; $field_current_value = ''; $sql_where_optional = "where domain_uuid = '$domain_uuid' and user_enabled = 'true' ";
-		echo html_select_on_change($db, $table_name, $field_name, $sql_where_optional, $field_current_value, $onchange);
-		echo "<br />\n";
-		echo $text['description-user_list_select']."\n";
-		echo "<br />\n";
-		echo "<br />\n";
-		//replace the vertical bar with a line feed to display in the textarea
-		$hunt_group_user_list = trim($hunt_group_user_list, "|");
-		$hunt_group_user_list_array = explode("|", $hunt_group_user_list);
-		$hunt_group_user_list = '';
-		foreach($hunt_group_user_list_array as $user){
-			$hunt_group_user_list .= trim($user)."\n";
-		}
-		echo "		<textarea name=\"hunt_group_user_list\" id=\"hunt_group_user_list\" class=\"formfld\" cols=\"30\" rows=\"3\" wrap=\"off\">$hunt_group_user_list</textarea>\n";
-		echo "		<br>\n";
-		echo $text['description-user_list_textarea']."\n";
-		echo "<br />\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-	}
-
-	echo "<tr>\n";
-	echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
-	echo "	 ".$text['label-enabled'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	 <select class='formfld' name='hunt_group_enabled'>\n";
-	echo "	 <option value=''></option>\n";
-	if ($hunt_group_enabled == "true" || strlen($hunt_group_enabled) == 0) {
-		echo "	 <option value='true' selected >".$text['option-true']."</option>\n";
-	}
-	else {
-		echo "	 <option value='true'>".$text['option-true']."</option>\n";
-	}
-	if ($hunt_group_enabled == "false") {
-		echo "	 <option value='false' selected >".$text['option-false']."</option>\n";
-	}
-	else {
-		echo "	 <option value='false'>".$text['option-false']."</option>\n";
-	}
-	echo "	 </select>\n";
-	echo "<br />\n";
-	echo $text['description-enabled']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap>\n";
-	echo "	 ".$text['label-description'].":\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	 <input class='formfld' type='text' name='hunt_group_description' maxlength='255' value=\"$hunt_group_description\">\n";
-	echo "<br />\n";
-	echo $text['description-description']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-	echo "	<tr>\n";
-	echo "		<td colspan='2' align='right'>\n";
-	if ($action == "update") {
-		echo "				<input type='hidden' name='dialplan_uuid' value='$dialplan_uuid'>\n";
-		echo "				<input type='hidden' name='hunt_group_uuid' value='$hunt_group_uuid'>\n";
-	}
-	echo "				<input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
-	echo "		</td>\n";
-	echo "	</tr>";
-	echo "</table>";
-	echo "</form>";
-
-	echo "	</td>";
-	echo "	</tr>";
-	echo "</table>";
-	echo "</div>";
-
-//list hunt group destinations
-	if ($action == "update") {
-
-		echo "<div align='center'>";
-		echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
-
-		echo "<tr class='border'>\n";
-		echo "	<td align=\"center\">\n";
-		echo "		<br>";
-
-		echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
-		echo "	<tr>\n";
-		echo "	<td align='left'><p><span class='vexpl'>\n";
-		echo "		<span class='red'><strong>".$text['header-hunt_group_destinations']."</strong></span><br>\n";
-		echo "			".$text['description-hunt_group_destinations']."\n";
-		echo "		</span></p></td>\n";
-		echo "	</tr>\n";
-		echo "</table>\n";
-		echo "<br />\n";
-
-		$sql = " select * from v_hunt_group_destinations ";
-		$sql .= " where domain_uuid = '$domain_uuid' ";
-		$sql .= " and hunt_group_uuid = '$hunt_group_uuid' ";
-		$sql .= " order by destination_order, destination_data asc";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-		$result_count = count($result);
-		unset ($prep_statement, $sql);
-
-
-		$c = 0;
-		$row_style["0"] = "row_style0";
-		$row_style["1"] = "row_style1";
-
-		echo "<div align='center'>\n";
-		echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-
-		echo "<tr>\n";
-		echo "<th align='center'>".$text['label-destination']."</th>\n";
-		echo "<th align='center'>".$text['label-type']."</th>\n";
-		echo "<th align='center'>".$text['label-profile']."</th>\n";
-		echo "<th align='center'>".$text['label-order']."</th>\n";
-		echo "<th align='center'>".$text['label-description']."</th>\n";
-		echo "<td align='right' width='42'>\n";
-		if (permission_exists('hunt_group_add')) {
-			echo "	<a href='hunt_group_destination_edit.php?id2=".$hunt_group_uuid."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
-		}
-		echo "</td>\n";
-		echo "<tr>\n";
-
-		if ($result_count > 0) {
-			foreach($result as $row) {
-				echo "<tr >\n";
-				echo "	<td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row['destination_data']."</td>\n";
-				echo "	<td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;";
-				switch($row['destination_type']) {
-					case "extension" : echo $text['option-extension']; break;
-					case "voicemail" : echo $text['option-voicemail']; break;
-					case "sip uri" : echo $text['option-sip_uri']; break;
-				}
-				echo "</td>\n";
-				echo "	<td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row['destination_profile']."</td>\n";
-				echo "	<td valign='top' class='".$row_style[$c]."'>&nbsp;&nbsp;".$row['destination_order']."</td>\n";
-				echo "	<td valign='top' class='row_stylebg' width='30%'>".$row['destination_description']."&nbsp;</td>\n";
-				echo "	<td valign='top' align='right'>\n";
-				if (permission_exists('hunt_group_edit')) {
-					echo "		<a href='hunt_group_destination_edit.php?id=".$row['hunt_group_destination_uuid']."&id2=".$hunt_group_uuid."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
-				}
-				if (permission_exists('hunt_group_delete')) {
-					echo "		<a href='hunt_group_destination_delete.php?id=".$row['hunt_group_destination_uuid']."&id2=".$hunt_group_uuid."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
-				}
-				echo "	</td>\n";
-				echo "</tr>\n";
-				if ($c==0) { $c=1; } else { $c=0; }
-			} //end foreach
-			unset($sql, $result, $row_count);
-		} //end if results
-
-		echo "<tr>\n";
-		echo "<td colspan='6'>\n";
-		echo "	<table width='100%' cellpadding='0' cellspacing='0'>\n";
-		echo "	<tr>\n";
-		echo "		<td width='33.3%' nowrap>&nbsp;</td>\n";
-		echo "		<td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
-		echo "		<td width='33.3%' align='right'>\n";
-		if (permission_exists('hunt_group_add')) {
-			echo "			<a href='hunt_group_destination_edit.php?id2=".$hunt_group_uuid."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
-		}
-		echo "		</td>\n";
-		echo "	</tr>\n";
-		echo "	</table>\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-
-		echo "</table>";
-		echo "</div>";
-		echo "<br><br>";
-		echo "<br><br>";
-
-		echo "</td>";
-		echo "</tr>";
-		echo "</table>";
-		echo "</div>";
-		echo "<br><br>";
-	} //end if update
-
-//show the footer
-	require_once "resources/footer.php";
-?>

+ 0 - 193
hunt_groups/hunt_groups.php

@@ -1,193 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('hunt_group_view')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-require_once "resources/header.php";
-$page["title"] = $text['title-hunt_groups'];
-
-require_once "resources/paging.php";
-
-$order_by = $_GET["order_by"];
-$order = $_GET["order"];
-
-echo "<div align='center'>";
-echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-echo "<tr class='border'>\n";
-echo "	<td align=\"center\">\n";
-echo "      <br />";
-
-echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-echo "<tr>\n";
-echo "    <td align='left'><p><span class='vexpl'><span class='red'><strong>".$text['header-hunt_groups']."<br />\n";
-echo "        </strong></span>".$text['description-hunt_groups']."</span></p></td>\n";
-echo "</tr>\n";
-echo "</table>\n";
-echo "<br />\n";
-
-//get the number of rows in v_hunt_groups
-$sql = "select count(*) as num_rows from v_hunt_groups ";
-$sql .= "where domain_uuid = '$domain_uuid' ";
-$prep_statement = $db->prepare(check_sql($sql));
-if ($prep_statement) {
-	$prep_statement->execute();
-	$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-	if ($row['num_rows'] > 0) {
-		$num_rows = $row['num_rows'];
-	}
-	else {
-		$num_rows = '0';
-	}
-}
-unset($prep_statement, $result);
-
-//prepare to page the results
-$rows_per_page = 150;
-$param = "";
-$page = $_GET['page'];
-if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
-list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
-$offset = $rows_per_page * $page;
-
-//get the hunt group list
-$sql = "select * from v_hunt_groups ";
-$sql .= "where domain_uuid = '$domain_uuid' ";
-if (strlen($order_by)> 0) {
-	$sql .= "order by $order_by $order ";
-}
-else {
-	$sql .= "order by hunt_group_extension asc ";
-}
-$sql .= " limit $rows_per_page offset $offset ";
-$prep_statement = $db->prepare(check_sql($sql));
-$prep_statement->execute();
-$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-$result_count = count($result);
-unset ($prep_statement, $sql);
-
-$c = 0;
-$row_style["0"] = "row_style0";
-$row_style["1"] = "row_style1";
-
-echo "<div align='center'>\n";
-echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-echo "<tr>\n";
-echo th_order_by('hunt_group_extension', $text['label-extension'], $order_by, $order);
-echo th_order_by('hunt_group_name', $text['label-name'], $order_by, $order);
-echo th_order_by('hunt_group_name', $text['label-enabled'], $order_by, $order);
-echo th_order_by('hunt_group_description', $text['label-description'], $order_by, $order);
-echo "<td align='right' width='42'>\n";
-if (permission_exists('hunt_group_add')) {
-	echo "	<a href='hunt_group_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
-}
-echo "</td>\n";
-echo "<tr>\n";
-
-if ($result_count > 0) {
-	foreach($result as $row) {
-		echo "<tr >\n";
-		echo "   <td valign='top' class='".$row_style[$c]."'>".$row['hunt_group_extension']."</td>\n";
-		echo "   <td valign='top' class='".$row_style[$c]."'>".$row['hunt_group_name']."</td>\n";
-		echo "   <td valign='top' class='".$row_style[$c]."'>";
-		if ($row['hunt_group_enabled'] == "true") {
-			echo $text['option-true'];
-		}
-		else if ($row['hunt_group_enabled'] == "false") {
-			echo $text['option-false'];
-		}
-		echo "</td>\n";
-		echo "   <td valign='top' class='row_stylebg' width='40%'>".$row['hunt_group_description']."&nbsp;</td>\n";
-		echo "   <td valign='top' align='right'>\n";
-		if (permission_exists('hunt_group_edit')) {
-			echo "		<a href='hunt_group_edit.php?id=".$row['hunt_group_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
-		}
-		if (permission_exists('hunt_group_delete')) {
-			echo "		<a href='hunt_group_delete.php?id=".$row['hunt_group_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
-		}
-		echo "   </td>\n";
-		echo "</tr>\n";
-		if ($c==0) { $c=1; } else { $c=0; }
-	} //end foreach
-	unset($sql, $result, $row_count);
-} //end if results
-
-echo "<tr>\n";
-echo "<td colspan='5'>\n";
-echo "	<table width='100%' cellpadding='0' cellspacing='0'>\n";
-echo "	<tr>\n";
-echo "		<td width='33.3%' nowrap>&nbsp;</td>\n";
-echo "		<td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
-echo "		<td width='33.3%' align='right'>\n";
-if (permission_exists('hunt_group_add')) {
-	echo "			<a href='hunt_group_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
-}
-echo "		</td>\n";
-echo "	</tr>\n";
-echo "	</table>\n";
-echo "</td>\n";
-echo "</tr>\n";
-
-if ($v_path_show) {
-	echo "<tr>\n";
-	echo "<td align='left' colspan='4'>\n";
-	echo "<br />\n";
-	echo $_SESSION['switch']['scripts']['dir']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-}
-
-echo "</table>";
-echo "</div>";
-echo "<br><br>";
-echo "<br><br>";
-
-echo "</td>";
-echo "</tr>";
-echo "</table>";
-echo "</div>";
-echo "<br><br>";
-
-require_once "resources/footer.php";
-unset ($result_count);
-unset ($result);
-unset ($key);
-unset ($val);
-unset ($c);
-?>

+ 0 - 643
hunt_groups/resources/functions/save_hunt_group.php

@@ -1,643 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-
-function save_hunt_group() {
-
-	//Hunt Group Lua Notes:
-		//get the domain
-		//loop through all Hunt Groups
-			//get the Hunt Group information such as the name and description
-			//add each Hunt Group to the dialplan
-			//get the list of destinations then build the Hunt Group lua
-
-	//get the domain
-		global $db, $domain_uuid, $host, $config;
-
-		$tmp = "";
-		$tmp .= "\n";
-		$tmp .= " domain_name = \"".$domain."\"; //by default this is the ipv4 address of FreeSWITCH used for transfer to voicemail\n";
-		$tmp .= "\n";
-		$tmp .= "\n";
-
-	//prepare for hunt group .lua files to be written. delete all hunt groups that are prefixed with huntgroup_ and have a file extension of .lua
-		$v_prefix = 'v_huntgroup_';
-		if($dh = opendir($_SESSION['switch']['scripts']['dir'])) {
-			$files = Array();
-			while($file = readdir($dh)) {
-				if($file != "." && $file != ".." && $file[0] != '.') {
-					if(is_dir($dir . "/" . $file)) {
-						//this is a directory
-					} else {
-						if (substr($file,0, strlen($v_prefix)) == $v_prefix && substr($file,-4) == '.lua') {
-							if ($file != "huntgroup_originate.lua") {
-								unlink($_SESSION['switch']['scripts']['dir'].'/'.$file);
-							}
-						}
-					}
-				}
-			}
-			closedir($dh);
-		}
-
-	//loop through all Hunt Groups
-		$x = 0;
-
-		$sql = "select * from v_hunt_groups ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
-		foreach ($result as &$row) {
-				//get the Hunt Group information such as the name and description
-					//$row['hunt_group_uuid']
-					//$row['hunt_group_extension']
-					//$row['hunt_group_name']
-					//$row['hunt_group_type']
-					//$row['hunt_group_timeout']
-					//$row['hunt_group_context']
-					//$row['hunt_group_ringback']
-					//$row['hunt_group_cid_name_prefix']
-					//$row['hunt_group_pin']
-					//$row['hunt_group_caller_announce']
-					//$row['hunt_group_enabled']
-					//$row['hunt_group_description']
-					$domain_uuid = $row['domain_uuid'];
-					$dialplan_uuid = $row['dialplan_uuid'];
-
-				//add each hunt group to the dialplan
-					if (strlen($row['hunt_group_uuid']) > 0) {
-						//set default action to add
-							$action = 'add';
-						//check whether the dialplan entry exists in the database
-							$action = 'add'; //set default action to add
-							$i = 0;
-							$sql = "select count(*) as num_rows from v_dialplans ";
-							$sql .= "where domain_uuid = '".$domain_uuid."' ";
-							$sql .= "and dialplan_uuid = '".$dialplan_uuid."' ";
-							$prep_statement_2 = $db->prepare(check_sql($sql));
-							if ($prep_statement_2) {
-								$prep_statement_2->execute();
-								$row2 = $prep_statement_2->fetch(PDO::FETCH_ASSOC);
-								if ($row2['num_rows'] > 0) {
-									//$num_rows = $row2['num_rows'];
-									$action = 'update';
-								}
-							}
-							unset($prep_statement, $result);
-
-						if ($action == 'add') {
-							//create dialplan entry for each huntgroup
-								$app_uuid = '0610f841-2e27-4c5f-7926-08ab3aad02e0';
-								if ($row['hunt_group_enabled'] == "false") {
-									$dialplan_enabled = 'false';
-								}
-								else {
-									$dialplan_enabled = 'true';
-								}
-								if (strlen($dialplan_uuid) == 0) {
-									//create a dialplan uuid
-										$dialplan_uuid = uuid();
-									//update the hunt groups table with the database
-										$sql = "update v_hunt_groups ";
-										$sql .= "set dialplan_uuid = '".$dialplan_uuid."' ";
-										$sql .= "where domain_uuid = '".$domain_uuid."' ";
-										$sql .= "and hunt_group_uuid = '".$row['hunt_group_uuid']."' ";
-										$db->query($sql);
-										unset($sql);
-								}
-
-								require_once "resources/classes/dialplan.php";
-								$dialplan = new dialplan;
-								$dialplan->domain_uuid = $domain_uuid;
-								$dialplan->app_uuid = $app_uuid;
-								$dialplan->dialplan_uuid = $dialplan_uuid;
-								$dialplan->dialplan_name = $row['hunt_group_name'];
-								//$dialplan->dialplan_continue = $dialplan_continue;
-								$dialplan->dialplan_order = '330';
-								$dialplan->dialplan_context = $_SESSION['context'];
-								$dialplan->dialplan_enabled = $dialplan_enabled;
-								$dialplan->dialplan_description = $row['hunt_group_description'];
-								$dialplan->dialplan_add();
-								unset($dialplan);
-						}
-
-						if ($action == 'update') {
-							//update the huntgroup fifo
-								$dialplan_name = $row['hunt_group_name'];
-								$dialplan_order = '330';
-								$context = $row['hunt_group_context'];
-								if ($row['hunt_group_enabled'] == "false") {
-									$enabled = 'false';
-								}
-								else {
-									$enabled = 'true';
-								}
-								$description = $row['hunt_group_description'];
-								$hunt_group_uuid = $row['hunt_group_uuid'];
-
-								$sql = "update v_dialplans set ";
-								$sql .= "dialplan_name = '$dialplan_name', ";
-								$sql .= "dialplan_order = '$dialplan_order', ";
-								$sql .= "dialplan_context = '$context', ";
-								$sql .= "dialplan_enabled = '$enabled', ";
-								$sql .= "dialplan_description = '$description' ";
-								$sql .= "where domain_uuid = '".$domain_uuid."' ";
-								$sql .= "and dialplan_uuid = '".$dialplan_uuid."' ";
-								$db->query($sql);
-								unset($sql);
-
-								$sql = "delete from v_dialplan_details ";
-								$sql .= "where domain_uuid = '$domain_uuid' ";
-								$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
-								$db->query($sql);
-								unset($sql);
-						}
-
-						//if action is add or update
-							if ($action == 'add' || $action == 'update') {
-								require_once "resources/classes/dialplan.php";
-								$dialplan = new dialplan;
-								$dialplan->domain_uuid = $domain_uuid;
-								$dialplan->dialplan_uuid = $dialplan_uuid;
-								$dialplan->dialplan_detail_tag = 'condition'; //condition, action, antiaction
-								$dialplan->dialplan_detail_type = 'destination_number';
-								$dialplan->dialplan_detail_data = '^'.$row['hunt_group_extension'].'$';
-								//$dialplan->dialplan_detail_break = '';
-								//$dialplan->dialplan_detail_inline = '';
-								$dialplan->dialplan_detail_group = '1';
-								$dialplan->dialplan_detail_order = '010';
-								$dialplan->dialplan_detail_add();
-								unset($dialplan);
-
-								$dialplan = new dialplan;
-								$dialplan->domain_uuid = $domain_uuid;
-								$dialplan->dialplan_uuid = $dialplan_uuid;
-								$dialplan->dialplan_detail_tag = 'action'; //condition, action, antiaction
-								$dialplan->dialplan_detail_type = 'lua';
-								$dialplan->dialplan_detail_data = 'v_huntgroup_'.$_SESSION['domains'][$domain_uuid]['domain_name'].'_'.$row['hunt_group_extension'].'.lua';
-								//$dialplan->dialplan_detail_break = '';
-								//$dialplan->dialplan_detail_inline = '';
-								$dialplan->dialplan_detail_group = '1';
-								$dialplan->dialplan_detail_order = '020';
-								$dialplan->dialplan_detail_add();
-								unset($dialplan);
-
-								$dialplan = new dialplan;
-								$dialplan->domain_uuid = $domain_uuid;
-								$dialplan->dialplan_uuid = $dialplan_uuid;
-								$dialplan->dialplan_detail_tag = 'condition'; //condition, action, antiaction
-								$dialplan->dialplan_detail_type = 'destination_number';
-								$dialplan->dialplan_detail_data = '^\*'.$row['hunt_group_extension'].'$';
-								$dialplan->dialplan_detail_break = 'on-true';
-								//$dialplan->dialplan_detail_inline = '';
-								$dialplan->dialplan_detail_group = '2';
-								$dialplan->dialplan_detail_order = '020';
-								$dialplan->dialplan_detail_add();
-								unset($dialplan);
-
-								$dialplan = new dialplan;
-								$dialplan->domain_uuid = $domain_uuid;
-								$dialplan->dialplan_uuid = $dialplan_uuid;
-								$dialplan->dialplan_detail_tag = 'action'; //condition, action, antiaction
-								$dialplan->dialplan_detail_type = 'set';
-								$dialplan->dialplan_detail_data = 'fifo_music=$${hold_music}';
-								//$dialplan->dialplan_detail_break = '';
-								//$dialplan->dialplan_detail_inline = '';
-								$dialplan->dialplan_detail_group = '2';
-								$dialplan->dialplan_detail_order = '020';
-								$dialplan->dialplan_detail_add();
-								unset($dialplan);
-
-								$hunt_group_timeout_type = $row['hunt_group_timeout_type'];
-								$hunt_group_timeout_destination = $row['hunt_group_timeout_destination'];
-								if ($hunt_group_timeout_type == "voicemail") { $hunt_group_timeout_destination = '*99'.$hunt_group_timeout_destination; }
-								$dialplan = new dialplan;
-								$dialplan->domain_uuid = $domain_uuid;
-								$dialplan->dialplan_uuid = $dialplan_uuid;
-								$dialplan->dialplan_detail_tag = 'action'; //condition, action, antiaction
-								$dialplan->dialplan_detail_type = 'set';
-								$dialplan->dialplan_detail_data = 'fifo_orbit_exten='.$hunt_group_timeout_destination.':'.$row['hunt_group_timeout'];
-								//$dialplan->dialplan_detail_break = '';
-								//$dialplan->dialplan_detail_inline = '';
-								$dialplan->dialplan_detail_group = '2';
-								$dialplan->dialplan_detail_order = '030';
-								$dialplan->dialplan_detail_add();
-								unset($dialplan);
-
-								$dialplan = new dialplan;
-								$dialplan->domain_uuid = $domain_uuid;
-								$dialplan->dialplan_uuid = $dialplan_uuid;
-								$dialplan->dialplan_detail_tag = 'action'; //condition, action, antiaction
-								$dialplan->dialplan_detail_type = 'fifo';
-								$dialplan->dialplan_detail_data = $row['hunt_group_extension'].'@${domain_name} in';
-								//$dialplan->dialplan_detail_break = '';
-								//$dialplan->dialplan_detail_inline = '';
-								$dialplan->dialplan_detail_group = '2';
-								$dialplan->dialplan_detail_order = '040';
-								$dialplan->dialplan_detail_add();
-								unset($dialplan);
-							}
-
-					} //end if strlen hunt_group_uuid; add the Hunt Group to the dialplan
-
-				//get the list of destinations then build the Hunt Group Lua
-					$tmp = "\n";
-					$tmp .= "session:preAnswer();\n";
-					$tmp .= "extension = '".$row['hunt_group_extension']."';\n";
-					$tmp .= "result = '';\n";
-					$tmp .= "timeoutpin = 7500;\n";
-					$tmp .= "sip_profile = 'internal';\n";
-					$tmp .= "\n";
-
-					$tmp .=	"function extension_registered(domain_name, sip_profile, extension)\n";
-					$tmp .=	"	api = freeswitch.API();\n";
-					$tmp .=	"	result = api:execute(\"sofia_contact\", sip_profile..\"/\"..extension..\"@\"..domain_name);\n";
-					$tmp .=	"	if (result == \"error/user_not_registered\") then\n";
-					$tmp .=	"		return false;\n";
-					$tmp .=	"	else\n";
-					$tmp .=	"		return true;\n";
-					$tmp .=	"	end\n";
-					$tmp .=	"end\n";
-					$tmp .=	"\n";
-
-					$tmp .= "\n";
-					$tmp .= "sounds_dir = session:getVariable(\"sounds_dir\");\n";
-					$tmp .= "uuid = session:getVariable(\"uuid\");\n";
-					$tmp .= "dialed_extension = session:getVariable(\"dialed_extension\");\n";
-					$tmp .= "domain_name = session:getVariable(\"domain_name\");\n";
-					$tmp .= "caller_id_name = session:getVariable(\"caller_id_name\");\n";
-					$tmp .= "caller_id_number = session:getVariable(\"caller_id_number\");\n";
-					$tmp .= "outbound_caller_id_name = session:getVariable(\"outbound_caller_id_name\");\n";
-					$tmp .= "outbound_caller_id_number = session:getVariable(\"outbound_caller_id_number\");\n";
-					$tmp .= "\n";
-
-					$tmp .= "--set the sounds path for the language, dialect and voice\n";
-					$tmp .= "	default_language = session:getVariable(\"default_language\");\n";
-					$tmp .= "	default_dialect = session:getVariable(\"default_dialect\");\n";
-					$tmp .= "	default_voice = session:getVariable(\"default_voice\");\n";
-					$tmp .= "	if (not default_language) then default_language = 'en'; end\n";
-					$tmp .= "	if (not default_dialect) then default_dialect = 'us'; end\n";
-					$tmp .= "	if (not default_voice) then default_voice = 'callie'; end\n";
-					$tmp .= "\n";
-
-					//pin number requested from caller if provided
-						if (strlen($row['hunt_group_pin']) > 0) {
-							$tmp .= "pin = '".$row['hunt_group_pin']."';\n";
-							$tmp .= "digits = session:playAndGetDigits(".strlen($row['hunt_group_pin']).", ".strlen($row['hunt_group_pin']).", 3, 3000, \"#\", sounds_dir..\"/\"..default_language..\"/\"..default_dialect..\"/\"..default_voice..\"/custom/please_enter_the_pin_number.wav\", \"\", \"\\\\d+\");\n";
-							$tmp .= "\n";
-							$tmp .= "\n";
-							$tmp .= "if (digits == pin) then\n";
-							$tmp .= "	--continue\n";
-							$tmp .= "\n";
-						}
-
-					//caller announce requested from caller if provided
-						if ($row['hunt_group_caller_announce'] == "true" || $row['hunt_group_call_prompt'] == "true") {
-							if ($row['hunt_group_caller_announce'] == "true") {
-								$tmp .=	"function originate(domain_name, session, sipuri, extension, caller_id_name, caller_id_number, caller_announce) \n";
-							}
-							else {
-								$tmp .=	"function originate(domain_name, session, sipuri, extension, caller_id_name, caller_id_number) \n";
-							}
-							$tmp .=	"	--caller_id_name = caller_id_name.replace(\" \", \"..\");\n";
-							$tmp .=	"	caller_id_name = string.gsub(caller_id_name, \" \", \"..\");\n";
-							//$tmp .=	"	--session:execute(\"luarun\", \"huntgroup_originate.lua \"..domain_name..\" \"..uuid..\" \"..sipuri..\" \"..extension..\" \"..caller_id_name..\" \"..caller_id_number..\" \"..caller_announce);\n";
-							$tmp .=	"	api = freeswitch.API();\n";
-							if ($row['hunt_group_caller_announce'] == "true") {
-								$tmp .=	"	result = api:execute(\"luarun\", \"huntgroup_originate.lua \"..domain_name..\" \"..uuid..\" \"..sipuri..\" \"..extension..\" \"..caller_id_name..\" \"..caller_id_number..\" \"..caller_announce);\n";
-							}
-							else {
-								$tmp .=	"	result = api:execute(\"luarun\", \"huntgroup_originate.lua \"..domain_name..\" \"..uuid..\" \"..sipuri..\" \"..extension..\" \"..caller_id_name..\" \"..caller_id_number..\"\");\n";
-							}
-							$tmp .=	"end";
-							$tmp .=	"\n";
-
-							if ($row['hunt_group_caller_announce'] == "true") {
-								$tmp .=	"caller_announce = \"".$tmp_dir."/\"..extension..\"_\"..uuid..\".wav\";\n";
-								$tmp .=	"session:streamFile(sounds_dir..\"/\"..default_language..\"/\"..default_dialect..\"/\"..default_voice..\"/custom/please_say_your_name_and_reason_for_calling.wav\");\n";
-								$tmp .=	"session:execute(\"gentones\", \"%(1000, 0, 640)\");\n";
-								$tmp .=	"session:execute(\"set\", \"playback_terminators=#\");\n";
-								$tmp .=	"session:execute(\"record\", caller_announce..\" 180 200\");\n";
-							}
-							$tmp .=	"\n";
-							$tmp .=	"session:setAutoHangup(false);\n";
-							$tmp .=	"session:execute(\"transfer\", \"*\"..extension..\" XML ".$_SESSION["context"]."\");\n";
-							$tmp .=	"\n";
-						}
-
-					//set caller id
-						if (strlen($row['hunt_group_cid_name_prefix'])> 0) {
-							$tmp .= "session:execute(\"set\", \"effective_caller_id_name=".$row['hunt_group_cid_name_prefix']."#\"..caller_id_name);\n";
-							$tmp .= "session:execute(\"set\", \"outbound_caller_id_name=".$row['hunt_group_cid_name_prefix']."#\"..caller_id_name);\n";
-						}
-
-					//set ring back
-						if (isset($row['hunt_group_ringback'])){
-							if ($row['hunt_group_ringback'] == "music"){
-								$tmp .= "session:execute(\"set\", \"ringback=\${hold_music}\");          --set to music\n";
-								$tmp .= "session:execute(\"set\", \"transfer_ringback=\${hold_music}\"); --set to music\n";
-							}
-							else {
-								$tmp .= "session:execute(\"set\", \"ringback=".$row['hunt_group_ringback']."\"); --set to ringtone\n";
-								$tmp .= "session:execute(\"set\", \"transfer_ringback=".$row['hunt_group_ringback']."\"); --set to ringtone\n";
-							}
-							if ($row['hunt_group_ringback'] == "ring"){
-								$tmp .= "session:execute(\"set\", \"ringback=\${us-ring}\"); --set to ringtone\n";
-								$tmp .= "session:execute(\"set\", \"transfer_ringback=\${us-ring}\"); --set to ringtone\n";
-							}
-						}
-						else {
-							$tmp .= "session:execute(\"set\", \"ringback=\${hold_music}\");          --set to ringtone\n";
-							$tmp .= "session:execute(\"set\", \"transfer_ringback=\${hold_music}\"); --set to ringtone\n";
-						}
-
-					if ($row['hunt_group_timeout'] > 0) {
-						//$tmp .= "session:setVariable(\"call_timeout\", \"".$row['hunt_group_timeout']."\");\n";
-						$tmp .= "session:setVariable(\"continue_on_fail\", \"true\");\n";
-					}
-					$tmp .= "session:setVariable(\"hangup_after_bridge\", \"true\");\n";
-					$tmp .= "\n";
-					$tmp .= "--freeswitch.consoleLog( \"info\", \"dialed extension:\"..dialed_extension..\"\\n\" );\n";
-					$tmp .= "--freeswitch.consoleLog( \"info\", \"domain: \"..domain..\"\\n\" );\n";
-					$tmp .= "--freeswitch.consoleLog( \"info\", \"us_ring: \"..us_ring..\"\\n\" );\n";
-					$tmp .= "--freeswitch.consoleLog( \"info\", \"domain_name: \"..domain_name..\"\\n\" );\n";
-					$tmp .= "\n";
-
-					$tmp .= "--freeswitch.consoleLog( \"info\", \"action call now don't wait for dtmf\\n\" );\n";
-					if ($row['hunt_group_caller_announce'] == "true" || $row['hunt_group_call_prompt'] == "true") {
-						//do nothing
-					}
-					else {
-						$tmp .= "if session:ready() then\n";
-						//$tmp .= "	session.answer();\n";
-					}
-					$tmp .= "\n";
-
-					$i = 0;
-					$sql = "select * from v_hunt_group_destinations ";
-					$sql .= "where hunt_group_uuid = '".$row['hunt_group_uuid']."' ";
-					$sql .= "and domain_uuid = '$domain_uuid' ";
-					//$sql .= "and destination_enabled = 'true' ";
-					$sql .= "order by destination_order asc ";
-					$prep_statement_2 = $db->prepare($sql);
-					$prep_statement_2->execute();
-					while($ent = $prep_statement_2->fetch(PDO::FETCH_ASSOC)) {
-						//$ent['hunt_group_uuid']
-						//$ent['destination_data']
-						//$ent['destination_type']
-						//$ent['destination_profile']
-						//$ent['destination_order']
-						//$ent['destination_enabled']
-						//$ent['destination_description']
-
-						$destination_timeout = $ent['destination_timeout'];
-						$hunt_group_cid_name_prefix = $row['hunt_group_cid_name_prefix'];
-						if (strlen($hunt_group_cid_name_prefix) > 0) {
-							$hunt_group_cid_name_prefix .= "#";
-						}
-						if (strlen($destination_timeout) == 0) {
-							if (strlen($row['hunt_group_timeout']) == 0) {
-								$destination_timeout = '30';
-							}
-							else {
-								$destination_timeout = $row['hunt_group_timeout'];
-							}
-						}
-
-						//set the default profile
-						if (strlen($ent['destination_data']) == 0) { $ent['destination_data'] = "internal"; }
-
-						if ($ent['destination_type'] == "extension") {
-							//$tmp .= "	sofia_contact_".$ent['destination_data']." = \"\${sofia_contact(".$ent['destination_profile']."/".$ent['destination_data']."@\"..domain_name..\")}\";\n";
-							$tmp_sub_array["application"] = "bridge";
-							$tmp_sub_array["type"] = "extension";
-							$tmp_sub_array["extension"] = $ent['destination_data'];
-
-							//$tmp_sub_array["data"] = "\"[leg_timeout=$destination_timeout]\"..sofia_contact_".$ent['destination_data'];
-							$tmp_sub_array["data"] = "\"[leg_timeout=$destination_timeout,origination_caller_id_name='".$hunt_group_cid_name_prefix."\"..caller_id_name..\"',origination_caller_id_number=\"..caller_id_number..\"]user/".$ent['destination_data']."@\"..domain_name";
-							$tmp_array[$i] = $tmp_sub_array;
-							unset($tmp_sub_array);
-						}
-						if ($ent['destination_type'] == "voicemail") {
-							$tmp_sub_array["application"] = "voicemail";
-							$tmp_sub_array["type"] = "voicemail";
-							$tmp .= "	session:answer();\n";
-							$tmp .= "	session:execute(\"transfer\", \"*99".$ent['destination_data']." XML ".$_SESSION["context"]." \");\n";
-							//$tmp_sub_array["application"] = "voicemail";
-							//$tmp_sub_array["data"] = "default \${domain_name} ".$ent['destination_data'];
-							//$tmp_array[$i] = $tmp_sub_array;
-							unset($tmp_sub_array);
-						}
-						if ($ent['destination_type'] == "sip uri") {
-							$tmp_sub_array["application"] = "bridge";
-							$tmp_sub_array["type"] = "sip uri";
-							//$destination_data = "{user=foo}loopback/".$ent['destination_data']."/default/XML";
-							$bridge_array = outbound_route_to_bridge ($domain_uuid, $ent['destination_data']);
-							$destination_data = $bridge_array[0];
-							$tmp_sub_array["application"] = "bridge";
-							$tmp_sub_array["data"] = "\"[leg_timeout=$destination_timeout,origination_caller_id_name='".$hunt_group_cid_name_prefix."\"..caller_id_name..\"',origination_caller_id_number=\"..caller_id_number..\"]".$destination_data."\"";
-							$tmp_array[$i] = $tmp_sub_array;
-							unset($tmp_sub_array);
-							unset($destination_data);
-						}
-						$i++;
-					} //end while
-					unset ($sql, $prep_statement_2);
-					unset($i, $ent);
-
-					$i = 0;
-					if(count($tmp_array) > 0) {
-						foreach ($tmp_array as $ent) {
-							$tmpdata = $ent["data"];
-							if ($ent["application"] == "voicemail") { $tmpdata = "*99".$tmpdata; }
-							if ($i < 1) {
-								$tmp_buffer = $tmpdata;
-							}
-							else {
-								$tmp_buffer .= "..\",\"..".$tmpdata;
-							}
-							$i++;
-						}
-					}
-					unset($i);
-					$tmp_application = $tmp_array[0]["application"];
-
-					if ($row['hunt_group_type'] == "simultaneous" || $row['hunt_group_type'] == "follow_me_simultaneous" || $row['hunt_group_type'] ==  "call_forward") {
-						$tmp_switch = "simultaneous";
-					}
-					if ($row['hunt_group_type'] == "sequence" || $row['hunt_group_type'] == "follow_me_sequence" || $row['hunt_group_type'] ==  "sequentially") {
-						$tmp_switch = "sequence";
-					}
-					switch ($tmp_switch) {
-					case "simultaneous":
-						if ($row['hunt_group_caller_announce'] == "true" || $row['hunt_group_call_prompt'] == "true") {
-							$i = 0;
-							if (count($tmp_array) > 0) {
-								foreach ($tmp_array as $tmp_row) {
-									$tmpdata = $tmp_row["data"];
-									if ($tmp_row["application"] == "voicemail") {
-										$tmpdata = "*99".$tmpdata;
-									}
-									else {
-										if ($tmp_row["type"] == "extension") {
-											$tmp .= "if (extension_registered(domain_name, sip_profile, '".$tmp_row["extension"]."')) then\n";
-											$tmp .= "	";
-										}
-										if ($row['hunt_group_caller_announce'] == "true") {
-											$tmp .= "result = originate (domain_name, session, ".$tmpdata.", extension, caller_id_name, caller_id_number, caller_announce);\n";
-										}
-										else {
-											$tmp .= "result = originate (domain_name, session, ".$tmpdata.", extension, caller_id_name, caller_id_number);\n";
-										}
-										if ($tmp_row["type"] == "extension") {
-											$tmp .= "end\n";
-										}
-									}
-								}
-							}
-						}
-						else {
-							$tmp .= "\n";
-							if (strlen($tmp_buffer) > 0) {
-								$tmp .= "	session:execute(\"".$tmp_application."\", $tmp_buffer);\n";
-							}
-						}
-						break;
-					case "sequence":
-						$tmp .= "\n";
-						$i = 0;
-						if (count($tmp_array) > 0) {
-							if ($row['hunt_group_caller_announce'] == "true" || $row['hunt_group_call_prompt'] == "true") {
-								$i = 0;
-								if (count($tmp_array) > 0) {
-									foreach ($tmp_array as $tmp_row) {
-										$tmpdata = $tmp_row["data"];
-										if ($tmp_row["application"] == "voicemail") {
-											$tmpdata = "*99".$tmpdata;
-										}
-										else {
-											if ($tmp_row["type"] == "extension") {
-												$tmp .= "if (extension_registered(domain_name, sip_profile, '".$tmp_row["extension"]."')) then\n";
-												$tmp .= "	";
-											}
-											if ($row['hunt_group_caller_announce'] == "true") {
-												$tmp .= "result = originate (domain_name, session, ".$tmpdata.", extension, caller_id_name, caller_id_number, caller_announce);\n";
-											}
-											else {
-												$tmp .= "result = originate (domain_name, session, ".$tmpdata.", extension, caller_id_name, caller_id_number);\n";
-											}
-											if ($tmp_row["type"] == "extension") {
-												$tmp .= "end\n";
-											}
-										}
-									}
-								}
-							}
-							else {
-								foreach ($tmp_array as $tmp_row) {
-									if (strlen($tmp_row["data"]) > 0) {
-										$tmp .= "	session:execute(\"".$tmp_application."\", ".$tmp_row["data"].");\n";
-									}
-								}
-							}
-							unset($tmp_row);
-						}
-						break;
-					}
-					unset($tmp_switch, $tmp_buffer, $tmp_array);
-
-					//set the timeout destination
-						$hunt_group_timeout_destination = $row['hunt_group_timeout_destination'];
-						if ($row['hunt_group_timeout_type'] == "extension") { $hunt_group_timeout_type = "transfer"; }
-						if ($row['hunt_group_timeout_type'] == "voicemail") { $hunt_group_timeout_type = "transfer"; $hunt_group_timeout_destination = "*99".$hunt_group_timeout_destination." XML ".$_SESSION["context"]; }
-						if ($row['hunt_group_timeout_type'] == "sip uri") { $hunt_group_timeout_type = "bridge"; }
-						$tmp .= "\n";
-						if ($row['hunt_group_caller_announce'] == "true" || $row['hunt_group_call_prompt'] == "true") {
-							//do nothing
-						}
-						else {
-							$tmp .= "	--timeout\n";
-							if ($row['hunt_group_type'] != 'dnd') {
-								$tmp .= "	originate_disposition = session:getVariable(\"originate_disposition\");\n";
-								$tmp .= "	if originate_disposition ~= \"SUCCESS\" then\n";
-							}
-							if ($row['hunt_group_timeout_type'] == "voicemail") {
-								$tmp .= "			session:answer();\n";
-							}
-							$tmp .= "			session:execute(\"".$hunt_group_timeout_type."\", \"".$hunt_group_timeout_destination."\");\n";
-							if ($row['hunt_group_type'] != 'dnd') {
-								$tmp .= "	end\n";
-							}
-						}
-
-						if ($row['hunt_group_caller_announce'] == "true" || $row['hunt_group_call_prompt'] == "true") {
-							//do nothing
-						}
-						else {
-							$tmp .= "end --end if session:ready\n";
-						}
-						$tmp .= "\n";
-						//pin number requested from caller if provided
-						if (strlen($row['hunt_group_pin']) > 0) {
-							$tmp .= "else \n";
-							$tmp .= "	session:streamFile(sounds_dir..\"/\"..default_language..\"/\"..default_dialect..\"/\"..default_voice..\"/custom/your_pin_number_is_incorect_goodbye.wav\");\n";
-							$tmp .= "	session:hangup();\n";
-							$tmp .= "end\n";
-							$tmp .= "\n";
-						}
-
-					//unset variables
-						$tmp .= "\n";
-						$tmp .= "--clear variables\n";
-						$tmp .= "dialed_extension = \"\";\n";
-						$tmp .= "new_extension = \"\";\n";
-						$tmp .= "domain_name = \"\";\n";
-						$tmp .= "\n";
-
-					//remove invalid characters from the file names
-						$huntgroup_extension = $row['hunt_group_extension'];
-						$huntgroup_extension = str_replace(" ", "_", $huntgroup_extension);
-						$huntgroup_extension = preg_replace("/[\*\:\\/\<\>\|\'\"\?]/", "", $huntgroup_extension);
-
-					//write the hungroup lua script
-						if (strlen($row['hunt_group_extension']) > 0) {
-							if ($row['hunt_group_enabled'] != "false") {
-								$hunt_group_filename = "v_huntgroup_".$_SESSION['domains'][$domain_uuid]['domain_name']."_".$huntgroup_extension.".lua";
-								//echo "location".$_SESSION['switch']['scripts']['dir']."/".$hunt_group_filename;
-								$fout = fopen($_SESSION['switch']['scripts']['dir']."/".$hunt_group_filename,"w");
-								fwrite($fout, $tmp);
-								unset($hunt_group_filename);
-								fclose($fout);
-							}
-						}
-		} //end while
-
-	//save the dialplan xml files
-		save_dialplan_xml();
-
-} //end huntgroup function lua
-
-?>

+ 0 - 50
hunt_groups/root.php

@@ -1,50 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-// make sure the PATH_SEPARATOR is defined
-	if (!defined("PATH_SEPARATOR")) {
-		if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); }
-	}
-
-// make sure the document_root is set
-	$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]);
-	$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
-	$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
-	//echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."<br />\n";
-	//echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."<br />\n";
-	//echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."<br />\n";
-
-// if the project directory exists then add it to the include path otherwise add the document root to the include path
-	if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){
-		if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', '/fusionpbx'); }
-		set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' );
-	}
-	else {
-		if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', ''); }
-		set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );
-	}
-
-?>

+ 0 - 1
signup/README.md

@@ -1 +0,0 @@
-WARNING: currently broken and not secure enough. Needs to be rewritten.

+ 0 - 25
signup/app_config.php

@@ -1,25 +0,0 @@
-<?php
-
-	//application details
-		$apps[$x]['name'] = "Sign Up";
-		$apps[$x]['uuid'] = 'd308e9c6-d907-5ba7-b3be-6d3e09cf01aa';
-		$apps[$x]['category'] = 'System';
-		$apps[$x]['subcategory'] = '';
-		$apps[$x]['version'] = '';
-		$apps[$x]['license'] = 'Mozilla Public License 1.1';
-		$apps[$x]['url'] = 'http://www.fusionpbx.com';
-		$apps[$x]['description']['en-us'] = 'Allows customers on the internet to signup for a user account.';
-		$apps[$x]['description']['es-mx'] = 'Permite a los clientes crear una cuenta desde Internet';
-		$apps[$x]['description']['de-de'] = '';
-		$apps[$x]['description']['de-ch'] = '';
-		$apps[$x]['description']['de-at'] = '';
-		$apps[$x]['description']['fr-fr'] = '';
-		$apps[$x]['description']['fr-ca'] = '';
-		$apps[$x]['description']['fr-ch'] = '';
-		$apps[$x]['description']['pt-pt'] = 'Permite aos clientes na internet para para criar uma conta de utilizador.';
-		$apps[$x]['description']['pt-br'] = '';
-
-	//permission details
-		$apps[$x]['permissions'][0]['name'] = 'signup';
-
-?>

+ 0 - 19
signup/app_menu.php

@@ -1,19 +0,0 @@
-<?php
-
-	$apps[$x]['menu'][0]['title']['en-us'] = 'Sign Up';
-	$apps[$x]['menu'][0]['title']['es-mx'] = 'Inscribirse';
-	$apps[$x]['menu'][0]['title']['de-de'] = '';
-	$apps[$x]['menu'][0]['title']['de-ch'] = '';
-	$apps[$x]['menu'][0]['title']['de-at'] = '';
-	$apps[$x]['menu'][0]['title']['fr-fr'] = '';
-	$apps[$x]['menu'][0]['title']['fr-ca'] = '';
-	$apps[$x]['menu'][0]['title']['fr-ch'] = '';
-	$apps[$x]['menu'][0]['title']['pt-pt'] = 'Iniciar';
-	$apps[$x]['menu'][0]['title']['pt-br'] = '';
-	$apps[$x]['menu'][0]['uuid'] = 'a8f49f02-9bfb-65ff-4cd3-85dc3354e4c1';
-	$apps[$x]['menu'][0]['parent_uuid'] = '';
-	$apps[$x]['menu'][0]['category'] = 'internal';
-	$apps[$x]['menu'][0]['path'] = '/app/users/usersupdate.php';
-	$apps[$x]['menu'][0]['groups'][] = 'disabled';
-
-?>

+ 0 - 8
signup/config.php.dist

@@ -1,8 +0,0 @@
-<?php
-//Configs for this module... they'll need to be moved to the database
-
-// Get a key from https://www.google.com/recaptcha/admin/create
-$publickey = "";
-$privatekey = "";
-
-?>

+ 0 - 50
signup/root.php

@@ -1,50 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-// make sure the PATH_SEPARATOR is defined
-	if (!defined("PATH_SEPARATOR")) {
-		if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); }
-	}
-
-// make sure the document_root is set
-	$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]);
-	$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
-	$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
-	//echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."<br />\n";
-	//echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."<br />\n";
-	//echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."<br />\n";
-
-// if the project directory exists then add it to the include path otherwise add the document root to the include path
-	if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){
-		if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', '/fusionpbx'); }
-		set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' );
-	}
-	else {
-		if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', ''); }
-		set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );
-	}
-
-?>

+ 0 - 178
signup/signup.php

@@ -1,178 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2012
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-include "root.php";
-require_once "resources/require.php";
-require_once "resources/recaptchalib.php";
-//require_once "resources/email_address_validator.php";
-include "app_config.php";
-include "v_fields.php";
-
-# the response from reCAPTCHA
-$resp = null;
-# the error code from reCAPTCHA, if any
-$error = null;
-
-if (count($_POST)>0 && $_POST["persistform"] != "1") {
-
-	$msgerror = '';
-
-	$required[] = array('username', "Please provid a Username.<br>\n");
-	$required[] = array('user_first_name', "Please provide a first name.<br>\n");
-	$required[] = array('user_last_name', "Please provide a last name.<br>\n");
-	$required[] = array('user_billing_address_1', "Please provide a street address.<br>\n");
-	$required[] = array('user_billing_city', "Please provide a city.<br>\n");
-	$required[] = array('user_billing_state_province', "Please provide a state.<br>\n");
-	$required[] = array('user_billing_country', "Please provide a country.<br>\n");
-	$required[] = array('user_billing_postal_code',"Please provide a postal code.<br>\n");
-	$required[] = array('user_phone_1', "Please provide a phone number.<br>\n");
-	$required[] = array('user_email', "Please provide an email address.<br>\n");
-
-	foreach($required as $x) {
-		if (strlen($_REQUEST[$x[0]]) < 1) {
-			$msgerror .= $x[1];
-			$error_fields[] = $x[0];
-		}
-	}
-
-	//sanitize the http request array
-	foreach ($_REQUEST as $field => $data){
-		$request[$field] = check_str($data);
-	}
-
-	//username is already used.
-	if (strlen($request['username']) != 0) {
-		$sql = "SELECT * FROM v_users ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and username = '" . $request['username'] . "' ";
-		$sql .= "and user_enabled = 'true' ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		if (count($prep_statement->fetchAll(PDO::FETCH_NAMED)) > 0) {
-			$msgerror .= "Please choose a different Username.<br>\n";
-		}
-	}
-
-	// make sure password fields match
-	if ($request['password'] != $request['confirmpassword']) {
-		$msgerror .= "Passwords did not match.<br>\n";
-	}
-
-	// email address atleast looks valid
-	//if (!in_array('user_email', $error_fields)) {
-	//	$validator = new EmailAddressValidator;
-	//	if (!$validator->check_email_address($request['user_email'])) {
-	//		$msgerror .= "Please provide a VALID email address.<br>\n";
-	//	}
-	//}
-
-	if ($_POST["recaptcha_response_field"]) {
-		$resp = recaptcha_check_answer ($privatekey,
-						$_SERVER["REMOTE_ADDR"],
-						$_POST["recaptcha_challenge_field"],
-						$_POST["recaptcha_response_field"]);
-
-		if (!$resp->is_valid) {
-			# set the error code so that we can display it
-			$msgerror .= "Captcha Verification Failed<br>\n";
-			$error = $resp->error;
-		}
-	} else {
-			$msgerror .= "Captcha Verification Failed<br>\n";
-	}
-
-	if (strlen($msgerror) > 0) {
-		goto showform;
-	}
-
-	//salt used with the password to create a one way hash
-	$salt = generate_password('20', '4');
-	$user_uuid = uuid();
-	$sql = "insert into v_users ";
-	$sql .= "(";
-	$sql .= "domain_uuid, ";
-	$sql .= "user_uuid, ";
-	$sql .= "username, ";
-	$sql .= "password, ";
-	$sql .= "salt, ";
-	$sql .= "user_email, ";
-	$sql .= "add_date, ";
-	$sql .= "add_user ";
-	$sql .= ")";
-	$sql .= "values ";
-	$sql .= "(";
-	$sql .= "'$domain_uuid', ";
-	$sql .= "'$user_uuid', ";
-	$sql .= "'" . $request['username'] . "', ";
-	$sql .= "'".md5($salt.$request['password'])."', ";
-	$sql .= "'" . $salt . "', ";
-	$sql .= "'" . $request['user_email'] . "', ";
-	$sql .= "now(), ";
-	$sql .= "'".$_SESSION["username"]."' ";
-	$sql .= ") ";
-	if ($db_type == "pgsql") {
-
-	}
-	$db->exec(check_sql($sql));
-	unset($sql);
-
-	//log the success
-	//$log_type = 'user'; $log_status='add'; $log_add_user=$_SESSION["username"]; $log_desc= "username: ".$username." user added.";
-	//log_add($db, $log_type, $log_status, $log_desc, $log_add_user, $_SERVER["REMOTE_ADDR"]);
-
-	$group_name = 'user';
-	$sql = "insert into v_group_users ";
-	$sql .= "(";
-	$sql .= "group_user_uuid, ";
-	$sql .= "domain_uuid, ";
-	$sql .= "group_name, ";
-	$sql .= "user_uuid ";
-	$sql .= ")";
-	$sql .= "values ";
-	$sql .= "(";
-	$sql .= "'".uuid()."', ";
-	$sql .= "'" . $domain_uuid . "', ";
-	$sql .= "'" . $group_name . "', ";
-	$sql .= "'" . $user_uuid . "' ";
-	$sql .= ")";
-	$db->exec(check_sql($sql));
-	unset($sql);
-
-	require_once "resources/header.php";
-	echo "<meta http-equiv=\"refresh\" content=\"3;url=".PROJECT_PATH."/index.php\">\n";
-	echo "<div align='center'>Add Complete</div>";
-	require_once "resources/footer.php";
-	// This should probably be an exit or die() call;
-	return;
-}
-
-showform:
-
-require_once "resources/header.php";
-
-include "user_template.php";
-
-require_once "resources/footer.php";
-?>

+ 0 - 61
signup/user_template.php

@@ -1,61 +0,0 @@
-	<div align='center'>
-	<table width='90%' border='0' cellpadding='0' cellspacing='2'>
-		<?php if (strlen($msgerror) > 0) { ?>
-		<tr><td>
-		<?php echo $msgerror; ?>
-                </td></tr>
-        <?php } ?>
-	<tr>
-		<td align="left">
-			<br>
-
-	<form method='post' action=''>
-
-<?php foreach($forms as $form) { ?>
-
-	  <b><?php echo $form['header']; ?></b><br>
-	  <div class='borderlight' style='padding:10px;'>
-	  <table width="100%" cellpadding='6' cellspacing='0'>
-<?php 
-	foreach($form['fields'] as $field) {
-		if ($field[3]) { 
-			$cssclass = 'vncellreq'; 
-		} else { 
-			$cssclass = 'vncell'; 
-		}
-
-		if (in_array($field[0], $error_fields)) { 
-			$cssclass = 'vncellreqerr';
-		}
-		
-  		?> <tr><td class="<?php echo $cssclass; ?>" width="40%"><?php echo $field[1]; ?></td>
-  		<td class="vtable" width="60%"><input type="<?php echo $field[2]; ?>" class="formfld" autocomplete="off"
-				name="<?php echo $field[0]; ?>" value="<?php echo $request[$field[0]]; ?>"></td></tr>
-<?php
-		}
-
-	print("</table></div><br>");
-} 
-?>
-
-	<div class='' style='padding:10px;'>
-	<table width="100%">
-		<tr>
-			<!-- <td valign='top'>
-				<input type="checkbox" name="newsletter" value="newsletter" /> Yes, sign me up for news letter<br />
-				<input type="checkbox" name="tos_agree" value="tos_agree" /> I have read and agree to the terms of service
-			</td> -->
-			<td colspan='2' align='center'><?php echo recaptcha_get_html($publickey, $error); ?></td>
-		</tr>
-		<tr>
-			<td colspan='2' align='center'>
-	       <input type='submit' name='submit' class='btn' value='Create Account'>
-			</td>
-		</tr>
-	</table>
-	</form>
-
-		</td>
-		</tr>
-	</table>
-	</div>

+ 0 - 31
signup/v_fields.php

@@ -1,31 +0,0 @@
-<?php
-
-	// Add/Edit Form Fields
-	$forms[1]['header'] = "Please fill out this form completely. All BOLD fields are required.";
-	$forms[1]['fields'][1] = array('username', "Username:", "text", TRUE, "Please provid a Username.<br>\n");
-	$forms[1]['fields'][2] = array('password', "Password:", "password", TRUE, "Please provid a Username.<br>\n");
-	$forms[1]['fields'][3] = array('confirmpassword', "Confirm Password:", "password", FALSE, "");
-	$forms[1]['fields'][4] = array('user_company_name', "Company Name:", "text", FALSE, "");
-	$forms[1]['fields'][5] = array('user_first_name', "First Name:", "text", TRUE, "Please provide a first name.<br>\n");
-	$forms[1]['fields'][6] = array('user_last_name', "Last Name:", "text", TRUE, "Please provide a last name.<br>\n");
-	$forms[1]['fields'][7] = array('user_email', "Email:", "text", TRUE, "Please provide an email address.<br>\n");
-	$forms[1]['fields'][8] = array('user_phone_1', "Phone Number:", "text", TRUE, "Please provide a phone number.<br>\n");
-	$forms[1]['fields'][9] = array('user_phone_1_ext', "Extension:", "text", FALSE, "");
-
-	$forms[2]['header'] = "Billing Address";
-	$forms[2]['fields'][1] = array('user_billing_address_1', "Address 1:", "text", TRUE, "Please provide a street address.<br>\n");
-	$forms[2]['fields'][2] = array('user_billing_address_2', "Address 2:", "text", FALSE, "");
-	$forms[2]['fields'][3] = array('user_billing_city', "City:", "text", TRUE, "Please provide a city.<br>\n");
-	$forms[2]['fields'][4] = array('user_billing_state_province', "State/Province:", "text", TRUE, "Please provide a state or province.<br>\n");
-	$forms[2]['fields'][5] = array('user_billing_country', "Country:", "text", TRUE, "Please provide a country.<br>\n");
-	$forms[2]['fields'][6] = array('user_billing_postal_code', "ZIP/Postal Code:", "text", TRUE, "Please provide a postal code.<br>\n");
-
-	$forms[3]['header'] = "Shipping Address";
-	$forms[3]['fields'][1] = array('user_shipping_address_1', "Address 1:", "text", TRUE, "Please provide a street address.<br>\n");
-	$forms[3]['fields'][2] = array('user_shipping_address_2', "Address 2:", "text", FALSE, "");
-	$forms[3]['fields'][3] = array('user_shipping_city', "City:", "text", TRUE, "Please provide a city.<br>\n");
-	$forms[3]['fields'][4] = array('user_shipping_state_province', "State/Province:", "text", TRUE, "Please provide a state or province.<br>\n");
-	$forms[3]['fields'][5] = array('user_shipping_country', "Country:", "text", TRUE, "Please provide a country.<br>\n");
-	$forms[3]['fields'][6] = array('user_shipping_postal_code', "ZIP/Postal Code:", "text", TRUE, "Please provide a postal code.<br>\n");
-
-?>