mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
* prevent cloning duplicate extensions app/extensions/app_languages.php + add duplicate extension error prompt app/extensions/extension_copy.php + add check to see if duplicate extension exists app/extensions/resources/classes/extension.php + add function to check if extension exists * fix typo * Update app_languages.php * Update extension_copy.php * Update extension.php * Update extension_copy.php Use the global app_languages.php message-duplicate translation. * Update extension_copy.php * Update extension.php
This commit is contained in:
@@ -17,23 +17,27 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/paging.php";
|
||||
if (permission_exists('extension_add')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('extension_add')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
@@ -47,7 +51,21 @@ else {
|
||||
$number_alias_new = check_str($_REQUEST["alias"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// skip the copy if the domain extension already exists
|
||||
$ext = new extension;
|
||||
$ext->db = $db;
|
||||
if ($ext->exists($domain_uuid, $extension_new)) {
|
||||
//begin the page content
|
||||
require_once "resources/header.php";
|
||||
|
||||
echo "<div align='center'>".$text['message-duplicate']."<br />";
|
||||
echo " <input type='button' class='btn' alt='".$text['button-back']."' onclick=\"window.location='./extension_edit.php?id=".$extension_uuid."';\" value='".$text['button-back']."'>\n";
|
||||
echo "</div>";
|
||||
require_once "resources/footer.php";
|
||||
return;
|
||||
}
|
||||
|
||||
//get the v_extensions data
|
||||
$sql = "select * from v_extensions ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
@@ -228,4 +246,4 @@ else {
|
||||
header("Location: extensions.php");
|
||||
return;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user