Changeset 6165 for sandbox/webservice/api/rest/mail/DelFolderResource.php
- Timestamp:
- 05/11/12 10:38:02 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/webservice/api/rest/mail/DelFolderResource.php
r6155 r6165 11 11 12 12 if(!$this->getImap()->folder_exists($folder_id)) 13 throw new ResponseException("",Errors::MAIL_INVALID_FOLDER);13 Errors::runException("MAIL_INVALID_FOLDER"); 14 14 15 15 $default_folders = array_keys($this->defaultFolders); 16 16 if(in_array($folder_id, $default_folders)) 17 throw new ResponseException("",Errors::MAIL_CANNOT_DEL_DEFAULT_FOLDER);17 Errors::runException("MAIL_CANNOT_DEL_DEFAULT_FOLDER"); 18 18 19 19 $personal_folders = $this->getImap()->get_folders_list(array('noSharedFolders' => true, 'folderType' => 'personal')); … … 23 23 foreach($personal_folders AS $personal_folder){ 24 24 if($personal_folder['folder_id'] == $folder_id && $personal_folder['folder_hasChildren']) 25 throw new ResponseException("",Errors::MAIL_FOLDER_NOT_EMPTY);25 Errors::runException("MAIL_FOLDER_NOT_EMPTY"); 26 26 } 27 27 28 28 if($this->getImap()->get_num_msgs(array('folder' => $folder_id)) > 0) 29 throw new ResponseException("",Errors::MAIL_FOLDER_NOT_EMPTY);29 Errors::runException("MAIL_FOLDER_NOT_EMPTY"); 30 30 31 31 $result = $this->getImap()->delete_mailbox($params); 32 32 if($result != 'Ok') 33 throw new ResponseException("",Errors::MAIL_FOLDER_NOT_DELETED);33 Errors::runException("MAIL_FOLDER_NOT_DELETED"); 34 34 } 35 35
Note: See TracChangeset
for help on using the changeset viewer.