X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders.php;h=015a862cc21788beb64411a7279ea0f0fd62b6e1;hb=cd7b8833879bcf92e21ba7f2da527493358fdda5;hp=9d97a42410b6e4dcc6eaa767b7c05fefcd2bfff4;hpb=15e6162eacc97158393bc75aed3afeb7b19c24a6;p=squirrelmail.git diff --git a/src/folders.php b/src/folders.php index 9d97a424..015a862c 100644 --- a/src/folders.php +++ b/src/folders.php @@ -13,28 +13,12 @@ * $Id$ */ -/*****************************************************************/ -/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/ -/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/ -/*** + Base level indent should begin at left margin, as ***/ -/*** the require_once below looks. ***/ -/*** + All identation should consist of four space blocks ***/ -/*** + Tab characters are evil. ***/ -/*** + all comments should use "slash-star ... star-slash" ***/ -/*** style -- no pound characters, no slash-slash style ***/ -/*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/ -/*** ALWAYS USE { AND } CHARACTERS!!! ***/ -/*** + Please use ' instead of ", when possible. Note " ***/ -/*** should always be used in _( ) function calls. ***/ -/*** Thank you for your help making the SM code more readable. ***/ -/*****************************************************************/ - require_once('../src/validate.php'); require_once('../functions/imap.php'); require_once('../functions/array.php'); require_once('../functions/plugin.php'); - displayPageHeader($color, 'None'); +displayPageHeader($color, 'None'); ?> @@ -42,247 +26,248 @@ require_once('../functions/plugin.php');
-
+
\n"; - } - $imapConnection = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 0); - $boxes = sqimap_mailbox_list($imapConnection); - - /** DELETING FOLDERS **/ - echo "
| \n";
+} else {
+ echo _("No folders were found to unsubscribe from!") . "";
+}
+$boxes_sub = $boxes;
+
+/** SUBSCRIBE TO FOLDERS **/
+echo "";
+$imap_stream = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 1);
+$boxes_all = sqimap_mailbox_list_all ($imap_stream);
+
+$box = "";
+$box2 = "";
+for ($i = 0, $q = 0; $i < count($boxes_all); $i++) {
+ $use_folder = true;
+ for ($p = 0; $p < count ($boxes); $p++) {
+ if ($boxes_all[$i]["unformatted"] == $boxes[$p]["unformatted"]) {
+ $use_folder = false;
+ continue;
+ } else if ($boxes_all[$i]["unformatted-dm"] == $folder_prefix) {
+ $use_folder = false;
+ }
+ }
+ if ($use_folder == true) {
+ $box[$q] = $boxes_all[$i]["unformatted-dm"];
+ $box2[$q] = $boxes_all[$i]["unformatted-disp"];
+ $q++;
+ }
+}
+sqimap_logout($imap_stream);
+
+if ($box && $box2) {
+ echo " "; + echo "\n"; + echo " |