Changeset 6731 for freepbx/branches/2.5
- Timestamp:
- 09/15/08 23:38:35 (5 years ago)
- Files:
-
- freepbx/branches/2.5/amp_conf/htdocs/recordings/includes/login.php (modified) (1 diff)
- freepbx/branches/2.5/amp_conf/htdocs/recordings/misc/audio.php (modified) (1 diff)
- freepbx/branches/2.5/amp_conf/htdocs/recordings/misc/recording_popup.php (modified) (2 diffs)
- freepbx/branches/2.5/amp_conf/htdocs/recordings/modules/callmonitor.module (modified) (5 diffs)
- freepbx/branches/2.5/amp_conf/htdocs/recordings/modules/voicemail.module (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.5/amp_conf/htdocs/recordings/includes/login.php
r6409 r6731 336 336 $_SESSION['ari_user']['default_page'] = $default_page; 337 337 338 // force the session data saved 339 session_write_close(); 338 // Make sure nothing stale is here: 339 // 340 unset($_SESSION['ari_user']['recfiles']); 341 342 // don't force the session data saved, there may be voicemail or callmonitor files still 340 343 } 341 344 } freepbx/branches/2.5/amp_conf/htdocs/recordings/misc/audio.php
r6699 r6731 7 7 8 8 9 10 if (isset($_GET['recording'])) { 9 if (isset($_GET['recindex'])) { 11 10 12 11 chdir(".."); 13 12 include_once("./includes/bootstrap.php"); 14 13 15 global $ARI_CRYPT_PASSWORD;14 $path = $_SESSION['ari_user']['recfiles'][$_GET['recindex']]; 16 15 17 $crypt = new Crypt();18 19 $path = $crypt->decrypt($_GET['recording'],$ARI_CRYPT_PASSWORD);20 21 // strip ".." from path and retrieve absolute path from filesystem for security22 $path = realpath(preg_replace('/\.\./','',$path));23 24 16 // See if the file exists 25 17 if (!is_file($path)) { die("<b>404 File not found!</b>"); } freepbx/branches/2.5/amp_conf/htdocs/recordings/misc/recording_popup.php
r6190 r6731 23 23 <?php 24 24 25 $path = urlencode($_GET['recording']); 25 if (isset($_GET['recindex'])) { 26 $path = $_SESSION['ari_user']['recfiles'][$_GET['recindex']]; 27 } 26 28 27 29 if (isset($path)) { … … 34 36 35 37 echo("<br>"); 36 echo("<embed src='audio.php?rec ording=" . $path. "' width=300, height=25 autoplay=true loop=false></embed><br>");37 echo("<a class='popup_download' href=/recordings/misc/audio.php?rec ording=" . $path. ">" . _("download") . "</a><br>");38 echo("<embed src='audio.php?recindex=".$_GET['recindex'] . "' width=300, height=25 autoplay=true loop=false></embed><br>"); 39 echo("<a class='popup_download' href=/recordings/misc/audio.php?recindex=" . $_GET['recindex'] . ">" . _("download") . "</a><br>"); 38 40 } 39 41 freepbx/branches/2.5/amp_conf/htdocs/recordings/modules/callmonitor.module
r6579 r6731 60 60 $files = array(); 61 61 foreach($_REQUEST as $key => $value) { 62 if (preg_match('/selected/',$key) ) {63 array_push($files, $ value);62 if (preg_match('/selected/',$key) && isset($_SESSION['ari_user']['recfiles'][$value])) { 63 array_push($files, $_SESSION['ari_user']['recfiles'][$value]); 64 64 } 65 65 } … … 100 100 global $CALLMONITOR_ALLOW_DELETE; 101 101 global $AJAX_PAGE_REFRESH_ENABLE; 102 global $ARI_CRYPT_PASSWORD;103 102 104 103 $display = new DisplaySearch(); 105 $crypt = new Crypt();106 104 107 105 // get the search string … … 204 202 205 203 // table body 204 unset($_SESSION['ari_user']['recfiles']); 206 205 if (is_array($data)) foreach($data as $key=>$value) { 206 $i++; 207 207 208 208 // recording file 209 209 $recording = $recordings[$value['uniqueid'] . $value['calldate']]; 210 $fileCrypt = $crypt->encrypt($recording,$ARI_CRYPT_PASSWORD);211 $recordingCrypt = urlencode($fileCrypt);212 210 213 211 // date and time … … 216 214 $time = $buf[1]; 217 215 218 // recording delete checkbox219 if ($CALLMONITOR_ALLOW_DELETE) {220 $recording_delete_checkbox = "<td class='checkbox'><input type=checkbox name='selected" . ++$i . "' value=" . $fileCrypt . "></td>";221 }222 216 223 217 $recordingLink = ''; 224 218 if (is_file($recordings[$value['uniqueid'] . $value['calldate']])) { 225 $recordingLink = "<a href='#' onClick=\"javascript:popUp('misc/recording_popup.php?recording=" . $recordingCrypt . "&date=" . $date . "&time=" . $time . "'); return false;\">" . _("play") . "</a>"; 226 } 219 $_SESSION['ari_user']['recfiles'][$i] = $recording; 220 $recordingLink = "<a href='#' onClick=\"javascript:popUp('misc/recording_popup.php?recindex=" . $i . "&date=" . $date . "&time=" . $time . "'); return false;\">" . _("play") . "</a>"; 221 // recording delete checkbox 222 if ($CALLMONITOR_ALLOW_DELETE) { 223 $recording_delete_checkbox = "<td class='checkbox'><input type=checkbox name='selected" . $i . "' value=" . $i . "></td>"; 224 } 225 } else { 226 if ($CALLMONITOR_ALLOW_DELETE) { 227 $recording_delete_checkbox = "<td class='checkbox'><input type=checkbox name='selected" . $i . "' value=" . "NO_VALUE" . "></td>"; 228 } 229 } 227 230 228 231 $recording_body .= "<tr> … … 531 534 function deleteRecData($files) { 532 535 533 global $ARI_CRYPT_PASSWORD; 534 535 $crypt = new Crypt(); 536 537 foreach($files as $key => $fileCrypt) { 538 $file = $crypt->decrypt($fileCrypt,$ARI_CRYPT_PASSWORD); 536 foreach($files as $key => $file) { 539 537 if (is_writable($file)) { 540 538 unlink($file); freepbx/branches/2.5/amp_conf/htdocs/recordings/modules/voicemail.module
r6478 r6731 149 149 $files = array(); 150 150 foreach($_REQUEST as $key => $value) { 151 if (preg_match('/selected/',$key) ) {152 array_push($files, $ value);151 if (preg_match('/selected/',$key) && isset($_SESSION['ari_user']['recfiles'][$value])) { 152 array_push($files, $_SESSION['ari_user']['recfiles'][$value]); 153 153 } 154 154 } … … 208 208 global $ASTERISK_VOICEMAIL_FOLDERS; 209 209 global $AJAX_PAGE_REFRESH_ENABLE; 210 global $ARI_CRYPT_PASSWORD;211 210 212 211 $voicemail_audio_format = $_COOKIE['ari_voicemail_audio_format']; 213 212 214 213 $display = new DisplaySearch(); 215 $crypt = new Crypt();216 214 217 215 // args … … 385 383 386 384 // table body 385 unset($_SESSION['ari_user']['recfiles']); 387 386 if (isset($data)) { 388 387 foreach($data as $file=>$value) { 389 388 $i++; 390 389 // recording popup link 391 390 $voicemail_audio_format = $voicemail_audio_format=='' ? '.wav' : $voicemail_audio_format; … … 398 397 $duration = $value[duration]; 399 398 if (is_file($recording)) { 400 $recordingCrypt = urlencode($crypt->encrypt($recording,$ARI_CRYPT_PASSWORD));401 $recordingLink = "<a href='#' onClick=\"javascript:popUp('misc/recording_popup.php?recording=" . $recordingCrypt . "&date=" . $date . "&time=" . $time . "'); return false;\">399 $_SESSION['ari_user']['recfiles'][$i] = $recording; 400 $recordingLink = "<a href='#' onClick=\"javascript:popUp('misc/recording_popup.php?recindex=$i&date=" . $date . "&time=" . $time . "'); return false;\"> 402 401 " . _("play") . " 403 402 </a>"; … … 406 405 $_SESSION['ari_error'] = _("Voicemail recording(s) was not found.") . "<br>" . 407 406 sprintf(_("On settings page, change voicemail audio format. It is currently set to %s"),$voicemail_audio_format); 408 } 409 410 $fileCrypt = $crypt->encrypt($file,$ARI_CRYPT_PASSWORD); 407 $recordingLink = "<a href='#' onClick=\"javascript:popUp('misc/recording_popup.php?recindex=$i&date=" . $date . "&time=" . $time . "'); return false;\"> 408 " . _("play") . " 409 </a>"; 410 } 411 411 412 412 $tableText .= " 413 413 <tr> 414 <td class='checkbox'><input type=checkbox name='selected" . ++$i . "' value=" . $fileCrypt. "></td>414 <td class='checkbox'><input type=checkbox name='selected" . $i . "' value=" . $i . "></td> 415 415 <td width=68>" . $date . "</td> 416 416 <td>" . $time . "</td> … … 422 422 </tr>"; 423 423 } 424 } 425 424 } 426 425 // options 427 426 $url_opts = array(); … … 622 621 function deleteVoicemailData($files) { 623 622 624 global $ARI_CRYPT_PASSWORD; 625 626 $crypt = new Crypt(); 627 628 foreach($files as $key => $pathCrypt) { 629 630 // decrypt path 631 $path = $crypt->decrypt($pathCrypt,$ARI_CRYPT_PASSWORD); 623 foreach($files as $key => $path) { 632 624 633 625 // get file parts for search … … 666 658 667 659 global $ASTERISK_VOICEMAIL_PATH; 668 global $ARI_CRYPT_PASSWORD;669 670 $crypt = new Crypt();671 660 672 661 $perm = fileperms($ASTERISK_VOICEMAIL_PATH); … … 723 712 } 724 713 725 foreach($files as $key => $pathCrypt) { 726 // decrypt path 727 $pathPlain = $crypt->decrypt($pathCrypt,$ARI_CRYPT_PASSWORD); 714 foreach($files as $key => $pathPlain) { 728 715 // add plain path to new array 729 716 $filesPlain[] = $pathPlain;
