Revision 6071,
1.2 KB
checked in by gustavo, 12 years ago
(diff) |
Ticket #2676 - Falha ao anexar arquivo no expresso mail
|
Rev | Line | |
---|
[5604] | 1 | <?php |
---|
| 2 | |
---|
| 3 | class Attachments { |
---|
| 4 | |
---|
[5637] | 5 | public function encodeCreateAttachment( &$uri , &$params , &$criteria , $original ){ |
---|
| 6 | if(!isset($params['source'])) return false; |
---|
[6071] | 7 | |
---|
[5637] | 8 | |
---|
| 9 | if(isset($_FILES[$params['source']])) |
---|
| 10 | $params = $_FILES[$params['source']]; |
---|
[6071] | 11 | |
---|
| 12 | if($params['error'] !== 0){ |
---|
| 13 | switch ($params['error']){ |
---|
| 14 | case 1: |
---|
| 15 | throw new Exception('Tamanho de arquivo nao permitido!!! (php.ini)'); |
---|
| 16 | case 2: |
---|
| 17 | throw new Exception('Tamanho de arquivo nao permitido!!!'); |
---|
| 18 | case 3: |
---|
| 19 | throw new Exception('Ocorreu um erro durante o upload'); |
---|
| 20 | case 4: |
---|
| 21 | throw new Exception('Nao e um arquivo valido'); |
---|
| 22 | } |
---|
| 23 | } |
---|
| 24 | |
---|
[5637] | 25 | $params['owner'] = Config::me('uidNumber'); |
---|
| 26 | |
---|
| 27 | $params['disposition'] = $original['properties']['disposition']; |
---|
| 28 | $params['dtstamp'] = time(); |
---|
[5604] | 29 | } |
---|
[5637] | 30 | |
---|
| 31 | public function securityOwner( &$uri , &$params , &$criteria , $original ) |
---|
| 32 | { |
---|
| 33 | $criteria['filter'] = isset( $criteria['filter'] ) ? array('AND', $criteria['filter'] , array('=' , 'owner', Config::me('uidNumber')) ) : array('=' , 'owner', Config::me('uidNumber')); |
---|
| 34 | } |
---|
| 35 | |
---|
[5604] | 36 | } |
---|
| 37 | |
---|
| 38 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.