$task = isset($_REQUEST['task']) ? $_REQUEST['task'] : ''; $return_to = isset($_REQUEST['return_to']) && $_REQUEST['return_to'] != '' ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER']; $link_back = isset($_REQUEST['link_back']) && $_REQUEST['link_back'] != '' ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI']; $account_id = isset($_REQUEST['account_id']) ? $_REQUEST['account_id'] : 0; $account = $email->get_account($account_id); 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)); } } }