39 |
39 |
if (!isset($this->_profile[$key]))
|
40 |
40 |
$this->_profile[$key] = str_replace("*","", $this->functions->lang($value));
|
41 |
41 |
|
42 |
|
$this->_imap = imap_open('{'.$this->_profile['imapServer'].':'.$this->_profile['imapPort'].'/novalidate-cert}', $this->_profile['imapAdminUsername'], $this->_profile['imapAdminPW'], OP_HALFOPEN);
|
|
42 |
$this->_imap = imap_open('{'.$this->_profile['imapCreateMboxServer'].':'.$this->_profile['imapCreateMboxPort'].'/novalidate-cert}', $this->_profile['imapAdminUsername'], $this->_profile['imapAdminPW'], OP_HALFOPEN);
|
43 |
43 |
|
44 |
44 |
return $this->_profile;
|
45 |
45 |
}
|
... | ... | |
64 |
64 |
|
65 |
65 |
$mailquota = ( $mailquota === false )? $this->_profile['defaultUserQuota'] : $mailquota;
|
66 |
66 |
|
67 |
|
if (!imap_createmailbox($this->_imap, '{'.$this->_profile['imapServer'].'}' . "user" . $this->_profile['imapDelimiter'] . $uid))
|
|
67 |
if (!imap_createmailbox($this->_imap, '{'.$this->_profile['imapCreateMboxServer'].'}' . "user" . $this->_profile['imapDelimiter'] . $uid))
|
68 |
68 |
{
|
69 |
69 |
$error = imap_errors();
|
70 |
70 |
if ($error[0] == 'Mailbox already exists')
|
... | ... | |
79 |
79 |
return $result;
|
80 |
80 |
}
|
81 |
81 |
|
82 |
|
if ( (!empty($this->_profile['imapDefaultSentFolder'])) && (!imap_createmailbox($this->_imap, '{'.$this->_profile['imapServer'].'}' . "user" . $this->_profile['imapDelimiter'] . $uid . $this->_profile['imapDelimiter'] . $this->_profile['imapDefaultSentFolder'])) )
|
|
82 |
if ( (!empty($this->_profile['imapDefaultSentFolder'])) && (!imap_createmailbox($this->_imap, '{'.$this->_profile['imapCreateMboxServer'].'}' . "user" . $this->_profile['imapDelimiter'] . $uid . $this->_profile['imapDelimiter'] . $this->_profile['imapDefaultSentFolder'])) )
|
83 |
83 |
{
|
84 |
84 |
$error = imap_errors();
|
85 |
85 |
$result['status'] = false;
|
... | ... | |
87 |
87 |
return $result;
|
88 |
88 |
}
|
89 |
89 |
|
90 |
|
if ( (!empty($this->_profile['imapDefaultDraftsFolder'])) && (!imap_createmailbox($this->_imap, '{'.$this->_profile['imapServer'].'}' . "user" . $this->_profile['imapDelimiter'] . $uid . $this->_profile['imapDelimiter'] . $this->_profile['imapDefaultDraftsFolder'])) )
|
|
90 |
if ( (!empty($this->_profile['imapDefaultDraftsFolder'])) && (!imap_createmailbox($this->_imap, '{'.$this->_profile['imapCreateMboxServer'].'}' . "user" . $this->_profile['imapDelimiter'] . $uid . $this->_profile['imapDelimiter'] . $this->_profile['imapDefaultDraftsFolder'])) )
|
91 |
91 |
{
|
92 |
92 |
$error = imap_errors();
|
93 |
93 |
$result['status'] = false;
|
... | ... | |
95 |
95 |
return $result;
|
96 |
96 |
}
|
97 |
97 |
|
98 |
|
if ( (!empty($this->_profile['imapDefaultTrashFolder'])) && (!imap_createmailbox($this->_imap, '{'.$this->_profile['imapServer'].'}' . "user" . $this->_profile['imapDelimiter'] . $uid . $this->_profile['imapDelimiter'] . $this->_profile['imapDefaultTrashFolder'])) )
|
|
98 |
if ( (!empty($this->_profile['imapDefaultTrashFolder'])) && (!imap_createmailbox($this->_imap, '{'.$this->_profile['imapCreateMboxServer'].'}' . "user" . $this->_profile['imapDelimiter'] . $uid . $this->_profile['imapDelimiter'] . $this->_profile['imapDefaultTrashFolder'])) )
|
99 |
99 |
{
|
100 |
100 |
$error = imap_errors();
|
101 |
101 |
$result['status'] = false;
|
... | ... | |
205 |
205 |
return $result;
|
206 |
206 |
}
|
207 |
207 |
|
208 |
|
if (!imap_deletemailbox($this->_imap, '{'.$this->_profile['imapServer'].'}' . "user" . $this->_profile['imapDelimiter'] . $uid))
|
|
208 |
if (!imap_deletemailbox($this->_imap, '{'.$this->_profile['imapCreateMboxServer'].'}' . "user" . $this->_profile['imapDelimiter'] . $uid))
|
209 |
209 |
{
|
210 |
210 |
$result['status'] = false;
|
211 |
211 |
$result['msg'] = $this->functions->lang('it was not possible to delete users mailbox') . ".\n";
|
... | ... | |
274 |
274 |
}
|
275 |
275 |
|
276 |
276 |
if (! @imap_renamemailbox($this->_imap,
|
277 |
|
'{'.$this->_profile['imapServer'].':'.$this->_profile['imapPort'].'}user' . $this->_profile['imapDelimiter'] . $old_mailbox,
|
278 |
|
'{'.$this->_profile['imapServer'].':'.$this->_profile['imapPort'].'}user' . $this->_profile['imapDelimiter'] . $new_mailbox) )
|
|
277 |
'{'.$this->_profile['imapCreateMboxServer'].':'.$this->_profile['imapCreateMboxPort'].'}user' . $this->_profile['imapDelimiter'] . $old_mailbox,
|
|
278 |
'{'.$this->_profile['imapCreateMboxServer'].':'.$this->_profile['imapCreateMboxPort'].'}user' . $this->_profile['imapDelimiter'] . $new_mailbox) )
|
279 |
279 |
{
|
280 |
280 |
$result['status'] = false;
|
281 |
281 |
$result['msg'] = $this->functions->lang('Server returns') . ': ' . imap_last_error();
|
... | ... | |
291 |
291 |
$result['msg'] .= $this->functions->lang("Error returning user quota.\n") . $this->functions->lang('Server returns') . ': ' . imap_last_error();
|
292 |
292 |
|
293 |
293 |
@imap_renamemailbox($this->_imap,
|
294 |
|
'{'.$this->_profile['imapServer'].':'.$this->_profile['imapPort'].'}user' . $this->_profile['imapDelimiter'] . $new_mailbox,
|
295 |
|
'{'.$this->_profile['imapServer'].':'.$this->_profile['imapPort'].'}user' . $this->_profile['imapDelimiter'] . $old_mailbox);
|
|
294 |
'{'.$this->_profile['imapCreateMboxServer'].':'.$this->_profile['imapCreateMboxPort'].'}user' . $this->_profile['imapDelimiter'] . $new_mailbox,
|
|
295 |
'{'.$this->_profile['imapCreateMboxServer'].':'.$this->_profile['imapCreateMboxPort'].'}user' . $this->_profile['imapDelimiter'] . $old_mailbox);
|
296 |
296 |
}
|
297 |
297 |
}
|
298 |
298 |
|
... | ... | |
343 |
343 |
|
344 |
344 |
if ($return_setacl)
|
345 |
345 |
{
|
346 |
|
$mbox_stream = imap_open('{'.$this->_profile['imapServer'].':'.$this->_profile['imapPort'].$imap_options .'}user'. $this->_profile['imapDelimiter'] . $uid, $this->_profile['imapAdminUsername'], $this->_profile['imapAdminPW']);
|
|
346 |
$mbox_stream = imap_open('{'.$this->_profile['imapCreateMboxServer'].':'.$this->_profile['imapCreateMboxPort'].$imap_options .'}user'. $this->_profile['imapDelimiter'] . $uid, $this->_profile['imapAdminUsername'], $this->_profile['imapAdminPW']);
|
347 |
347 |
|
348 |
348 |
$check = imap_mailboxmsginfo($mbox_stream);
|
349 |
349 |
$inbox_size = (string)(round ((($check->Size)/(1024*1024)), 2));
|