Changeset 4659

Show
Ignore:
Timestamp:
08/02/07 22:52:23 (1 year ago)
Author:
p_lindheimer
Message:

#1836 - remove mailbox form filesystem after deleting an extension

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.3/voicemail/functions.inc.php

    r4567 r4659  
    231231                break; 
    232232                case "del": 
     233                        // call remove before del, it needs to know context info 
     234                        // 
     235                        voicemail_mailbox_remove($extdisplay); 
    233236                        voicemail_mailbox_del($extdisplay); 
    234237                        needreload(); 
     
    260263         
    261264        return null; 
     265} 
     266 
     267function voicemail_mailbox_remove($mbox) { 
     268        global $amp_conf; 
     269        $uservm = voicemail_getVoicemail(); 
     270        $vmcontexts = array_keys($uservm); 
     271 
     272        $return = true; 
     273 
     274        foreach ($vmcontexts as $vmcontext) { 
     275                if(isset($uservm[$vmcontext][$mbox])){ 
     276 
     277                        $vm_dir = $amp_conf['ASTSPOOLDIR']."/voicemail/$vmcontext/$mbox"; 
     278                        exec("rm -rf $vm_dir",$output,$ret); 
     279                        if ($ret) { 
     280                                $return = false; 
     281                                $text   = sprintf(_("Failed to delete vmbox: %s@%s"),$mbox, $vmcontext); 
     282                                $etext  = sprintf(_("failed with retcode %s while removing %s:"),$ret, $vm_dir)."<br>"; 
     283                                $etext .= implode("<br>",$output); 
     284                                $nt =& notifications::create($db); 
     285                                $nt->add_error('voicemail', 'MBOXREMOVE', $text, $etext, '', true, true); 
     286                                // 
     287                                // TODO: this does not work but we should give some sort of feedback that id did not work 
     288                                // 
     289                                // echo "<script>javascript:alert('$text\n"._("See notification panel for details")."')</script>"; 
     290                        } 
     291                } 
     292        } 
     293        return $return;  
    262294} 
    263295 
  • modules/branches/2.3/voicemail/module.xml

    r4655 r4659  
    22        <rawname>voicemail</rawname> 
    33        <name>Voicemail</name> 
    4         <version>2.0.2.4</version> 
     4        <version>2.0.3</version> 
    55        <candisable>no</candisable> 
    66        <canuninstall>no</canuninstall> 
    77        <changelog> 
     8                *2.0.3* #1836 - remove mailbox form filesystem after deleting an extension 
    89                *2.0.2.4* changed install script to return false on astman not there 
    910                *2.0.2.3* remove setting vmcontext to department, fixed #2153 and #2136 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads