Ticket #2025 (closed Bugs: fixed)

Opened 6 years ago

Last modified 6 years ago

edit existing user with directdid compains because user had direct did

Reported by: p_lindheimer Assigned to:
Priority: major Milestone: 2.3
Component: Core - Users/Devices Version: 2.3-branch
Keywords: Cc:
Confirmation: Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

you get a pop up box same as if another use had this did. I know I fixed this but ??? will get the fix out shortly. affects 2.2.2 and 2.3.

Change History

06/26/07 09:21:26 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to fixed.

r4223 (2.2) r4224 (2.3)

Index: functions.inc.php
===================================================================
--- functions.inc.php (revision 4223)
+++ functions.inc.php (revision 4224)
@@ -1463,9 +1463,9 @@

  // clean and check the did to make sure it is not being used by another extension or in did routing
  //
- $directdid=$vars['directdid'];
- $directdid = preg_replace("/[^0-9._XxNnZz\[\]\-]/" ,"", trim($directdid));
  if (trim($directdid) != "") {
+   $directdid=$vars['directdid'];
+   $directdid = preg_replace("/[^0-9._XxNnZz\[\]\-]/" ,"", trim($directdid));
    $existing=core_did_get($directdid,"","");
    $existing_directdid = empty($existing)?core_users_directdid_get($directdid):$existing;
    if (!empty($existing) || !empty($existing_directdid)) {

06/26/07 11:12:42 changed by jscanlan

  • status changed from closed to reopened.
  • resolution deleted.

this did fix the problem, but now adding a pre-existing DirectDID to another, previously created extension is blocked (good!) silently (not as good.)

06/26/07 11:57:12 changed by p_lindheimer

  • status changed from reopened to closed.
  • resolution set to fixed.

oops - ok fixed for real this time: r4225 (2.2) r4226 (2.3)

Index: /usr/src/freepbx-svn/amportal/modules/branches/2.3/core/functions.inc.php
===================================================================
--- /usr/src/freepbx-svn/amportal/modules/branches/2.3/core/functions.inc.php (revision 4224)
+++ /usr/src/freepbx-svn/amportal/modules/branches/2.3/core/functions.inc.php (working copy)
@@ -1461,14 +1461,14 @@
    fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]);
  }

+ $directdid=$vars['directdid'];
+ $directdid = preg_replace("/[^0-9._XxNnZz\[\]\-]/" ,"", trim($directdid));
  // clean and check the did to make sure it is not being used by another extension or in did routing
  //
  if (trim($directdid) != "") {
-   $directdid=$vars['directdid'];
-   $directdid = preg_replace("/[^0-9._XxNnZz\[\]\-]/" ,"", trim($directdid));
    $existing=core_did_get($directdid,"","");
    $existing_directdid = empty($existing)?core_users_directdid_get($directdid):$existing;
-   if (!empty($existing) || !empty($existing_directdid)) {
+   if (!empty($existing) || (!empty($existing_directdid) && $existing_directdid['extension'] != $extension)) {
      if (!empty($existing)) {
        echo "<script>javascript:alert('"._("A route with this DID already exists:")." ".$existing['extension']."')</script>";
      } else {