Changeset 63 for trunk/expressoAdmin1_2/inc/class.imap_functions.inc.php
- Timestamp:
- 08/29/07 08:55:50 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.imap_functions.inc.php
r62 r63 1 1 <?php 2 3 include_once('class.functions.inc.php'); 2 4 3 5 class imap_functions 4 6 { 7 var $functions; 5 8 var $imap; 6 9 var $imapDelimiter; … … 17 20 $this->imapDelimiter= $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter']; 18 21 $this->imap = imap_open('{'.$this->imap_server.':'.$this->imap_port.'/novalidate-cert}', $this->imap_admin, $this->imap_passwd, OP_HALFOPEN); 22 $this->functions = new functions; 19 23 } 20 24 … … 72 76 else 73 77 { 74 $quota['mailquota'] = ($get_quota['limit'] / 1024);75 $quota['mailquota_used'] = ($get_quota['usage'] / 1024);78 $quota['mailquota'] = round (($get_quota['limit'] / 1024), 2); 79 $quota['mailquota_used'] = round (($get_quota['usage'] / 1024), 2); 76 80 } 77 81 … … 116 120 return $result; 117 121 } 122 123 function empty_inbox($params) 124 { 125 // Verifica o acesso do gerente 126 if (!$this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'empty_user_inbox')) 127 { 128 $result['status'] = false; 129 $result['msg'] = 'Você não tem acesso para executar esta operação.'; 130 return $result; 131 } 132 133 if ($_SESSION['phpgw_info']['expressomail']['email_server']['imapTLSEncryption'] == 'yes') 134 { 135 $imap_options = '/tls/novalidate-cert'; 136 } 137 else 138 { 139 $imap_options = '/notls/novalidate-cert'; 140 } 141 142 143 $result['status'] = true; 144 $uid = $params['uid']; 145 146 $return_setacl = imap_setacl($this->imap, "user" . $this->imapDelimiter . $uid, $this->imap_admin, 'lrswipcda'); 147 148 if ($return_setacl) 149 { 150 //$mbox_stream = imap_open('{'.$this->imap_server.':'.$this->imap_port.$imap_options.'/user="'.$uid.'"}', $this->imap_admin, $this->imap_passwd); 151 $mbox_stream = imap_open('{'.$this->imap_server.':'.$this->imap_port.$imap_options .'}user'. $this->imapDelimiter . $uid, $this->imap_admin, $this->imap_passwd); 152 153 $check = imap_mailboxmsginfo($mbox_stream); 154 $inbox_size = (string)(round ((($check->Size)/(1024*1024)), 2)); 155 156 $return_imap_delete = imap_delete($mbox_stream,'1:*'); 157 imap_close($mbox_stream, CL_EXPUNGE); 158 159 imap_setacl ($this->imap, "user" . $this->imapDelimiter . $uid, $this->imap_admin, ''); 160 161 if ($return_imap_delete) 162 { 163 $result['inbox_size'] = $inbox_size; 164 165 $get_user_quota = @imap_get_quotaroot($this->imap,"user" . $this->imapDelimiter . $uid); 166 $result['mailquota_used'] = (string)(round(($get_user_quota['usage']/1024), 2)); 167 } 168 else 169 { 170 $result['status'] = false; 171 $result['msg'] = "Nao foi possivel esvaziar a caixa postal do usuario:\n" . imap_last_error(); 172 } 173 } 174 else 175 { 176 $result['status'] = false; 177 $result['msg'] = "Nao foi possivel modificar a acl do usuario:\n" . imap_last_error(); 178 } 179 return $result; 180 } 118 181 }
Note: See TracChangeset
for help on using the changeset viewer.