Ticket #2565: voicemail.module.patch

File voicemail.module.patch, 3.8 kB (added by sasargen, 8 months ago)
  • voicemail.module

    old new  
    207207    global $ASTERISK_VOICEMAIL_PATH; 
    208208    global $ASTERISK_VOICEMAIL_FOLDERS; 
    209209    global $AJAX_PAGE_REFRESH_ENABLE; 
     210    global $ARI_CRYPT_PASSWORD; 
    210211 
    211212    $voicemail_audio_format = $_COOKIE['ari_voicemail_audio_format']; 
    212213 
    213214    $display = new DisplaySearch(); 
     215    $crypt = new Crypt(); 
    214216 
    215217    // args 
    216218    $m = getArgument($args,'m'); 
     
    385387        // recording popup link 
    386388        $voicemail_audio_format = $voicemail_audio_format=='' ? '.wav' : $voicemail_audio_format; 
    387389        $recording = preg_replace('/.txt/', $voicemail_audio_format, $file); 
     390        $date = GetDateFormat($value['origtime']); 
     391        $time = GetTimeFormat($value['origtime']); 
     392        $from = $value[callerid]; 
     393        $priority = $value[priority]; 
     394        $to = $value[origmailbox]; 
     395        $duration = $value[duration]; 
    388396        if (is_file($recording)) { 
    389           $recordingLink = "<a href='#' onClick=\"javascript:popUp('misc/recording_popup.php?recording=" . $recording . "&date=" . $date . "&time=" . $time . "'); return false;\"> 
     397          $recordingCrypt = $crypt->encrypt($recording,$ARI_CRYPT_PASSWORD); 
     398          $recordingLink = "<a href='#' onClick=\"javascript:popUp('misc/recording_popup.php?recording=" . $recordingCrypt . "&date=" . $date . "&time=" . $time . "'); return false;\"> 
    390399            " . _("play") . " 
    391400          </a>"; 
    392401        }  
     
    395404                                   sprintf(_("On settings page, change voicemail audio format.  It is currently set to %s"),$voicemail_audio_format); 
    396405        } 
    397406 
     407        $fileCrypt = $crypt->encrypt($file,$ARI_CRYPT_PASSWORD); 
     408 
    398409        $tableText .= " 
    399410          <tr> 
    400             <td class='checkbox'><input type=checkbox name='selected" . ++$i . "' value=" . $file . "></td> 
    401             <td width=68>" . GetDateFormat($value['origtime']) . "</td> 
    402             <td>" . GetTimeFormat($value['origtime']) . "</td> 
    403             <td width=100>" . $value[callerid] . "</td> 
     411            <td class='checkbox'><input type=checkbox name='selected" . ++$i . "' value=" . $fileCrypt . "></td> 
     412            <td width=68>" . $date . "</td> 
     413            <td>" . $time . "</td> 
     414            <td width=100>" . $from . "</td> 
    404415            <td>" . $value[priority] . "</td> 
    405             <td width=90>" . $value[origmailbox] . "</td> 
    406             <td>" . $value[duration] . " sec</td> 
     416            <td width=90>" . $to . "</td> 
     417            <td>" . $duration . " sec</td> 
    407418            <td>" . $recordingLink . "</td> 
    408419          </tr>"; 
    409420      } 
     
    607618   */ 
    608619  function deleteVoicemailData($files) { 
    609620 
    610     foreach($files as $key => $path) { 
     621    global $ARI_CRYPT_PASSWORD; 
     622 
     623    $crypt = new Crypt(); 
     624 
     625    foreach($files as $key => $pathCrypt) { 
     626 
     627      // decrypt path 
     628      $path = $crypt->decrypt($pathCrypt,$ARI_CRYPT_PASSWORD); 
    611629 
    612630      // get file parts for search 
    613631      $path_parts = pathinfo($path); 
     
    642660  function moveVoicemailData($files,$context_rx,$extension_rx,$folder_rx) { 
    643661 
    644662    global $ASTERISK_VOICEMAIL_PATH; 
     663    global $ARI_CRYPT_PASSWORD; 
     664 
     665    $crypt = new Crypt(); 
    645666 
    646667    $perm = fileperms($ASTERISK_VOICEMAIL_PATH); 
    647668    $uid = fileowner($ASTERISK_VOICEMAIL_PATH); 
     
    696717      return; 
    697718    } 
    698719 
     720    foreach($files as $key => $pathCrypt) { 
     721      // decrypt path 
     722      $pathPlain = $crypt->decrypt($pathCrypt,$ARI_CRYPT_PASSWORD); 
     723      // add plain path to new array 
     724      $filesPlain[] = $pathPlain; 
     725    } 
     726 
    699727    // copy files to new location, incrementing each message number  
    700     asort($files); 
    701     foreach($files as $key => $path) { 
     728    asort($filesPlain); 
     729    foreach($filesPlain as $key => $path) { 
    702730 
    703731      // get file parts for search 
    704732      $path_parts = pathinfo($path); 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads