コード例 #1
0
 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'])) {
         while ($mailbox = array_shift($subscribed)) {
             $subscribed_names[] = $mailbox['name'];
             $search_name = get_magic_quotes_gpc() ? addslashes($mailbox['name']) : $mailbox['name'];
             if (!in_array($search_name, $_POST['use']) && $mailbox['name'] != 'INBOX') {
                 if ($mail->unsubscribe($mailbox['name'])) {
                     $email->unsubscribe($account['id'], addslashes($mailbox['name']));
                 }
             }
         }
         for ($i = 0; $i < count($_POST['use']); $i++) {
             $must_be_subscribed = smartstrip($_POST['use'][$i]);
             if (!in_array($must_be_subscribed, $subscribed_names) && $must_be_subscribed != "INBOX") {
                 if ($mail->subscribe($must_be_subscribed)) {