Changeset 2457

Show
Ignore:
Timestamp:
09/15/06 03:53:55 (2 years ago)
Author:
qldrob
Message:

Fix for #1056 - Can't add a did with a /, as we use it for a delimeter internally.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/common/script.js.php

    r2271 r2457  
    573573 
    574574// *************************************************** 
     575// ** Check if string s contains char c             ** 
     576// *************************************************** 
     577 
     578function isInside(s, c) 
     579{ 
     580    var i; 
     581 
     582    if (isEmpty(s)) { 
     583        return false; 
     584    } 
     585    for (i = 0; i < s.length; i++) 
     586    {    
     587        var t = s.charAt(i); 
     588        if (t == c)  return true; 
     589    } 
     590    return false; 
     591} 
     592 
     593// *************************************************** 
    575594// ** HELPER FUNCTIONS FOR ABOVE VALIDATIONS        ** 
    576595// *************************************************** 
  • freepbx/trunk/amp_conf/htdocs/admin/modules/core/page.did.php

    r2144 r2457  
    232232        var msgConfirmDIDCIDBlank = "<?php echo _('Leaving the DID Number AND the Caller ID Number empty will match all incoming calls received not routed using any other defined Incoming Route.\n\nAre you sure?'); ?>"; 
    233233        var msgConfirmDIDNonStd = "<?php echo _('DID information is normally just an incoming telephone number or for advanced users, a valid Asterisk Dial Pattern\n\nYou have entered a non standard DID pattern.\n\nAre you sure this is correct?'); ?>"; 
     234        var msgConfirmDIDNoSlash = "<?php echo _('A Slash (\'/\') is never a valid DID. Please remove it and try again'); ?>"; 
    234235         
    235236        setDestinations(theForm,1); 
     
    242243        } 
    243244         
     245        if (isInside(theForm.extension.value, "/")) { 
     246                warnInvalid(theForm.extension, msgConfirmDIDNoSlash); 
     247                return false; 
     248        } 
    244249        if (!isDialpattern(theForm.cidnum.value)) 
    245250                return warnInvalid(theForm.cidnum, msgInvalidCIDNum); 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads