Exemplo n.º 1
0
if ($account && $mail->open($account['host'], $account['type'], $account['port'], $account['username'], $GO_CRYPTO->decrypt($account['password']), 'INBOX', 0, $account['use_ssl'], $account['novalidate_cert'])) {
    if ($task == 'create_folder') {
        $name = smartstrip(trim($_POST['name']));
        if ($name == '') {
            $feedback = '<p class="Error">' . $error_missing_field . '</p>';
        } else {
            $parent_folder_name = isset($_POST['parent_folder_name']) ? smartstrip($_POST['parent_folder_name']) : '';
            if ($parent_folder_name != '' && substr($parent_folder_name, -1) != $_POST['delimiter']) {
                $parent_folder_name .= $_POST['delimiter'];
            }
            $mail->create_folder($parent_folder_name . $name);
        }
    }
    if (isset($_REQUEST['delete_folder'])) {
        $delete_folder = smartstrip($_REQUEST['delete_folder']);
        if ($mail->delete_folder($delete_folder, $account['mbroot'])) {
            /*
            	(cyrus imap) if folder still exists then don't delete it from the
            	database,
            	because it contains at least one child mailbox
            */
            if (!is_array($mail->get_mailboxes($delete_folder))) {
                $email->delete_folder($account['id'], addslashes($delete_folder));
            }
        }
    }
    $edit_name = isset($_REQUEST['edit_name']) ? smart_addslashes($_REQUEST['edit_name']) : '';
    if ($task == 'save') {
        $subscribed = $mail->get_subscribed();
        $subscribed_names = array();
        if (isset($_POST['use'])) {