phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: email/inc class.mail_msg_base.inc.php,1.60,1.61


From: Angelo Tony Puglisi <address@hidden>
Subject: [Phpgroupware-cvs] CVS: email/inc class.mail_msg_base.inc.php,1.60,1.61 class.mail_msg_wrappers.inc.php,1.22,1.23
Date: Sat, 12 Jan 2002 05:02:30 -0500

Update of /cvsroot/phpgroupware//email/inc
In directory subversions:/tmp/cvs-serv19711/email/inc

Modified Files:
        class.mail_msg_base.inc.php class.mail_msg_wrappers.inc.php 
Log Message:
consolidate and spin off account and folder detection from begin request 
function

Index: class.mail_msg_base.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_base.inc.php,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -r1.60 -r1.61
*** class.mail_msg_base.inc.php 12 Jan 2002 02:38:14 -0000      1.60
--- class.mail_msg_base.inc.php 12 Jan 2002 10:02:27 -0000      1.61
***************
*** 87,91 ****
        
        // DEBUG FLAGS generally take int 0, 1, 2, or 3
!       var $debug_logins = 0;
        var $debug_session_caching = 0;
        var $debug_longterm_caching = 0;
--- 87,91 ----
        
        // DEBUG FLAGS generally take int 0, 1, 2, or 3
!       var $debug_logins =0;
        var $debug_session_caching = 0;
        var $debug_longterm_caching = 0;
***************
*** 402,418 ****
                        'mailsvr_stream',
                        'mailsvr_account_username',
-                       
-                       /*
-                       // DEPRECIATED
-                       // these are the supported menuaction strings
-                       'index_menuaction',
-                       'mlist_menuaction',
-                       // for message delete or move
-                       'delmov_menuaction',
-                       'folder_menuaction',
-                       'send_menuaction',
-                       'get_attach_menuaction',
-                       'view_html_menuaction',
-                       */
                        // use this uri in any auto-refresh request - filled 
during "fill_sort_order_start_msgnum()"
                        'index_refresh_uri',
--- 402,405 ----
***************
*** 423,426 ****
--- 410,414 ----
        }
        
+       // currently unused, concept in transation
        function is_logged_in()
        {
***************
*** 499,579 ****
                // or better yet: IF RE-USING YOU BETTER FEED THE DESIRED 
FOLDER IN "$args_array['fldball']['folder'] " or ['msgball']['folder']
                // IF RE-USING YOU BETTER MAKE SURE THE CORRECT ACCTNUM IS SET 
via "get_acctnum"/"set_acctnum"
-               if ($this->debug_logins > 1) { echo 'mail_msg: begin_request: 
get acctnum from feed args if possible<br>'; }
-               $found_acctnum = False;
-               while(list($key,$value) = each($args_array))
-               {
-                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: (acctnum search) this loop feed arg : ['.$key.'] => 
['.serialize($args_array[$key]).'] <br>'; }
-                       // try to find feed acctnum value
-                       if ($key == 'fldball')
-                       {
-                               $fldball = $args_array[$key];
-                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: (acctnum search) feed args passed in $fldball[] : 
'.serialize($fldball).'<br>'; }
-                               $acctnum = (int)$fldball['acctnum'];
-                               
-                               // SET OUR ACCTNUM ACCORDING TO FEED ARGS
-                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: (acctnum search) SETTING ACCTNUM from fldball : 
['.$acctnum.']<br>'; }
-                               $this->set_acctnum($acctnum);
-                               $found_acctnum = True;
-                               break;
-                       }
-                       elseif ($key == 'msgball')
-                       {
-                               $msgball = $args_array[$key];
-                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: (acctnum search) feed args passed in $msgball[] : 
'.serialize($msgball).'<br>'; }
-                               $acctnum = (int)$msgball['acctnum'];
-                               // SET OUR ACCTNUM ACCORDING TO FEED ARGS
-                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: (acctnum search) SETTING ACCTNUM from msgball : 
['.$acctnum.']<br>'; }
-                               $this->set_acctnum($acctnum);
-                               $found_acctnum = True;
-                               break;
-                       }
-                       elseif ($key == 'acctnum')
-                       {
-                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: (acctnum search) feed args passed in "acctnum" : 
'.serialize($args_array[$key]).'<br>'; }
-                               $acctnum = (int)$args_array[$key];
-                               // SET OUR ACCTNUM ACCORDING TO FEED ARGS
-                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: (acctnum search) SETTING ACCTNUM from "acctnum" feed args : 
['.$acctnum.']<br>'; }
-                               $this->set_acctnum($acctnum);
-                               $found_acctnum = True;
-                               break;
-                       }
-               }
-               if ($this->debug_logins > 1) { echo 'mail_msg: begin_request: 
(acctnum search) locate acctnum in feed args $found_acctnum boolean result: 
['.serialize($found_acctnum).'] <br>'; }
-               
-               // grab GPC values, only pass an acctnumm to that function if 
we already found it
-               if ($found_acctnum == True)
-               {
-                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: grab_class_args_gpc, if called, will be called WITH already 
found acctnum: ('.serialize($acctnum).')<br>'; }
-                       $feed_acctnum = $acctnum;
-                       //$this->grab_class_args_gpc($acctnum);
-               }
-               else
-               {
-                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: grab_class_args_gpc, if called,  will be called with NO acctnum 
yet having been found<br>'; }
-                       $feed_acctnum = '';
-                       //$this->grab_class_args_gpc();
-               }
                
!               // Grab GPC vars, they'll go into the "args" data
!               // feed the $feed_acctnum to the function
!               // Note: which acctnum arg array would this be talking to?
!               if ( ($this->get_isset_arg('already_grab_class_args_gpc', 
$feed_acctnum))
!               && ((string)$this->get_arg_value('already_grab_class_args_gpc', 
$feed_acctnum) != '') )
                {
                        // somewhere, there's already been a call to 
grab_class_args_gpc(), do NOT re-run
                        if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: "already_grab_class_args_gpc" is set, do not re-grab<br>'; }
                        if ($this->debug_logins > 2) { echo 'mail_msg: 
begin_request: "already_grab_class_args_gpc" pre-existing $this->get_all_args() 
dump:<pre>'; print_r($this->get_all_args()) ; echo '</pre>';}
                }
                else
                {
                        if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: "already_grab_class_args_gpc" is NOT set, call 
grab_class_args_gpc() now<br>'; }
!                       $this->grab_class_args_gpc($feed_acctnum);
                }
                
!               if ($this->debug_logins > 2) { echo 'mail_msg: begin_request: 
POST "grab_class_args_gpc": $this->get_all_args() dump <pre>';  
print_r($this->get_all_args()); echo '</pre>'; }
!               // grab_class_args_gpc will look for an acctnum in GPC values 
if one is not yet found
!               // grab_class_args_gpc will ASSIGN A DEFAULT acctnum if NONE is 
foud anywhere
!               // so by now, WE HAVE AN ACCT NUM
!               if ($this->debug_logins > 1) { echo 'mail_msg: begin_request: 
POST "grab_class_args_gpc": $this->get_acctnum() returns: 
'.serialize($this->get_acctnum()).'<br>'; }
                
                /*
--- 487,525 ----
                // or better yet: IF RE-USING YOU BETTER FEED THE DESIRED 
FOLDER IN "$args_array['fldball']['folder'] " or ['msgball']['folder']
                // IF RE-USING YOU BETTER MAKE SURE THE CORRECT ACCTNUM IS SET 
via "get_acctnum"/"set_acctnum"
                
!               // Grab GPC vars, after we get an acctnum, we'll put them in 
the appropriate account's "args" data
!               // issue?: which acctnum arg array would this be talking to 
when we inquire about "already_grab_class_args_gpc"?
!               if ( ($this->get_isset_arg('already_grab_class_args_gpc'))
!               && ((string)$this->get_arg_value('already_grab_class_args_gpc') 
!= '') )
                {
                        // somewhere, there's already been a call to 
grab_class_args_gpc(), do NOT re-run
                        if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: "already_grab_class_args_gpc" is set, do not re-grab<br>'; }
                        if ($this->debug_logins > 2) { echo 'mail_msg: 
begin_request: "already_grab_class_args_gpc" pre-existing $this->get_all_args() 
dump:<pre>'; print_r($this->get_all_args()) ; echo '</pre>';}
+                       $got_args=array();
                }
                else
                {
                        if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: "already_grab_class_args_gpc" is NOT set, call 
grab_class_args_gpc() now<br>'; }
!                       $got_args=array();
!                       $got_args = $this->grab_class_args_gpc();
                }
                
!               // FIND THE "BEST ACCTNUM" and set it
!               if ($this->debug_logins > 1) { echo 'mail_msg: begin_request: 
about to call:  get_best_acctnum_and_set_it($args_array, $got_args) <br>'; }
!               $acctnum = $this->get_best_acctnum_and_set_it($args_array, 
$got_args);
!               if ($this->debug_logins > 1) { echo 'mail_msg: begin_request: 
"get_best_acctnum_and_set_it" returns $acctnum ['.$acctnum.']<br>'; }
!               
!               // SET GOT_ARGS TO THAT ACCTNUM
!               // use that acctnum to set "got_args" to the appropiate acctnum
!               if ($this->debug_logins > 1) { echo 'mail_msg: begin_request: 
about to call: $this->set_arg_array($got_args); <br>'; }
!               $this->set_arg_array($got_args, $acctnum);
!               if ($this->debug_logins > 2) { echo 'mail_msg: begin_request: 
post set_arg_array $this->get_all_args() dump:<pre>'; 
print_r($this->get_all_args()) ; echo '</pre>';}
!               
!               // Initialize Internal Args
!               if ($this->debug_logins > 1) { echo 'mail_msg: begin_request: 
about to call: "init_internal_args_and_set_them('.$acctnum.')"<br>'; }
!               $this->init_internal_args_and_set_them($acctnum);
!               
!               if ($this->debug_logins > 2) { echo 'mail_msg: begin_request: 
POST "grab_class_args_gpc", "get_best_acctnum_and_set_it", and 
"init_internal_args_and_set_them" : this->get_all_args() dump:<pre>'; 
print_r($this->get_all_args()) ; echo '</pre>';}
!               
                
                /*
***************
*** 874,883 ****
                        $this_server_type = 
$this->get_pref_value('mail_server_type');
                        // ok, now put that object into the array
!                       $this_acctnum = $this->get_acctnum();
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: creating new dcom_holder at 
$GLOBALS["phpgw_dcom_".$this_acctnum('.$this_acctnum.')] = new 
mail_dcom_holder'.'<br>'; }
!                       $GLOBALS['phpgw_dcom_'.$this_acctnum] = new 
mail_dcom_holder;
!                       $GLOBALS['phpgw_dcom_'.$this_acctnum]->dcom = 
CreateObject("email.mail_dcom", $this_server_type);
                        // initialize the dcom class variables
!                       
$GLOBALS['phpgw_dcom_'.$this_acctnum]->dcom->mail_dcom_base();
                        
                        // ----  there are 2 settings from this mail_msg object 
we need to pass down to the child dcom object:  ----
--- 820,829 ----
                        $this_server_type = 
$this->get_pref_value('mail_server_type');
                        // ok, now put that object into the array
!                       //$this_acctnum = $this->get_acctnum();
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: creating new dcom_holder at $GLOBALS[phpgw_dcom_'.$acctnum.'] = 
new mail_dcom_holder'.'<br>'; }
!                       $GLOBALS['phpgw_dcom_'.$acctnum] = new mail_dcom_holder;
!                       $GLOBALS['phpgw_dcom_'.$acctnum]->dcom = 
CreateObject("email.mail_dcom", $this_server_type);
                        // initialize the dcom class variables
!                       
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->mail_dcom_base();
                        
                        // ----  there are 2 settings from this mail_msg object 
we need to pass down to the child dcom object:  ----
***************
*** 886,895 ****
                        && ($this->get_pref_value('enable_utf7')))
                        {
!                               
$GLOBALS['phpgw_dcom_'.$this_acctnum]->dcom->enable_utf7 = True;
                        }
                        // (2)  Do We Force use of msg UID's
                        if ($this->force_msg_uids == True)
                        {
!                               
$GLOBALS['phpgw_dcom_'.$this_acctnum]->dcom->force_msg_uids = True;
                        }
                        
--- 832,841 ----
                        && ($this->get_pref_value('enable_utf7')))
                        {
!                               
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->enable_utf7 = True;
                        }
                        // (2)  Do We Force use of msg UID's
                        if ($this->force_msg_uids == True)
                        {
!                               
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->force_msg_uids = True;
                        }
                        
***************
*** 897,902 ****
                        // login to INBOX because we know that always(?) should 
exist on an imap server and pop server
                        // after we are logged in we can get additional info 
that will lead us to the desired folder (if not INBOX)
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: about to call dcom->open: 
$GLOBALS["phpgw_dcom_".$this_acctnum('.$this_acctnum.')]->dcom->open('.$mailsvr_callstr."INBOX".',
 '.$user.', '.$pass.', )'.'<br>'; }
!                       $mailsvr_stream = 
$GLOBALS['phpgw_dcom_'.$this_acctnum]->dcom->open($mailsvr_callstr."INBOX", 
$user, $pass, '');
                        $pass = '';
                        set_time_limit(0);
--- 843,848 ----
                        // login to INBOX because we know that always(?) should 
exist on an imap server and pop server
                        // after we are logged in we can get additional info 
that will lead us to the desired folder (if not INBOX)
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: about to call dcom->open: 
$GLOBALS["phpgw_dcom_".$acctnum('.$acctnum.')]->dcom->open('.$mailsvr_callstr."INBOX".',
 '.$user.', '.$pass.', )'.'<br>'; }
!                       $mailsvr_stream = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->open($mailsvr_callstr."INBOX", $user, 
$pass, '');
                        $pass = '';
                        set_time_limit(0);
***************
*** 916,921 ****
                        
                        // SUCCESS - we are logged in to the server, at least 
we got to "INBOX"
!                       $this->set_arg_value('mailsvr_stream', $mailsvr_stream);
!                       $this->set_arg_value('mailsvr_account_username', $user);
                        // BUT if "folder" != "INBOX" we still have to "reopen" 
the stream to that "folder"
                        
--- 862,867 ----
                        
                        // SUCCESS - we are logged in to the server, at least 
we got to "INBOX"
!                       $this->set_arg_value('mailsvr_stream', $mailsvr_stream, 
$acctnum);
!                       $this->set_arg_value('mailsvr_account_username', $user, 
$acctnum);
                        // BUT if "folder" != "INBOX" we still have to "reopen" 
the stream to that "folder"
                        
***************
*** 927,990 ****
                        if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $mailsvr_delimiter: '.serialize($mailsvr_delimiter).'<br>'; }
                        
!                       //  ----  Get Folder Value  ----
!                       // ORDER OF PREFERENCE for pre-processed "folder" input 
arg
!                       // (1) $args_array, IF FILLED, overrides any previous 
data or any other data source, look for these:
!                       //      $args_array['msgball']['folder']
!                       //      $args_array['fldball']['folder']
!                       //      $args_array['folder']
!                       // (2) GPC ['msgball']['folder']
!                       // (3) GPC ['fldball']['folder']
!                       // (4) if "folder" arg it is already set, (probably 
during the reuse attempt, probably obtained from $args_array alreadt) then use 
that
!                       // (5) default to blank string, which 
"prep_folder_in()" changes to defaultg value INBOX
!                       
!                       // note: it's OK to send blank string to 
"prep_folder_in", because it will return a default value of "INBOX"
!                       if ((isset($args_array['folder']))
!                       && ($args_array['folder'] != ''))
!                       {
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $input_folder_arg chooses $args_array[folder] 
('.$args_array['folder'].') over any existing "folder" arg<br>'; }
!                               $input_folder_arg = $args_array['folder'];
!                       }
!                       elseif ($this->get_isset_arg('["msgball"]["folder"]'))
!                       {
!                               $input_folder_arg = 
$this->get_arg_value('["msgball"]["folder"]');
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $input_folder_arg chooses 
$this->get_arg_value(["msgball"]["folder"]): ['.$input_folder_arg.']<br>'; }
!                       }
!                       elseif ($this->get_isset_arg('["fldball"]["folder"]'))
!                       {
!                               $input_folder_arg = 
$this->get_arg_value('["fldball"]["folder"]');
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $input_folder_arg chooses 
$this->get_arg_value(["fldball"]["folder"]): ['.$input_folder_arg.']<br>'; }
!                       }
!                       elseif ($this->get_isset_arg('delmov_list'))
!                       {
!                               $this_delmov_list = 
$this->get_arg_value('delmov_list');
!                               $input_folder_arg = 
$this_delmov_list[0]['folder'];
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $input_folder_arg chooses $this_delmov_list[0][folder]: 
['.$input_folder_arg.']<br>'; }
!                       }
!                       else
!                       {
!                               if (($this->get_isset_arg('folder'))
!                               && 
((string)trim($this->get_arg_value('folder')) != ''))
!                               {
!                                       $input_folder_arg = 
$this->get_arg_value('folder');
!                               }
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $input_folder_arg *might* chooses $this->get_arg_value(folder): 
['.serialize($input_folder_arg).']<br>'; }
!                               
!                               $input_folder_arg = (string)$input_folder_arg;
!                               $input_folder_arg = trim($input_folder_arg);
!                               if ($input_folder_arg != '')
!                               {
!                                       if ($this->debug_logins > 1) { echo 
'mail_msg: begin_request: $this->get_arg_value(folder) passes test, so 
$input_folder_arg chooses $this->get_arg_value(folder): 
['.serialize($input_folder_arg).']<br>'; }
!                               }
!                               else
!                               {
!                                       if ($this->debug_logins > 1) { echo 
'mail_msg: begin_request: no folder value found, so $input_folder_arg takes an 
empty string<br>'; }
!                                       $input_folder_arg = '';
!                               }
!                       }
!                       // ---- Prep the Folder Name (remove encodings, verify 
it's long name (with namespace)
!                       // folder prepping does a lookup which requires a 
folder list which *usually* (unless caching) requires a login
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: about to issue $processed_folder_arg = 
$this->prep_folder_in('.$input_folder_arg.')<br>'; }
!                       $processed_folder_arg = 
$this->prep_folder_in($input_folder_arg);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $processed_folder_arg value: ['.$processed_folder_arg.']<br>'; }
                        
                        // ---- Switch To Desired Folder If Necessary  ----
--- 873,882 ----
                        if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: $mailsvr_delimiter: '.serialize($mailsvr_delimiter).'<br>'; }
                        
!                       
!                       // FIND FOLDER VALUE
!                       // get best available, most legit, folder value that we 
can find, and prep it in
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: about to call: "get_best_folder_arg($args_array, $got_args, 
$acctnum(='.$acctnum.'))"<br>'; }
!                       $processed_folder_arg = 
$this->get_best_folder_arg($args_array, $got_args, $acctnum);
!                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: "get_best_folder_arg" returns $processed_folder_arg 
['.htmlspecialchars(serialize($processed_folder_arg)).']<br>'; }
                        
                        // ---- Switch To Desired Folder If Necessary  ----
***************
*** 993,998 ****
                                // NO need to switch to another folder
                                // put this $processed_folder_arg in arg 
"folder", replacing any unprocessed value that may have been there
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: NO need to switch folders, about to issue: 
$this->set_arg_value("folder", '.$processed_folder_arg.')<br>'; }
!                               $this->set_arg_value('folder', 
$processed_folder_arg);
                        }
                        else
--- 885,890 ----
                                // NO need to switch to another folder
                                // put this $processed_folder_arg in arg 
"folder", replacing any unprocessed value that may have been there
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: NO need to switch folders, about to issue: 
$this->set_arg_value("folder", '.$processed_folder_arg.', 
'.serialize($acctnum).')<br>'; }
!                               $this->set_arg_value('folder', 
$processed_folder_arg, $acctnum);
                        }
                        else
***************
*** 1000,1006 ****
                                // switch to the desired folder now that we are 
sure we have it's official name
                                if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: need to switch folders (reopen) from INBOX to 
$processed_folder_arg: '.$processed_folder_arg.'<br>';}
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: about to issue: 
$this->a['.$this->acctnum.'][dcom]->reopen('.$mailsvr_stream.', 
'.$mailsvr_callstr.$processed_folder_arg,', )'.'<br>';}
                                //$did_reopen = 
$tmp_a['dcom']->reopen($mailsvr_stream, $mailsvr_callstr.$processed_folder_arg, 
'');
!                               $did_reopen = 
$GLOBALS['phpgw_dcom_'.$this_acctnum]->dcom->reopen($mailsvr_stream, 
$mailsvr_callstr.$processed_folder_arg, '');
                                if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: reopen returns: '.serialize($did_reopen).'<br>';}
                                // error check
--- 892,898 ----
                                // switch to the desired folder now that we are 
sure we have it's official name
                                if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: need to switch folders (reopen) from INBOX to 
$processed_folder_arg: '.$processed_folder_arg.'<br>';}
!                               if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: about to issue: 
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->reopen('.$mailsvr_stream.', 
'.$mailsvr_callstr.$processed_folder_arg,', )'.'<br>';}
                                //$did_reopen = 
$tmp_a['dcom']->reopen($mailsvr_stream, $mailsvr_callstr.$processed_folder_arg, 
'');
!                               $did_reopen = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->reopen($mailsvr_stream, 
$mailsvr_callstr.$processed_folder_arg, '');
                                if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: reopen returns: '.serialize($did_reopen).'<br>';}
                                // error check
***************
*** 1016,1023 ****
                                        if ($this->debug_logins > 1) { echo 
'mail_msg: begin_request: Successful switch folders (reopen) from (default 
initial folder) INBOX to ['.$processed_folder_arg.']<br>';}
                                        // put this $processed_folder_arg in 
arg "folder", since we were able to successfully switch folders
!                                       if ($this->debug_logins > 1) { echo 
'mail_msg: begin_request: switched folders (via reopen), about to issue: 
$this->set_arg_value("folder", '.$processed_folder_arg.')<br>'; }
!                                       $this->set_arg_value('folder', 
$processed_folder_arg);
                                }
                        }
                        // ----  Process "sort" "order" "start" and "msgnum" 
GPC args (if any) passed to the script  -----
                        // these args are so fundamental, they get stored in 
their own class vars
--- 908,916 ----
                                        if ($this->debug_logins > 1) { echo 
'mail_msg: begin_request: Successful switch folders (reopen) from (default 
initial folder) INBOX to ['.$processed_folder_arg.']<br>';}
                                        // put this $processed_folder_arg in 
arg "folder", since we were able to successfully switch folders
!                                       if ($this->debug_logins > 1) { echo 
'mail_msg: begin_request: switched folders (via reopen), about to issue: 
$this->set_arg_value("folder", '.$processed_folder_arg.', 
$acctnum(='.$acctnum.'))<br>'; }
!                                       $this->set_arg_value('folder', 
$processed_folder_arg, $acctnum);
                                }
                        }
+                       
                        // ----  Process "sort" "order" "start" and "msgnum" 
GPC args (if any) passed to the script  -----
                        // these args are so fundamental, they get stored in 
their own class vars
***************
*** 1028,1032 ****
                        // now we have folder, sort and order, make a URI for 
auto-refresh use
                        // we can NOT put "start" in auto refresh or user may 
not see the 1st index page on refresh
!                       $this->index_refresh_uri = 
                                'menuaction=email.uiindex.index'
                                .'&fldball[folder]='.$this->prep_folder_out()
--- 921,925 ----
                        // now we have folder, sort and order, make a URI for 
auto-refresh use
                        // we can NOT put "start" in auto refresh or user may 
not see the 1st index page on refresh
!                       $this_index_refresh_uri = 
                                'menuaction=email.uiindex.index'
                                .'&fldball[folder]='.$this->prep_folder_out()
***************
*** 1034,1037 ****
--- 927,932 ----
                                .'&sort='.$this->get_arg_value('sort')
                                .'&order='.$this->get_arg_value('order');
+                       if ($this->debug_logins > 1) { echo 'mail_msg: 
begin_request: about to call $this->set_arg_value(index_refresh_uri, 
$this_index_refresh_uri, $acctnum(='.$acctnum.')); ; where 
$this_index_refresh_uri: '.htmlspecialchars($this_index_refresh_uri).'<br>'; }
+                       $this->set_arg_value('index_refresh_uri', 
$this_index_refresh_uri, $acctnum);
                        
                        if ($this->debug_logins > 2) { echo 'mail_msg: 
begin_request: about to leave, direct access dump of $this->a  :<pre>'; 
print_r($this->a) ; echo '</pre>';}
***************
*** 1039,1043 ****
                        // returning this is vestigal, not really necessary, 
but do it anyway
                        // it's importance is that it returns something other 
then "False" on success
!                       return $this->get_arg_value('mailsvr_stream');
                }
        }
--- 934,938 ----
                        // returning this is vestigal, not really necessary, 
but do it anyway
                        // it's importance is that it returns something other 
then "False" on success
!                       return $this->get_arg_value('mailsvr_stream', $acctnum);
                }
        }
***************
*** 1047,1051 ****
                // args array currently not used
                if ($this->debug_logins > 0) { echo 'mail_msg: end_request: 
ENTERING'.'<br>';}
!               if ($this->debug_logins > 2) { echo 'mail_msg: end_request: 
direct access info dump of $this->a  :<pre>'; print_r($this->a) ; echo 
'</pre>';}
                
                if (($this->get_isset_arg('mailsvr_stream') == True)
--- 942,946 ----
                // args array currently not used
                if ($this->debug_logins > 0) { echo 'mail_msg: end_request: 
ENTERING'.'<br>';}
!               //if ($this->debug_logins > 2) { echo 'mail_msg: end_request: 
direct access info dump of $this->a  :<pre>'; print_r($this->a) ; echo 
'</pre>';}
                
                if (($this->get_isset_arg('mailsvr_stream') == True)

Index: class.mail_msg_wrappers.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_wrappers.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** class.mail_msg_wrappers.inc.php     12 Jan 2002 02:38:14 -0000      1.22
--- class.mail_msg_wrappers.inc.php     12 Jan 2002 10:02:27 -0000      1.23
***************
*** 690,693 ****
--- 690,699 ----
                }
                
+               
/**************************************************************************\
+               * END DCOM WRAPERS                                              
                *
+               * - - - - - - - - - - - - - - - - - - - - - - - - -             
                        *
+               * BEGIN INPUT ARG/PARAM HANDLERS                        *
+               
\**************************************************************************/
+               
                /*!
                @function decode_fake_uri
***************
*** 824,830 ****
                @access Public
                */
!               function grab_class_args_gpc($acctnum='')
                {
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
grab_class_args_gpc: ENTERING, (parm $acctnum=['.serialize($acctnum).'])<br>'; }
                        if ($this->debug_args_input_flow > 2) { echo 'mail_msg: 
grab_class_args_gpc: $GLOBALS[HTTP_POST_VARS] dump:<pre>'; 
print_r($GLOBALS['HTTP_POST_VARS']); echo '</pre>'; }
                        if ($this->debug_args_input_flow > 2) { echo 'mail_msg: 
grab_class_args_gpc: $GLOBALS[HTTP_GET_VARS] dump:<pre>'; 
print_r($GLOBALS['HTTP_GET_VARS']); echo '</pre>'; }
--- 830,836 ----
                @access Public
                */
!               function grab_class_args_gpc()
                {
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
grab_class_args_gpc: ENTERING<br>'; }
                        if ($this->debug_args_input_flow > 2) { echo 'mail_msg: 
grab_class_args_gpc: $GLOBALS[HTTP_POST_VARS] dump:<pre>'; 
print_r($GLOBALS['HTTP_POST_VARS']); echo '</pre>'; }
                        if ($this->debug_args_input_flow > 2) { echo 'mail_msg: 
grab_class_args_gpc: $GLOBALS[HTTP_GET_VARS] dump:<pre>'; 
print_r($GLOBALS['HTTP_GET_VARS']); echo '</pre>'; }
***************
*** 882,886 ****
                        
                        $got_args = array();
!                       
                        if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
grab_class_args_gpc: about to loop thru $this->known_external_args<br>'; }
                        $loops = count($this->known_external_args);
--- 888,892 ----
                        
                        $got_args = array();
!                       // insert *known* external args we find into 
$got_args[], then return that data
                        if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
grab_class_args_gpc: about to loop thru $this->known_external_args<br>'; }
                        $loops = count($this->known_external_args);
***************
*** 920,966 ****
                        if ($this->debug_args_input_flow > 2) { echo 'mail_msg: 
grab_class_args_gpc: post-loop (external args) $got_args[] dump:<pre>'; 
print_r($got_args); echo '</pre>'; }
                        
!                       
!                       // in order to handle internal args, we need to 
determine what account we are dealing with
!                       // before we can call "get_isset_arg" or "get_arg_value"
                        
                        // ---  which email account do are these args intended 
to apply to  ----
!                       // ORDER OF PREFERENCE for determining account num
!                       // 1) force fed acct num
!                       // 2) gpc fldball['acctnum']
!                       // 3) gpc msgball['acctnum']
!                       // 4-) current class value for acct num
!                       // 4a) use class value $this->acctnum if it exists
!                       // 4b) get a default value to use (usually = 0)
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
grab_class_args_gpc: "what acctnum to use": searching...: <br>'; }
                        
!                       if ((isset($acctnum))
!                       && ((string)$acctnum != ''))
                        {
!                               // do nothing, we'll use this value below
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: grab_class_args_gpc: "what acctnum to use": will use function param 
$acctnum=['.serialize($acctnum).']<br>'; }
                        }
                        elseif ((isset($got_args['msgball']['acctnum']))
                        && ((string)$got_args['msgball']['acctnum'] != ''))
                        {
                                $acctnum = (int)$got_args['msgball']['acctnum'];
                                // make sure this is an integer
                                $got_args['msgball']['acctnum'] = $acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: grab_class_args_gpc: "what acctnum to use": will use GPC aquired 
$got_args[msgball][acctnum] : 
['.serialize($got_args['msgball']['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['fldball']['acctnum']))
                        && ((string)$got_args['fldball']['acctnum'] != ''))
                        {
                                $acctnum = (int)$got_args['fldball']['acctnum'];
                                // make sure this is an integer
                                $got_args['fldball']['acctnum'] = $acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: grab_class_args_gpc: "what acctnum to use": will use GPC aquired 
$got_args[fldball][acctnum] : 
['.serialize($got_args['fldball']['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['source_fldball']['acctnum']))
                        && ((string)$got_args['source_fldball']['acctnum'] != 
''))
                        {
                                $acctnum = 
(int)$got_args['source_fldball']['acctnum'];
                                // make sure this is an integer
                                $got_args['source_fldball']['acctnum'] = 
$acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: grab_class_args_gpc: "what acctnum to use": will use GPC aquired 
$got_args[source_fldball][acctnum] : 
['.serialize($got_args['source_fldball']['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['target_fldball']['acctnum']))
--- 926,1066 ----
                        if ($this->debug_args_input_flow > 2) { echo 'mail_msg: 
grab_class_args_gpc: post-loop (external args) $got_args[] dump:<pre>'; 
print_r($got_args); echo '</pre>'; }
                        
!                       // in order to know wgat account's arg array to insert 
$got_args[] into, we need to determine what account 
!                       // we are dealing with before we can call 
$this->set_arg_array or "->get_isset_arg" or "->get_arg_value", etc...
!                       // so whoever called this function should obtain that 
before calling $this->set_arg_array() with the data we return here
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
grab_class_args_gpc: LEAVING, returning $got_args<br>'; }
!                       return $got_args;
!               }
!               
!               /*!
!               @function grab_class_args_xmlrpc
!               @abstract grab data an XML-RPC call and fill various class arg 
variables with the available data
!               @param none
!               @result none, this is an object call
!               @discussion functional relative to function 
"grab_class_args_gpc()", except this function grabs the
!               data from an alternative, non-php-GPC, source
!               NOT YET IMPLEMENTED
!               @author Angles
!               @access Public
!               */
!               function grab_class_args_xmlrpc()
!               {
!                       // STUB, for future use
!                       echo 'call to un-implemented function 
grab_class_args_xmlrpc';
!               }
!               
!               
!               /*!
!               @function get_best_acctnum_and_set_it
!               @abstract search a variety of vars to find a legitimate account 
number, fallsback to $this->get_acctnum
!               @param $args_array ARRAY that was passed to ->begin_request, 
pass that into here if possible, it is a primary source
!               @param $got_args ARRAY of the *External* params / args fed to 
this script via GPC or other methods
!               Note: these are NOT the "internal args"
!               @param $force_feed_acctnum INTEGER if for some reason you want 
to force an account number (DEPRECIATED)
!               @result integer, mostt legitimate account number that was 
obtained
!               @discussion ?
!               @author Angles
!               @access Private
!               */
!               function get_best_acctnum_and_set_it($args_array='', 
$got_args='', $force_feed_acctnum='')
!               {
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
searching_for_acctnum: ENTERING, param $force_feed_acctnum 
['.$force_feed_acctnum.'] ; parm DUMP $args_array[] then $got_args[] 
dumps:<pre>'; print_r($args_array);  print_r($got_args); echo '</pre>'; }
                        
                        // ---  which email account do are these args intended 
to apply to  ----
!                       // ORDER OF PREFERENCE for determining account num: 
just look at the code, it has comments
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
searching_for_acctnum: "what acctnum to use": searching...: <br>'; }
!                       // initialize
!                       $acctnum = '';
!                       
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
searching_for_acctnum: get acctnum from feed args if possible<br>'; }
!                       $found_acctnum = False;
!                       while(list($key,$value) = each($args_array))
!                       {
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: (acctnum search) this loop feed arg : 
['.$key.'] => ['.serialize($args_array[$key]).'] <br>'; }
!                               // try to find feed acctnum value
!                               if ($key == 'fldball')
!                               {
!                                       $fldball = $args_array[$key];
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) $args_array passed in 
$fldball[] : '.serialize($fldball).'<br>'; }
!                                       $acctnum = (int)$fldball['acctnum'];
!                                       
!                                       // SET OUR ACCTNUM ACCORDING TO FEED 
ARGS
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) ACCTNUM from 
$args_array fldball : ['.$acctnum.']<br>'; }
!                                       $found_acctnum = True;
!                                       break;
!                               }
!                               elseif ($key == 'msgball')
!                               {
!                                       $msgball = $args_array[$key];
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) $args_array passed in 
$msgball[] : '.serialize($msgball).'<br>'; }
!                                       $acctnum = (int)$msgball['acctnum'];
!                                       // SET OUR ACCTNUM ACCORDING TO FEED 
ARGS
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) ACCTNUM from 
$args_array msgball : ['.$acctnum.']<br>'; }
!                                       $found_acctnum = True;
!                                       break;
!                               }
!                               elseif ($key == 'acctnum')
!                               {
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) $args_array passed in 
"acctnum" : '.serialize($args_array[$key]).'<br>'; }
!                                       $acctnum = (int)$args_array[$key];
!                                       // SET OUR ACCTNUM ACCORDING TO FEED 
ARGS
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: searching_for_acctnum: (acctnum search) ACCTNUM from 
$args_array "acctnum" feed args : ['.$acctnum.']<br>'; }
!                                       $found_acctnum = True;
!                                       break;
!                               }
!                       }
!                       // did the above work?
!                       if ($found_acctnum == True)
!                       {
!                               // SET THE ACCTNUM AND RETURN IT
!                               if ($this->debug_args_input_flow > 0) { echo 
'mail_msg: searching_for_acctnum: (from $args_array) * * * *SETTING CLASS 
ACCTNUM* * * * by calling $this->set_acctnum('.serialize($acctnum).')<br>'; }
!                               $this->set_acctnum($acctnum);
!                               if ($this->debug_args_input_flow > 0) { echo 
'mail_msg: searching_for_acctnum: LEAVING early, $args_array had the data, 
returning $acctnum ['.serialize($acctnum).']<br>'; }
!                               return $acctnum;
!                       }
!                       
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
searching_for_acctnum: "what acctnum to use": continue searching...: <br>'; }
                        
!                       // ok, now we need to broaden the search for a legit 
account number
!                       if ((isset($force_feed_acctnum))
!                       && ((string)$force_feed_acctnum != ''))
                        {
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use function 
param $force_feed_acctnum=['.serialize($force_feed_acctnum).']<br>'; }
!                               $acctnum = (int)$force_feed_acctnum;
                        }
                        elseif ((isset($got_args['msgball']['acctnum']))
                        && ((string)$got_args['msgball']['acctnum'] != ''))
                        {
+                               // we are requested to handle (display, move, 
forward, etc...) this msgball, use it's properties
                                $acctnum = (int)$got_args['msgball']['acctnum'];
                                // make sure this is an integer
                                $got_args['msgball']['acctnum'] = $acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[msgball][acctnum] : 
['.serialize($got_args['msgball']['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['fldball']['acctnum']))
                        && ((string)$got_args['fldball']['acctnum'] != ''))
                        {
+                               // we are requested to handle (display, .... ) 
data concerning this fldball, use it's properties
                                $acctnum = (int)$got_args['fldball']['acctnum'];
                                // make sure this is an integer
                                $got_args['fldball']['acctnum'] = $acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[fldball][acctnum] : 
['.serialize($got_args['fldball']['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['source_fldball']['acctnum']))
                        && ((string)$got_args['source_fldball']['acctnum'] != 
''))
                        {
+                               // we are *probably* requested to delete or 
rename this fldball, use it's properties
                                $acctnum = 
(int)$got_args['source_fldball']['acctnum'];
                                // make sure this is an integer
                                $got_args['source_fldball']['acctnum'] = 
$acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[source_fldball][acctnum] : 
['.serialize($got_args['source_fldball']['acctnum']).']<br>'; }
!                       }
!                       elseif ((isset($got_args['delmov_list'][0]['acctnum']))
!                       && ((string)$got_args['delmov_list'][0]['acctnum'] != 
''))
!                       {
!                               // at the very least we know that we'll need to 
login to this account to delete or move this particular msgball
!                               // also, we will need to open the particular 
folder where the msg is localted
!                               $acctnum = 
(int)$got_args['delmov_list'][0]['acctnum'];
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[delmov_list][0][acctnum] : 
['.serialize($got_args['delmov_list'][0]['acctnum']).']<br>'; }
                        }
                        elseif ((isset($got_args['target_fldball']['acctnum']))
***************
*** 968,1006 ****
                        {
                                // at the very least we know we need to login 
to this account to append a message to a folder there
                                $acctnum = 
(int)$got_args['target_fldball']['acctnum'];
                                // make sure this is an integer
                                $got_args['target_fldball']['acctnum'] = 
$acctnum;
!                               if ($this->debug_args_input_flow > 1)
!                               {
!                                       echo 'mail_msg: grab_class_args_gpc: 
"what acctnum to use": will use GPC aquired $got_args[target_fldball][acctnum] 
: ['.serialize($got_args['target_fldball']['acctnum']).']<br>';
!                               }
!                       }
!                       elseif ((isset($got_args['delmov_list'][0]['acctnum']))
!                       && ((string)$got_args['delmov_list'][0]['acctnum'] != 
''))
!                       {
!                               // at the very least we know that we'll need to 
login to this account to delete or move this particular msgball
!                               $acctnum = 
(int)$got_args['delmov_list'][0]['acctnum'];
!                               if ($this->debug_args_input_flow > 1)
!                               {
!                                       echo 'mail_msg: grab_class_args_gpc: 
"what acctnum to use": will use GPC aquired $got_args[delmov_list][0][acctnum] 
: ['.serialize($got_args['delmov_list'][0]['acctnum']).']<br>';
!                               }
                        }
                        else
                        {
!                               // ok, we have either a force fed $acctnum or 
got one from GPC
!                               // if neither, we grab the class's current 
value for $this->acctnum
!                               // $this->get_acctnum(True) will return a 
default value for us to use if $this->acctnum is not set
                                // True means "return a default value, NOT 
boolean false, if $this->acctnum is not set
                                $acctnum = $this->get_acctnum(True);
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: grab_class_args_gpc: "what acctnum to use": NO *incoming* acctnum 
specified, called $this->get_acctnum(True), got: 
['.serialize($acctnum).']<br>'; }
                        }
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
grab_class_args_gpc: * * * *SETTING CLASS ACCTNUM* * * * by calling 
$this->set_acctnum('.serialize($acctnum).')<br>'; }
                        $this->set_acctnum($acctnum);
                        
                        
                        // INTERNALLY CONTROLLED ARGS
                        // preserve pre-existing value, for which "acctnum" 
must be already obtained, so we
                        // know what account to check for existing arg values 
when we use "get_isset_arg" or "get_arg_value"
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
grab_class_args_gpc: about to loop thru $this->known_internal_args<br>'; }
                        $loops = count($this->known_internal_args);
                        for($i=0;$i<$loops;$i++)
--- 1068,1123 ----
                        {
                                // at the very least we know we need to login 
to this account to append a message to a folder there
+                               // NOTE: we need not open the particular folder 
we are going to append to,
+                               // all we need is a stream to that particular 
account, "opened" folder is not important
+                               // therefor we can just use INBOX as the folder 
to log into in this case
                                $acctnum = 
(int)$got_args['target_fldball']['acctnum'];
                                // make sure this is an integer
                                $got_args['target_fldball']['acctnum'] = 
$acctnum;
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": will use GPC aquired 
$got_args[target_fldball][acctnum] : 
['.serialize($got_args['target_fldball']['acctnum']).']<br>'; }
                        }
                        else
                        {
!                               // FALLBACK
!                               // ok, we have NO acctnum in $args_array, did 
NOT get it from GPC got_args, nor the force fed $force_feed_acctnum
!                               // so, we grab the class's current value for 
$this->acctnum
!                               // $this->get_acctnum() will return a default 
value for us to use if $this->acctnum is not set
!                               // note, this is identical to 
$this->get_acctnum(True) because True is the default arg there if one is not 
passed
                                // True means "return a default value, NOT 
boolean false, if $this->acctnum is not set
                                $acctnum = $this->get_acctnum(True);
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: searching_for_acctnum: "what acctnum to use": NO *incoming* acctnum 
specified, called $this->get_acctnum(True), got: 
['.serialize($acctnum).']<br>'; }
                        }
!                       
!                       // SET THE ACCTNUM WITH THE "BEST VALUE" WE COULD FIND
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
searching_for_acctnum: * * * *SETTING CLASS ACCTNUM* * * * by calling 
$this->set_acctnum('.serialize($acctnum).')<br>'; }
                        $this->set_acctnum($acctnum);
                        
+                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
searching_for_acctnum: LEAVING, returning $acctnum 
['.serialize($acctnum).']<br>'; }
+                       return $acctnum;
+               }
+               
+               /*!
+               @function init_internal_args_and_set_them
+               @abstract initialize Internally controlled params / args. MUST 
already have an acctnum
+               @param $acctnum integer the current account number whose array 
we will fill with these initialized args
+               @result none, this is an object call
+               @discussion ?
+               @author Angles
+               @access Public
+               */
+               function init_internal_args_and_set_them($acctnum='')
+               {
+                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
init_internal_args: ENTERING, (parm $acctnum=['.serialize($acctnum).'])<br>'; }
+                       // we SHOULD have already obtained a valid acctnum 
before calling this function
+                       if (!(isset($acctnum))
+                       || ((string)$acctnum == ''))
+                       {
+                               $acctnum = $this->get_acctnum();
+                       }
                        
                        // INTERNALLY CONTROLLED ARGS
                        // preserve pre-existing value, for which "acctnum" 
must be already obtained, so we
                        // know what account to check for existing arg values 
when we use "get_isset_arg" or "get_arg_value"
!                       $internal_args = Array();
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
init_internal_args: about to loop thru $this->known_internal_args<br>'; }
                        $loops = count($this->known_internal_args);
                        for($i=0;$i<$loops;$i++)
***************
*** 1013,1017 ****
                                        $preserve_this = 
$this->get_arg_value($this_arg_name);
                                        if ($this->debug_args_input_flow> 2) { 
echo ' * * (grab pref - internal) preserving internal pre-existing arg: 
['.$this_arg_name.'] = ['.$preserve_this.']<br>'; }
!                                       $got_args[$this_arg_name] = 
$preserve_this;
                                }
                                else
--- 1130,1134 ----
                                        $preserve_this = 
$this->get_arg_value($this_arg_name);
                                        if ($this->debug_args_input_flow> 2) { 
echo ' * * (grab pref - internal) preserving internal pre-existing arg: 
['.$this_arg_name.'] = ['.$preserve_this.']<br>'; }
!                                       $internal_args[$this_arg_name] = 
$preserve_this;
                                }
                                else
***************
*** 1020,1057 ****
                                        if ($this_arg_name == 
'folder_status_info')
                                        {
!                                               $got_args['folder_status_info'] 
= array();
                                        }
                                        elseif ($this_arg_name == 'folder_list')
                                        {
!                                               $got_args['folder_list'] = 
array();
                                        }
                                        elseif ($this_arg_name == 
'mailsvr_callstr')
                                        {
!                                               $got_args['mailsvr_callstr'] = 
'';
                                        }
                                        elseif ($this_arg_name == 
'mailsvr_namespace')
                                        {
!                                               $got_args['mailsvr_namespace'] 
= '';
                                        }
                                        elseif ($this_arg_name == 
'mailsvr_delimiter')
                                        {
!                                               $got_args['mailsvr_delimiter'] 
= '';
                                        }
                                        elseif ($this_arg_name == 
'mailsvr_stream')
                                        {
!                                               $got_args['mailsvr_stream'] = 
'';
                                        }
                                        elseif ($this_arg_name == 
'mailsvr_account_username')
                                        {
!                                               
$got_args['mailsvr_account_username'] = '';
                                        }
                                        // experimental: Set Flag indicative 
we've run thru this function
                                        elseif ($this_arg_name == 
'already_grab_class_args_gpc')
                                        {
!                                               
$got_args['already_grab_class_args_gpc'] = True;
                                        }
                                }
                        }
!                       if ($this->debug_args_input_flow > 2) { echo 'mail_msg: 
grab_class_args_gpc: post-loop (internal args) $got_args[] dump:<pre>'; 
print_r($got_args); echo '</pre>'; }
                        
                        
--- 1137,1174 ----
                                        if ($this_arg_name == 
'folder_status_info')
                                        {
!                                               
$internal_args['folder_status_info'] = array();
                                        }
                                        elseif ($this_arg_name == 'folder_list')
                                        {
!                                               $internal_args['folder_list'] = 
array();
                                        }
                                        elseif ($this_arg_name == 
'mailsvr_callstr')
                                        {
!                                               
$internal_args['mailsvr_callstr'] = '';
                                        }
                                        elseif ($this_arg_name == 
'mailsvr_namespace')
                                        {
!                                               
$internal_args['mailsvr_namespace'] = '';
                                        }
                                        elseif ($this_arg_name == 
'mailsvr_delimiter')
                                        {
!                                               
$internal_args['mailsvr_delimiter'] = '';
                                        }
                                        elseif ($this_arg_name == 
'mailsvr_stream')
                                        {
!                                               
$internal_args['mailsvr_stream'] = '';
                                        }
                                        elseif ($this_arg_name == 
'mailsvr_account_username')
                                        {
!                                               
$internal_args['mailsvr_account_username'] = '';
                                        }
                                        // experimental: Set Flag indicative 
we've run thru this function
                                        elseif ($this_arg_name == 
'already_grab_class_args_gpc')
                                        {
!                                               
$internal_args['already_grab_class_args_gpc'] = True;
                                        }
                                }
                        }
!                       if ($this->debug_args_input_flow > 2) { echo 'mail_msg: 
init_internal_args: post-loop (internal args) $internal_args[] dump:<pre>'; 
print_r($internal_args); echo '</pre>'; }
                        
                        
***************
*** 1059,1090 ****
                        //$this->unset_all_args();
                        // set new args, some may require processing (like 
folder will go thru prep_folder_in() automatically
!                       //while(list($key,$value) = each($got_args))
                        //{
!                       //      $this->set_arg_value($key, $got_args[$key]);
                        //}
                        
                        // use this one call to do it all
!                       $this->set_arg_array($got_args);
!                       if ($this->debug_args_input_flow > 2) { echo 'mail_msg: 
grab_class_args_gpc: finished, $this->get_all_args() dump:<pre>'; 
print_r($this->get_all_args()); echo '</pre>'; }
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
grab_class_args_gpc: LEAVING<br>'; }
                }
                
                /*!
!               @function grab_class_args_xmlrpc
!               @abstract grab data an XML-RPC call and fill various class arg 
variables with the available data
!               @param none
!               @result none, this is an object call
!               @discussion functional relative to function 
"grab_class_args_gpc()", except this function grabs the
!               data from an alternative, non-php-GPC, source
!               NOT YET IMPLEMENTED
                @author Angles
!               @access Public
                */
!               function grab_class_args_xmlrpc()
                {
!                       // STUB, for future use
!                       echo 'call to un-implemented function 
grab_class_args_xmlrpc';
!               }
                
                
                /*!
--- 1176,1294 ----
                        //$this->unset_all_args();
                        // set new args, some may require processing (like 
folder will go thru prep_folder_in() automatically
!                       //while(list($key,$value) = each($internal_args))
                        //{
!                       //      $this->set_arg_value($key, 
$internal_args[$key]);
                        //}
                        
                        // use this one call to do it all
!                       //$this->set_arg_array($internal_args);
!                       
!                       // add these items to the args array for the 
appropriate account
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
init_internal_args: about to add $internal_args to acounts class args 
array<br>'; }
!                       while(list($key,$value) = each($internal_args))
!                       {
!                               if ($this->debug_args_input_flow > 2) { echo ' 
* mail_msg: init_internal_args: (looping) setting internal arg: 
$this->set_arg_value('.$key.', '.$internal_args[$key].', '.$acctnum.'); <br>'; }
!                               $this->set_arg_value($key, 
$internal_args[$key], $acctnum);
!                               //$this->set_arg_value($key, 
$internal_args[$key]);
!                       }
!                       
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
grab_class_args_gpc: LEAVING, returning $internal_args<br>'; }
!                       return $internal_args;
                }
                
                /*!
!               @function get_best_folder_arg
!               @abstract search a variety of vars to find a legitimate folder 
value to open on the mail server number, 
!               @param $args_array ARRAY that was passed to ->begin_request, 
pass that into here if possible, it is a primary source
!               @param $got_args ARRAY of the *External* params / args fed to 
this script via GPC or other methods
!               Note: these are NOT the "internal args"
!               @param $acctnum INTEGER used to querey various already-set args
!               @result string, mostt legitimate folder value that was obtained
!               @discussion ?
                @author Angles
!               @access Private
                */
!               function get_best_folder_arg($args_array='', $got_args='', 
$acctnum='')
                {
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
get_best_folder_arg: ENTERING <br>'; }
!                       if ($this->debug_args_input_flow > 2) { echo 'mail_msg: 
get_best_folder_arg: param $acctnum ['.$acctnum.'] ; parm DUMP $args_array[] 
then $got_args[] dumps:<pre>'; print_r($args_array);  print_r($got_args); echo 
'</pre>'; }
!                       // we SHOULD have already obtained a valid acctnum 
before calling this function
!                       if (!(isset($acctnum))
!                       || ((string)$acctnum == ''))
!                       {
!                               $acctnum = $this->get_acctnum();
!                       }
!                       //  ----  Get Folder Value  ----
!                       // ORDER OF PREFERENCE for pre-processed "folder" input 
arg
!                       // (1) $args_array, IF FILLED, overrides any previous 
data or any other data source, look for these:
!                       //      $args_array['msgball']['folder']
!                       //      $args_array['fldball']['folder']
!                       //      $args_array['folder']
!                       // (2) GPC ['msgball']['folder']
!                       // (3) GPC ['fldball']['folder']
!                       // (4) GPC ['delmov_list'][0]['folder']
!                       // (5) if "folder" arg it is already set, (probably 
during the reuse attempt, probably obtained from $args_array alreadt) then use 
that
!                       // (6) default to blank string, which 
"prep_folder_in()" changes to defaultg value INBOX
!                       
!                       // note: it's OK to send blank string to 
"prep_folder_in", because it will return a default value of "INBOX"
!                       if ((isset($args_array['folder']))
!                       && ($args_array['folder'] != ''))
!                       {
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_folder_arg: $input_folder_arg chooses $args_array[folder] 
('.$args_array['folder'].') over any existing "folder" arg<br>'; }
!                               $input_folder_arg = $args_array['folder'];
!                       }
!                       elseif ($this->get_isset_arg('["msgball"]["folder"]'))
!                       {
!                               $input_folder_arg = 
$this->get_arg_value('["msgball"]["folder"]');
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_folder_arg: $input_folder_arg chooses 
$this->get_arg_value(["msgball"]["folder"]): ['.$input_folder_arg.']<br>'; }
!                       }
!                       elseif ($this->get_isset_arg('["fldball"]["folder"]'))
!                       {
!                               $input_folder_arg = 
$this->get_arg_value('["fldball"]["folder"]');
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_folder_arg: $input_folder_arg chooses 
$this->get_arg_value(["fldball"]["folder"]): ['.$input_folder_arg.']<br>'; }
!                       }
!                       elseif ($this->get_isset_arg('delmov_list'))
!                       {
!                               // we know we'll need to loginto this folder to 
get this message and move/delete it
!                               // there may be other msgballs in the 
delmov_list array, but we know at the very list we'll need to open this folder 
anyway
!                               $this_delmov_list = 
$this->get_arg_value('delmov_list');
!                               $input_folder_arg = 
$this_delmov_list[0]['folder'];
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_folder_arg: $input_folder_arg chooses 
$this_delmov_list[0][folder]: ['.$input_folder_arg.']<br>'; }
!                       }
!                       else
!                       {
!                               if (($this->get_isset_arg('folder'))
!                               && 
((string)trim($this->get_arg_value('folder')) != ''))
!                               {
!                                       $input_folder_arg = 
$this->get_arg_value('folder');
!                               }
!                               if ($this->debug_args_input_flow > 1) { echo 
'mail_msg: get_best_folder_arg: $input_folder_arg *might* chooses 
$this->get_arg_value(folder): ['.serialize($input_folder_arg).']<br>'; }
!                               
!                               $input_folder_arg = (string)$input_folder_arg;
!                               $input_folder_arg = trim($input_folder_arg);
!                               if ($input_folder_arg != '')
!                               {
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: get_best_folder_arg: $this->get_arg_value(folder) passes test, 
so $input_folder_arg chooses $this->get_arg_value(folder): 
['.serialize($input_folder_arg).']<br>'; }
!                               }
!                               else
!                               {
!                                       if ($this->debug_args_input_flow > 1) { 
echo 'mail_msg: get_best_folder_arg: no folder value found, so 
$input_folder_arg takes an empty string<br>'; }
!                                       $input_folder_arg = '';
!                               }
!                       }
!                       // ---- Prep the Folder Name (remove encodings, verify 
it's long name (with namespace)
!                       // folder prepping does a lookup which requires a 
folder list which *usually* (unless caching) requires a login
!                       if ($this->debug_args_input_flow > 1) { echo 'mail_msg: 
get_best_folder_arg: about to issue $processed_folder_arg = 
$this->prep_folder_in('.$input_folder_arg.')<br>'; }
!                       $processed_folder_arg = 
$this->prep_folder_in($input_folder_arg);
!                       if ($this->debug_args_input_flow > 0) { echo 'mail_msg: 
get_best_folder_arg: LEAVING, returning $processed_folder_arg value: 
['.$processed_folder_arg.']<br>'; }
!                       return $processed_folder_arg;
!               }       
!               
                
+               
/**************************************************************************\
+               * END INPUT ARG/PARAM HANDLERS                                  
                        *
+               * - - - - - - - - - - - - - - - - - - - - - - - - -             
                                                        *
+               * BEGIN APPSESSION TEMPORARY CACHING HANDLERS           *
+               
\**************************************************************************/
                
                /*!
***************
*** 1321,1324 ****
--- 1525,1534 ----
                }
                
+               
/**************************************************************************\
+               * END APPSESSION TEMPORARY CACHING HANDLERS             *
+               * - - - - - - - - - - - - - - - - - - - - - - - - -             
                                                        *
+               * BEGIN **DEPRECIATED *** UNUSED ***                            
                *
+               *               SEMI-PERMENANT CACHING HANDLERS                 
                *
+               
\**************************************************************************/
                
                /*!
***************
*** 1537,1540 ****
--- 1747,1757 ----
                        return True;
                }
+               
+               
/**************************************************************************\
+               * END **DEPRECIATED *** UNUSED ***                              
                        *
+               *               SEMI-PERMENANT CACHING HANDLERS                 
                *
+               * - - - - - - - - - - - - - - - - - - - - - - - - -             
                                                        *
+               * BEGIN PARAM / ARGS / PREFS  ACCESS FUNCTIONS                  
*
+               
\**************************************************************************/
                
                /*!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]