...
|
...
|
@@ -4,6 +4,8 @@ namespace Controller; |
|
|
|
|
|
|
|
|
use Lib\Err;
|
|
|
use Lib\Imap\ImapConfig;
|
|
|
use Lib\Imap\ImapPool;
|
|
|
use Lib\Mail\Mail;
|
|
|
use Lib\Mail\MailFun;
|
|
|
use Model\folderSql;
|
...
|
...
|
@@ -157,27 +159,24 @@ class Folder extends Base { |
|
|
app()->e('folder_is_exist');
|
|
|
}
|
|
|
|
|
|
// 远程创建
|
|
|
$mail = new Mail(
|
|
|
$email['email'],
|
|
|
base64_decode($email['password']),
|
|
|
$email['imap']
|
|
|
);
|
|
|
$email['password'] = base64_decode($email['password']);
|
|
|
$email['host'] = $email['imap'];
|
|
|
$imap = ImapPool::get(new ImapConfig($email));
|
|
|
|
|
|
if($mail->login()!=1){
|
|
|
if($imap->login()->isOk()){
|
|
|
app()->e('login_error_imap');
|
|
|
}
|
|
|
|
|
|
if($id){
|
|
|
// 远程创建
|
|
|
$ret = $mail->client->folderRename($folder['origin_folder'],$origin_folder);
|
|
|
$ret = $imap->folder($folder['origin_folder'])->rename($origin_folder);
|
|
|
|
|
|
}else{
|
|
|
// 远程创建
|
|
|
$ret = $mail->client->folderCreate($origin_folder);
|
|
|
$ret = $imap->folder($origin_folder)->create();
|
|
|
}
|
|
|
|
|
|
if($ret[0] === false){
|
|
|
if(!$ret){
|
|
|
app()->e($ret[1]);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -256,19 +255,18 @@ class Folder extends Base { |
|
|
app()->e('folder_delete_exist_mail');
|
|
|
}
|
|
|
|
|
|
// 远程创建
|
|
|
$mail = new Mail(
|
|
|
$email['email'],
|
|
|
base64_decode($email['password']),
|
|
|
$email['imap']
|
|
|
);
|
|
|
$email['password'] = base64_decode($email['password']);
|
|
|
$email['host'] = $email['imap'];
|
|
|
$imap = ImapPool::get(new ImapConfig($email));
|
|
|
|
|
|
if($mail->login()!=1){
|
|
|
if($imap->login()->isOk()){
|
|
|
app()->e('login_error_imap');
|
|
|
}
|
|
|
|
|
|
// 远程创建
|
|
|
$ret = $mail->client->folderDelete($folder['origin_folder']);
|
|
|
$f = $imap->folder($folder['origin_folder']);
|
|
|
if(!$f->delete()){
|
|
|
app()->e($f->getMessage());
|
|
|
}
|
|
|
|
|
|
$row = db()->delete(folderSql::$table,[
|
|
|
'id' => $folder['id']
|
...
|
...
|
|