diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php
index 4c5a92f114..66f8a36f74 100644
--- a/app/destinations/destination_edit.php
+++ b/app/destinations/destination_edit.php
@@ -79,6 +79,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.
if (count($_POST) > 0) {
//set the variables
$dialplan_uuid = check_str($_POST["dialplan_uuid"]);
+ $domain_uuid = check_str($_POST["domain_uuid"]);
$destination_type = check_str($_POST["destination_type"]);
$destination_number = check_str($_POST["destination_number"]);
$db_destination_number = check_str($_POST["db_destination_number"]);
@@ -96,15 +97,6 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.
$currency_buy = check_str($_POST["currency_buy"]);
$destination_accountcode = check_str($_POST["destination_accountcode"]);
$destination_carrier = check_str($_POST["destination_carrier"]);
-
- //get the domain_uuid
- if (permission_exists('destination_domain')) {
- $domain_uuid = check_str($_POST["domain_uuid"]);
- }
- else {
- $_POST["domain_uuid"] = $_SESSION['domain_uuid'];
- $domain_uuid = $_SESSION['domain_uuid'];
- }
}
//unset the db_destination_number
@@ -473,9 +465,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$orm->uuid($destination_uuid);
$result = $orm->find()->get();
foreach ($result as &$row) {
- if (permission_exists('destination_domain')) {
- $domain_uuid = $row["domain_uuid"];
- }
+ $domain_uuid = $row["domain_uuid"];
$dialplan_uuid = $row["dialplan_uuid"];
$destination_type = $row["destination_type"];
$destination_number = $row["destination_number"];
@@ -780,6 +770,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "\n";
echo "\n";
}
+ else {
+ echo "\n";
+ }
echo "
\n";
echo "| \n";
diff --git a/core/users/app_config.php b/core/users/app_config.php
index 48c3882fb7..1040cccdd1 100644
--- a/core/users/app_config.php
+++ b/core/users/app_config.php
@@ -57,6 +57,12 @@
$apps[$x]['permissions'][$y]['name'] = "group_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
+ $apps[$x]['permissions'][$y]['name'] = 'group_domain';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'group_all';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $y++;
$apps[$x]['permissions'][$y]['name'] = "group_member_view";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "3b4acc6d-827b-f537-bf21-0093d94ffec7";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
diff --git a/core/users/app_languages.php b/core/users/app_languages.php
index dcb22e6cd0..fbdecdfb44 100644
--- a/core/users/app_languages.php
+++ b/core/users/app_languages.php
@@ -22,10 +22,15 @@
$text['title-group_manager']['pt-pt'] = "Gestão de Grupos";
$text['title-group_manager']['fr-fr'] = "Gestion de Groupe";
- $text['title-group_add']['en-us'] = "Group";
- $text['title-group_add']['es-cl'] = "Agregar Usuario";
- $text['title-group_add']['pt-pt'] = "Grupo";
- $text['title-group_add']['fr-fr'] = "Groupe";
+ $text['title-group_add']['en-us'] = "Add Group";
+ $text['title-group_add']['es-cl'] = "Agregar Grupo";
+ $text['title-group_add']['pt-pt'] = "Adicionar Grupo";
+ $text['title-group_add']['fr-fr'] = "Ajouter un Groupe";
+
+ $text['title-group_edit']['en-us'] = "Edit Group";
+ $text['title-group_edit']['es-cl'] = "Editar Grupo";
+ $text['title-group_edit']['pt-pt'] = "Editar Grupo";
+ $text['title-group_edit']['fr-fr'] = "Modifier le Groupe";
$text['title-group_permissions']['en-us'] = "Group Permissions";
$text['title-group_permissions']['es-cl'] = "Permisos de Grupo";
@@ -57,10 +62,15 @@
$text['header-group_manager']['pt-pt'] = "Gestão de Grupos";
$text['header-group_manager']['fr-fr'] = "Gestion de Groupe";
- $text['header-group_add']['en-us'] = "Group";
+ $text['header-group_add']['en-us'] = "Add Group";
$text['header-group_add']['es-cl'] = "Agregar Grupo";
$text['header-group_add']['pt-pt'] = "Adicionar Grupo";
- $text['header-group_add']['fr-fr'] = "Ajout de Groupe";
+ $text['header-group_add']['fr-fr'] = "Ajouter un Groupe";
+
+ $text['header-group_edit']['en-us'] = "Edit Group";
+ $text['header-group_edit']['es-cl'] = "Editar Grupo";
+ $text['header-group_edit']['pt-pt'] = "Editar Grupo";
+ $text['header-group_edit']['fr-fr'] = "Modifier le Groupe";
$text['header-group_permissions']['en-us'] = "Group Permissions: ";
$text['header-group_permissions']['es-cl'] = "Permisos de Grupo: ";
@@ -87,10 +97,15 @@
$text['description-user_edit']['pt-pt'] = "Editar a informação do utilizador e os membros do grupo. ";
$text['description-user_edit']['fr-fr'] = "Editer les informations de l'utilisateur et l'appartenance au groupe.";
- $text['description-group_add']['en-us'] = "Please choose a group name.";
- $text['description-group_add']['es-cl'] = "Por favor escoja un nombre.";
- $text['description-group_add']['pt-pt'] = "Por favor escolha um nome para o grupo.";
- $text['description-group_add']['fr-fr'] = "Choisir un nom pour le groupe.";
+ $text['description-group_add']['en-us'] = "Create a new user group.";
+ $text['description-group_add']['es-cl'] = "Crear un nuevo grupo de usuarios.";
+ $text['description-group_add']['pt-pt'] = "Criar um novo grupo de usuários.";
+ $text['description-group_add']['fr-fr'] = "Créez un nouveau groupe d'utilisateurs.";
+
+ $text['description-group_edit']['en-us'] = "Edit the properties of the group.";
+ $text['description-group_edit']['es-cl'] = "Editar las propiedades del grupo.";
+ $text['description-group_edit']['pt-pt'] = "Editar as propriedades do grupo.";
+ $text['description-group_edit']['fr-fr'] = "Modifier les propriétés du groupe.";
$text['description-group_permissions']['en-us'] = "Assign permissions for this group.";
$text['description-group_permissions']['es-cl'] = "Asigne permisos para este grupo.";
@@ -442,4 +457,9 @@
$text['message-maximum_users']['pt-pt'] = "Usuários Máximo Permitido:";
$text['message-maximum_users']['fr-fr'] = "Utilisateurs Maximale Autorisée:";
+ $text['message-group_exists']['en-us'] = "Group Already Exists";
+ $text['message-group_exists']['es-cl'] = "El Grupo ya Existe";
+ $text['message-group_exists']['pt-pt'] = "O Grupo já Existe";
+ $text['message-group_exists']['fr-fr'] = "Groupe Existe Déjà";
+
?>
\ No newline at end of file
diff --git a/core/users/group_permissions.php b/core/users/group_permissions.php
index adf4c25b61..ae4447529b 100644
--- a/core/users/group_permissions.php
+++ b/core/users/group_permissions.php
@@ -90,12 +90,24 @@ require_once "resources/require.php";
}
}
-//get the http values and set them as php variables
- $group_name = $_REQUEST['group_name'];
+//get the group uuid, lookup domain uuid (if any) and name
+ $group_uuid = check_str($_REQUEST['group_uuid']);
+ $sql = "select domain_uuid, group_name from v_groups ";
+ $sql .= "where group_uuid = '".$group_uuid."' ";
+ $prep_statement = $db->prepare(check_sql($sql));
+ $prep_statement->execute();
+ $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+ foreach ($result as &$row) {
+ $domain_uuid = $row["domain_uuid"];
+ $group_name = $row["group_name"];
+ break; //limit to 1 row
+ }
+ unset ($prep_statement);
//get the permissions assigned to this group
$sql = " select * from v_group_permissions ";
$sql .= "where group_name = '$group_name' ";
+ $sql .= "and domain_uuid ".(($domain_uuid != '') ? " = '".$domain_uuid."' " : " is null ");
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
@@ -128,6 +140,7 @@ require_once "resources/require.php";
//process the http post
if (count($_POST)>0) {
+
foreach($_POST['permissions_form'] as $permission) {
$permissions_form[$permission] = "true";
}
@@ -217,12 +230,18 @@ require_once "resources/require.php";
$sql = "insert into v_group_permissions ";
$sql .= "(";
$sql .= "group_permission_uuid, ";
+ if ($domain_uuid != '') {
+ $sql .= "domain_uuid, ";
+ }
$sql .= "permission_name, ";
$sql .= "group_name ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'".uuid()."', ";
+ if ($domain_uuid != '') {
+ $sql .= "'".$domain_uuid."', ";
+ }
$sql .= "'$permission', ";
$sql .= "'$group_name' ";
$sql .= ")";
@@ -315,6 +334,7 @@ require_once "resources/require.php";
//show the content
echo " |