Revision 6071,
1.2 KB
checked in by gustavo, 12 years ago
(diff) |
Ticket #2676 - Falha ao anexar arquivo no expresso mail
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | class Attachments { |
---|
4 | |
---|
5 | public function encodeCreateAttachment( &$uri , &$params , &$criteria , $original ){ |
---|
6 | if(!isset($params['source'])) return false; |
---|
7 | |
---|
8 | |
---|
9 | if(isset($_FILES[$params['source']])) |
---|
10 | $params = $_FILES[$params['source']]; |
---|
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 | |
---|
25 | $params['owner'] = Config::me('uidNumber'); |
---|
26 | |
---|
27 | $params['disposition'] = $original['properties']['disposition']; |
---|
28 | $params['dtstamp'] = time(); |
---|
29 | } |
---|
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 | |
---|
36 | } |
---|
37 | |
---|
38 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.