[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: email/inc class.bofilters.inc.php,1.1,1.2 class.
From: |
Angelo Tony Puglisi <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: email/inc class.bofilters.inc.php,1.1,1.2 class.bofolder.inc.php,1.4,1.5 class.bopreferences.inc.php,1.12,1.13 class.mail_msg_base.inc.php,1.64,1.65 class.mail_msg_display.inc.php,1.32,1.33 class.mail_msg_wrappers.inc.php,1.24,1.25 class.uifilters.inc.php,1.1,1.2 |
Date: |
Sun, 20 Jan 2002 18:58:49 -0500 |
Update of /cvsroot/phpgroupware//email/inc
In directory subversions:/tmp/cvs-serv16451/email/inc
Modified Files:
class.bofilters.inc.php class.bofolder.inc.php
class.bopreferences.inc.php class.mail_msg_base.inc.php
class.mail_msg_display.inc.php class.mail_msg_wrappers.inc.php
class.uifilters.inc.php
Log Message:
more filters work, multiple concurrent streams now work, end request will close
any open stream
Index: class.bofilters.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.bofilters.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.bofilters.inc.php 18 Jan 2002 23:15:52 -0000 1.1
--- class.bofilters.inc.php 20 Jan 2002 23:58:47 -0000 1.2
***************
*** 26,31 ****
var $finished_mlist = '';
var $submit_mlist_to_class_form = '';
! var $submit_flag = '';
! var $debug = 0;
var $sieve_to_imap_fields=array();
var $result_set = Array();
--- 26,30 ----
var $finished_mlist = '';
var $submit_mlist_to_class_form = '';
! var $debug = 3;
var $sieve_to_imap_fields=array();
var $result_set = Array();
***************
*** 56,59 ****
--- 55,59 ----
// should we log in or not
$args_array['do_login'] = False;
+ //$args_array['do_login'] = True;
if ($this->debug > 1) { echo 'email.bofilters.
*constructor*: call msg->begin_request with args
array:'.serialize($args_array).'<br>'; }
$GLOBALS['phpgw']->msg->begin_request($args_array);
***************
*** 91,99 ****
if ($this->debug > 2) { echo 'bofilters:
$GLOBALS[HTTP_POST_VARS] count=['.count($GLOBALS['HTTP_POST_VARS']).'] ; dump
<strong><pre>'; print_r($GLOBALS['HTTP_POST_VARS']); echo
"</pre></strong>\r\n"; }
// do we have data
! if
(!isset($GLOBALS['HTTP_POST_VARS'][$this->submit_flag]))
! {
! if ($this->debug > 0) { echo 'bofilters:
distill_filter_args: NO data submitted<br>'."\r\n"; }
! return Array();
! }
@reset($GLOBALS['HTTP_POST_VARS']);
// look for top level "filter_X" array
--- 91,95 ----
if ($this->debug > 2) { echo 'bofilters:
$GLOBALS[HTTP_POST_VARS] count=['.count($GLOBALS['HTTP_POST_VARS']).'] ; dump
<strong><pre>'; print_r($GLOBALS['HTTP_POST_VARS']); echo
"</pre></strong>\r\n"; }
// do we have data
! // we must have data because the form action made this
code run
@reset($GLOBALS['HTTP_POST_VARS']);
// look for top level "filter_X" array
***************
*** 101,105 ****
{
if ($this->debug > 1) { echo 'bofilters:
$GLOBALS[HTTP_POST_VARS] key,value walk thru: $key: ['.$key.'] ; $value
DUMP:<pre>'; print_r($value); echo "</pre>\r\n"; }
! if (strstr($key, 'filter_'))
{
// put the raw data dor this particular
filter into a local var
--- 97,102 ----
{
if ($this->debug > 1) { echo 'bofilters:
$GLOBALS[HTTP_POST_VARS] key,value walk thru: $key: ['.$key.'] ; $value
DUMP:<pre>'; print_r($value); echo "</pre>\r\n"; }
! if ((strstr($key, 'filter_'))
! && (strstr($key, 'filter_0_source_accounts') ==
False))
{
// put the raw data dor this particular
filter into a local var
***************
*** 109,119 ****
// prepare to fill your structured array
$this_idx = count($this->filters);
// grab the "filter name" associated
with this data
$this->filters[$this_idx]['filtername']
= $filter_X['filtername'];
- // what folder so we search
-
$this->filters[$this_idx]['source_account'] = $filter_X['source_account'];
// init sub arrays
$this->filters[$this_idx]['matches'] =
Array();
$this->filters[$this_idx]['actions'] =
Array();
// extract match and action data from
this filter_X data array
while(list($filter_X_key,$filter_X_value) = each($filter_X))
--- 106,116 ----
// prepare to fill your structured array
$this_idx = count($this->filters);
+
// grab the "filter name" associated
with this data
$this->filters[$this_idx]['filtername']
= $filter_X['filtername'];
// init sub arrays
$this->filters[$this_idx]['matches'] =
Array();
$this->filters[$this_idx]['actions'] =
Array();
+
// extract match and action data from
this filter_X data array
while(list($filter_X_key,$filter_X_value) = each($filter_X))
***************
*** 148,151 ****
--- 145,149 ----
if ($this->debug > 1) {
echo 'bofilters: distill_filter_args: match_grabbed_key value:
['.$match_grabbed_key.']<br>'; }
$this->filters[$this_idx]['matches'][$match_this_idx][$match_grabbed_key] =
$filter_X[$filter_X_key];
+
}
/*
***************
*** 176,179 ****
--- 174,187 ----
}
}
+ if
((isset($GLOBALS['HTTP_POST_VARS']['filter_'.$this_idx.'_source_accounts']))
+ &&
(!isset($this->filters[$this_idx]['source_accounts'])))
+ {
+ // what account(s) do we examine
+ // because this comes from a
multiselect list box, it's not in the same "array" format as the others
+ // lest it become a 2 level deep array
which php3 could not handle
+ $source_accounts = array();
+ $source_accounts =
$GLOBALS['HTTP_POST_VARS']['filter_0_source_accounts'];
+
$this->filters[$this_idx]['source_accounts'] = $source_accounts;
+ }
}
if ($this->debug > 0) { echo 'bofilters:
distill_filter_args: this->filters[] dump <strong><pre>';
print_r($this->filters); echo "</pre></strong>\r\n"; }
Index: class.bofolder.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.bofolder.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.bofolder.inc.php 9 Jan 2002 10:55:29 -0000 1.4
--- class.bofolder.inc.php 20 Jan 2002 23:58:47 -0000 1.5
***************
*** 50,62 ****
}
! function folder($reuse_feed_args=array())
{
- // attempt (or not) to reuse an existing mail_msg
object, i.e. if one ALREADY exists before entering
- // FIXME: What???? can pass a useful, existing
object for us to use here
- //$attempt_reuse = True;
- $attempt_reuse = False;
-
if ($this->debug) { echo 'ENTERING:
email.bofolder.folder'.'<br>'; }
- if ($this->debug) { echo 'email.bofolder.folder: local
var attempt_reuse=['.serialize($attempt_reuse).'] ; reuse_feed_args[]
dump<pre>'; print_r($reuse_feed_args); echo '</pre>'; }
// create class objects
$this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
--- 50,56 ----
}
! function folder()
{
if ($this->debug) { echo 'ENTERING:
email.bofolder.folder'.'<br>'; }
// create class objects
$this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
***************
*** 72,96 ****
}
! // do we attempt to reuse the existing msg object?
! if ($attempt_reuse)
! {
! // no not create, we will reuse existing
! if ($this->debug) { echo
'email.bofolder.folder: reusing existing mail_msg login'.'<br>'; }
! // we need to feed the existing object some
params begin_request uses to re-fill the msg->args[] data
! $args_array = Array();
! // any args passed in $args_array will override
or replace any pre-existing arg value
! $args_array = $reuse_feed_args;
! // add this to keep the error checking code
(below) happy
! $args_array['do_login'] = True;
! }
! else
! {
! if ($this->debug) { echo
'email.bofolder.folder: cannot or not trying to reusing existing'.'<br>'; }
! $args_array = Array();
! // should we log in or not
! $args_array['do_login'] = True;
! }
!
! // "start your engines"
if ($this->debug == True) { echo
'email.bofolder.folder: call msg->begin_request with args array:<pre>';
print_r($args_array); echo '</pre>'; }
$some_stream =
$GLOBALS['phpgw']->msg->begin_request($args_array);
--- 66,71 ----
}
! $args_array = Array();
! $args_array['do_login'] = True;
if ($this->debug == True) { echo
'email.bofolder.folder: call msg->begin_request with args array:<pre>';
print_r($args_array); echo '</pre>'; }
$some_stream =
$GLOBALS['phpgw']->msg->begin_request($args_array);
***************
*** 268,275 ****
return $success;
}
!
!
!
!
function folder_data()
{
--- 243,248 ----
return $success;
}
!
!
function folder_data()
{
Index: class.bopreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.bopreferences.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.bopreferences.inc.php 17 Jan 2002 17:48:47 -0000 1.12
--- class.bopreferences.inc.php 20 Jan 2002 23:58:47 -0000 1.13
***************
*** 1401,1405 ****
// ---- BEGIN EX_ACCOUNTS_LIST ----
! // list accounts, except "empty" ones
$return_list = array();
$loops = count($GLOBALS['phpgw']->msg->extra_accounts);
--- 1401,1405 ----
// ---- BEGIN EX_ACCOUNTS_LIST ----
! // list accounts, except "empty" ones (show "enabled"
and "disabled"
$return_list = array();
$loops = count($GLOBALS['phpgw']->msg->extra_accounts);
***************
*** 1421,1424 ****
--- 1421,1430 ----
$return_list[$next_pos]['status'] =
$this_status;
$fullname =
$GLOBALS['phpgw']->msg->get_pref_value('fullname', $this_acctnum);
+ // "disabled" accounts will not return
a fullname because they were not initialized during "begin_request"
+ if (trim($fullname) == '')
+ {
+ // try to directly obtain it
from RAW prefs data
+ $fullname = '(direct)
'.$GLOBALS['phpgw']->msg->get_pref_value('["ex_accounts"]["'.$this_acctnum.'"]["fullname"]',
0);
+ }
$return_list[$next_pos]['display_string'] = '['.$this_acctnum.']
'.$GLOBALS['phpgw']->msg->htmlspecialchars_encode($fullname);
// control action links
Index: class.mail_msg_base.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_base.inc.php,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -r1.64 -r1.65
*** class.mail_msg_base.inc.php 16 Jan 2002 11:53:18 -0000 1.64
--- class.mail_msg_base.inc.php 20 Jan 2002 23:58:47 -0000 1.65
***************
*** 80,97 ****
// EXTRA ACCOUNTS
var $ex_accounts_count = 0;
! // holds the integer array key(s) of any defined extra account that has
data, whether enabled or not
! //var $defined_ex_accounts = array();
! // same as above BUT only has "enabled" extra accounts integer array
key(s)
! //var $enabled_ex_accounts = array();
var $extra_acounts = array();
// DEBUG FLAGS generally take int 0, 1, 2, or 3
! var $debug_logins = 0;
var $debug_session_caching = 0;
var $debug_longterm_caching = 0;
var $debug_accts = 0;
var $debug_args_input_flow = 0;
! var $debug_args_oop_access = 0;
var $debug_args_special_handlers = 0;
//var $skip_args_special_handlers = 'get_mailsvr_callstr,
get_mailsvr_namespace, get_mailsvr_delimiter, get_folder_list';
--- 80,99 ----
// EXTRA ACCOUNTS
+ // used for looping thru extra account data during begin request
var $ex_accounts_count = 0;
! // extra_acounts[X][acctnum] = integer
! // extra_acounts[X][status] = empty | enabled | disabled
var $extra_acounts = array();
+ // same as above but includes the default account, makes checking
streams easier
+ var $extra_and_default_acounts = array();
+
// DEBUG FLAGS generally take int 0, 1, 2, or 3
! var $debug_logins = 3;
var $debug_session_caching = 0;
var $debug_longterm_caching = 0;
var $debug_accts = 0;
var $debug_args_input_flow = 0;
! var $debug_args_oop_access = 3;
var $debug_args_special_handlers = 0;
//var $skip_args_special_handlers = 'get_mailsvr_callstr,
get_mailsvr_namespace, get_mailsvr_delimiter, get_folder_list';
***************
*** 681,685 ****
--- 683,700 ----
}
}
+ // extra_and_default_acounts is the same as above but
has default account inserted at position zero
+ $this->extra_and_default_acounts = array();
+ // first put in the default account
+ $this->extra_and_default_acounts[0]['acctnum'] = 0;
+ $this->extra_and_default_acounts[0]['status'] =
'enabled';
+ // now add whetever extra accounts we processed above
+ $loops = count($GLOBALS['phpgw']->msg->extra_accounts);
+ for ($i=0; $i < $loops; $i++)
+ {
+
$this->extra_and_default_acounts[$i+1]['acctnum'] =
$this->extra_accounts[$i]['acctnum'];
+
$this->extra_and_default_acounts[$i+1]['status'] =
$this->extra_accounts[$i]['status'];
+ }
if ($this->debug_logins > 2) { echo 'mail_msg:
begin_request: $this->extra_accounts dump:<pre>';
print_r($this->extra_accounts); echo '</pre>';}
+ if ($this->debug_logins > 2) { echo 'mail_msg:
begin_request: $this->extra_and_default_acounts dump:<pre>';
print_r($this->extra_and_default_acounts); echo '</pre>';}
}
else
***************
*** 915,941 ****
-
- /*
- $fake_fldball = array();
- $fake_fldball['acctnum'] = $acctnum;
- $fake_fldball['folder'] = '';
- if ($this->debug_logins > 1) { echo 'mail_msg:
begin_request: about to issue: $this->open_stream_extra($fake_fldball,
$args_array, $got_args): $this->open_stream_extra($fake_fldball, $args_array,
$got_args); $this->open_stream_extra('.serialize($fake_fldball).',
'.serialize($args_array).', '.serialize($got_args).')'.'<br>';}
- $did_open_stream =
$this->open_stream_extra($fake_fldball, $args_array, $got_args);
- if ($this->debug_logins > 1) { echo 'mail_msg:
begin_request: $this->open_stream_extra returns:
'.serialize($did_open_stream).'<br>';}
- // error check
- if ($did_open_stream == False)
- {
- if ($this->debug_logins > 0) { echo 'mail_msg:
begin_request: LEAVING with did_open_stream ERROR, closing stream, FAILURE in
$this->open_stream_extra <br>';}
- // log out since we could not reopen, something
must have gone wrong
- $this->end_request(
- array(
- 'acctnum' => $acctnum
- )
- );
- return False;
- }
- */
-
-
// ---- 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
--- 930,933 ----
***************
*** 965,986 ****
function end_request($args_array='')
{
! 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 ((isset($args_array['acctnum']))
&& ((string)$args_array['acctnum'] != ''))
{
! $acctnum = (int)$args_array['acctnum'];
}
else
{
! $acctnum = $this->get_acctnum();
}
! if (($this->get_isset_arg('mailsvr_stream', $acctnum) == True)
! && ($this->get_arg_value('mailsvr_stream', $acctnum) != ''))
{
! if ($this->debug_logins > 0) { echo 'mail_msg:
end_request: stream exists, for $acctnum ['.$acctnum.'] logging out'.'<br>'; }
!
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->close($this->get_arg_value('mailsvr_stream',
$acctnum));
! $this->set_arg_value('mailsvr_stream', '', $acctnum);
}
if ($this->debug_logins > 0) { echo 'mail_msg: end_request:
LEAVING'.'<br>';}
--- 957,997 ----
function end_request($args_array='')
{
! if ($this->debug_logins > 0) { echo 'mail_msg: end_request:
ENTERING'.'<br>'; }
! if ($this->debug_logins > 2) { echo 'mail_msg: end_request:
$args_array dump:<pre>'; print_r($args_array); echo '</pre>';}
! $check_streams = array();
if ((isset($args_array['acctnum']))
&& ((string)$args_array['acctnum'] != ''))
{
! // we were asked to close only this specific stream,
not all possible open streams
! $check_streams[0]['acctnum'] =
(int)$args_array['acctnum'];
}
else
{
! // we were asked to close all possible open streams
! // put together a list of all enabled accounts so we
will check them for an open stream
! for ($i=0; $i <
count($this->extra_and_default_acounts); $i++)
! {
! if
($this->extra_and_default_acounts[$i]['status'] == 'enabled')
! {
! $next_idx = count($check_streams);
! $check_streams[$next_idx]['acctnum'] =
$this->extra_and_default_acounts[$i]['acctnum'];
! }
! }
}
+ if ($this->debug_logins > 2) { echo 'mail_msg: end_request:
$check_streams dump:<pre>'; print_r($check_streams); echo '</pre>'; }
! // so now we know what acctnums we need to check (at least they
are enabled), loop thru them
! for ($i=0; $i < count($check_streams); $i++)
{
! $this_acctnum = $check_streams[$i]['acctnum'];
! if ($this->debug_logins > 1) { echo 'mail_msg:
end_request: stream check, will examine $this_acctnum =
$check_streams['.$i.'][acctnum] = ['.$check_streams[$i]['acctnum'].']<br>'; }
! if (($this->get_isset_arg('mailsvr_stream',
$this_acctnum) == True)
! && ((string)$this->get_arg_value('mailsvr_stream',
$this_acctnum) != ''))
! {
! $mailsvr_stream =
$this->get_arg_value('mailsvr_stream', $this_acctnum);
! if ($this->debug_logins > 0) { echo 'mail_msg:
end_request: stream exists, for $this_acctnum ['.$this_acctnum.'] ,
$mailsvr_stream : ['.$mailsvr_stream.'] ; logging out'.'<br>'; }
!
$GLOBALS['phpgw_dcom_'.$this_acctnum]->dcom->close($mailsvr_stream);
! $this->set_arg_value('mailsvr_stream', '',
$this_acctnum);
! }
}
if ($this->debug_logins > 0) { echo 'mail_msg: end_request:
LEAVING'.'<br>';}
***************
*** 989,995 ****
! function open_stream_extra($fldball='', $args_array='', $got_args='')
! {
! if ($this->debug_logins > 0) { echo 'mail_msg:
open_stream_extra: ENTERING, $fldball: ['.serialize($fldball).'] ; $args_array:
['.serialize($args_array).'] ; $got_args: ['.serialize($got_args).']<br>'; }
if ((isset($fldball['acctnum']))
--- 1000,1007 ----
! //function open_stream_extra($fldball='')
! function ensure_stream_and_folder($fldball='', $called_from='')
! {
! if ($this->debug_logins > 0) { echo 'mail_msg:
ensure_stream_and_folder: ENTERING, $fldball: ['.serialize($fldball).'] ;
$called_from: ['.$called_from.']<br>'; }
if ((isset($fldball['acctnum']))
***************
*** 1009,1037 ****
else
{
$input_folder_arg = '';
}
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: $acctnum: ['.serialize($acctnum).'] ; $input_folder_arg:
['.serialize($input_folder_arg).']<br>'; }
! $mailsvr_stream = $this->get_arg_value('mailsvr_stream',
$acctnum);
! if ((isset($mailsvr_stream))
! && ((string)$mailsvr_stream != ''))
{
! if ($this->debug_logins > 0) { echo 'mail_msg:
open_stream_extra: PRE-EXISTING stream, do not re-login, $mailsvr_stream
['.serialize($mailsvr_stream).'] <br>'; }
}
else
{
$mailsvr_stream = '';
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: stream for this account needs to be opened, login to
$acctnum ['.$acctnum.']'.'<br>'; }
! $mailsvr_callstr =
$this->get_pref_value('mailsvr_callstr', $acctnum);
if ($this->get_isset_pref('passwd', $acctnum) == False)
{
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: this->a[$this->acctnum][prefs][passwd] NOT set, fallback to
$GLOBALS[phpgw_info][user][passwd]'.'<br>'; }
$pass =
$GLOBALS['phpgw_info']['user']['passwd'];
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: pass grabbed from GLOBALS[phpgw_info][user][passwd] =
'.htmlspecialchars(serialize($pass)).'<br>'; }
}
else
{
$pass =
$this->decrypt_email_passwd($this->get_pref_value('passwd', $acctnum));
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: pass decoded from prefs:
'.htmlspecialchars(serialize($this->get_pref_value('passwd'))).'<br>'; }
}
if ( $this->get_isset_pref('userid', $acctnum)
--- 1021,1052 ----
else
{
+ // an empty string means folder is NOT important, such
as with "listmailbox"
$input_folder_arg = '';
}
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: $acctnum: ['.serialize($acctnum).'] ;
$input_folder_arg: ['.serialize($input_folder_arg).']<br>'; }
! // get mailsvr_callstr now, it does not require a login stream
! $mailsvr_callstr = $this->get_arg_value('mailsvr_callstr',
$acctnum);
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: $mailsvr_callstr:
'.serialize($mailsvr_callstr).'<br>'; }
! if (($this->get_isset_arg('mailsvr_stream', $acctnum))
! && ((string)$this->get_arg_value('mailsvr_stream', $acctnum) !=
''))
{
! $mailsvr_stream =
$this->get_arg_value('mailsvr_stream', $acctnum);
! if ($this->debug_logins > 0) { echo 'mail_msg:
ensure_stream_and_folder: PRE-EXISTING stream, do not re-login, $mailsvr_stream
['.serialize($mailsvr_stream).'] <br>'; }
}
else
{
$mailsvr_stream = '';
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: stream for this account needs to be opened, login to
$acctnum ['.$acctnum.']'.'<br>'; }
if ($this->get_isset_pref('passwd', $acctnum) == False)
{
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: this->a[$this->acctnum][prefs][passwd] NOT set,
fallback to $GLOBALS[phpgw_info][user][passwd]'.'<br>'; }
$pass =
$GLOBALS['phpgw_info']['user']['passwd'];
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: pass grabbed from GLOBALS[phpgw_info][user][passwd] =
'.htmlspecialchars(serialize($pass)).'<br>'; }
}
else
{
$pass =
$this->decrypt_email_passwd($this->get_pref_value('passwd', $acctnum));
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: pass decoded from prefs:
'.htmlspecialchars(serialize($this->get_pref_value('passwd'))).'<br>'; }
}
if ( $this->get_isset_pref('userid', $acctnum)
***************
*** 1044,1053 ****
else
{
! echo 'mail_msg: open_stream_extra:
ERROR: userid or passwd empty'."<br>\r\n"
.' * *
$this->get_pref_value(userid, '.$acctnum.') = '
.$this->get_pref_value('userid', $acctnum)."<br>\r\n"
.' * * if the userid is filled,
then it must be the password that is missing'."<br>\r\n"
.' * * tell your admin if a)
you have a custom email password or not when reporting this error'."<br>\r\n";
! if ($this->debug_logins > 0) { echo 'mail_msg:
open_stream_extra: LEAVING with ERROR: userid or passwd empty<br>';}
return False;
}
--- 1059,1068 ----
else
{
! echo 'mail_msg:
ensure_stream_and_folder: ERROR: userid or passwd empty'."<br>\r\n"
.' * *
$this->get_pref_value(userid, '.$acctnum.') = '
.$this->get_pref_value('userid', $acctnum)."<br>\r\n"
.' * * if the userid is filled,
then it must be the password that is missing'."<br>\r\n"
.' * * tell your admin if a)
you have a custom email password or not when reporting this error'."<br>\r\n";
! if ($this->debug_logins > 0) { echo 'mail_msg:
ensure_stream_and_folder: LEAVING with ERROR: userid or passwd empty<br>';}
return False;
}
***************
*** 1055,1059 ****
// ---- Create email server Data Communication Class
----
$this_server_type =
$this->get_pref_value('mail_server_type', $acctnum);
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: 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);
--- 1070,1074 ----
// ---- Create email server Data Communication Class
----
$this_server_type =
$this->get_pref_value('mail_server_type', $acctnum);
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: 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);
***************
*** 1071,1079 ****
// log in to INBOX because we know INBOX should exist
on every mail server, "reopen" to desired folder (if different) later
set_time_limit(60);
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: about to call dcom->open:
$GLOBALS["phpgw_dcom_'.$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);
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: open returns $mailsvr_stream =
['.serialize($mailsvr_stream).']<br>'; }
if ( (!isset($mailsvr_stream))
--- 1086,1094 ----
// log in to INBOX because we know INBOX should exist
on every mail server, "reopen" to desired folder (if different) later
set_time_limit(60);
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: about to call dcom->open:
$GLOBALS[phpgw_dcom_'.$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);
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: open returns $mailsvr_stream =
['.serialize($mailsvr_stream).']<br>'; }
if ( (!isset($mailsvr_stream))
***************
*** 1081,1143 ****
{
$this->set_arg_value('mailsvr_stream', '',
$acctnum);
! if ($this->debug_logins > 0) { echo 'mail_msg:
open_stream_extra: LEAVING with ERROR: failed to open mailsvr_stream :
'.$mailsvr_stream.'<br>';}
return False;
}
$this->set_arg_value('mailsvr_stream', $mailsvr_stream,
$acctnum);
$this->set_arg_value('mailsvr_account_username', $user,
$acctnum);
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: ... we just opened stream for $acctnum:
['.serialize($acctnum).'] continue ...<br>'; }
}
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: we have a stream for $acctnum: ['.serialize($acctnum).']
continue ...<br>'; }
// ---- Switch To Desired Folder If Necessary ----
! // class will get this data on its own to do the lookup in
prep_folder_in anyway, so might as well get it for us here at the same time
! $mailsvr_namespace = $this->get_arg_value('mailsvr_namespace',
$acctnum);
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: $mailsvr_namespace: '.serialize($mailsvr_namespace).'<br>'; }
! $mailsvr_delimiter = $this->get_arg_value('mailsvr_delimiter',
$acctnum);
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: $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 ($input_folder_arg == '')
{
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: 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:
open_stream_extra: "get_best_folder_arg" returns $processed_folder_arg
['.htmlspecialchars(serialize($processed_folder_arg)).']<br>'; }
}
! else
{
! $processed_folder_arg =
$this->prep_folder_in($input_folder_arg);
! }
!
!
! if ($processed_folder_arg == 'INBOX')
! {
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: 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,
$acctnum);
}
else
{
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: need to switch folders (reopen) from INBOX to
$processed_folder_arg: '.$processed_folder_arg.'<br>';}
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: about to issue:
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->reopen('.$mailsvr_stream.',
'.$mailsvr_callstr.$processed_folder_arg,', )'.'<br>';}
! $did_reopen =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->reopen($mailsvr_stream,
$mailsvr_callstr.$processed_folder_arg, '');
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: reopen returns: '.serialize($did_reopen).'<br>';}
! if ($did_reopen == False)
! {
! if ($this->debug_logins > 0) { echo 'mail_msg:
open_stream_extra: LEAVING with re-open ERROR, closing stream, FAILED to reopen
(change folders) $mailsvr_stream ['.$mailsvr_stream.'] INBOX to
['.$mailsvr_callstr.$processed_folder_arg.'<br>';}
! $this->end_request(
! array(
! 'acctnum' => $acctnum
! )
! );
! return False;
}
else
{
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: Successful switch folders (reopen) from (default initial
folder) INBOX to ['.$processed_folder_arg.']<br>';}
! if ($this->debug_logins > 1) { echo 'mail_msg:
open_stream_extra: switched folders (via reopen), about to issue:
$this->set_arg_value("folder", '.$processed_folder_arg.')<br>'; }
! $this->set_arg_value('folder',
$processed_folder_arg, $acctnum);
}
}
! return $this->get_arg_value('mailsvr_stream', $acctnum);
}
--- 1096,1176 ----
{
$this->set_arg_value('mailsvr_stream', '',
$acctnum);
! if ($this->debug_logins > 0) { echo 'mail_msg:
ensure_stream_and_folder: LEAVING with ERROR: failed to open mailsvr_stream :
'.$mailsvr_stream.'<br>';}
return False;
}
$this->set_arg_value('mailsvr_stream', $mailsvr_stream,
$acctnum);
$this->set_arg_value('mailsvr_account_username', $user,
$acctnum);
! // SET FOLDER ARG NOW because we'll need to check
against it below!!!
! $this->set_arg_value('folder', 'INBOX', $acctnum);
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: ... we just opened stream for $acctnum:
['.serialize($acctnum).'] continue ...<br>'; }
}
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: we have a stream for $acctnum:
['.serialize($acctnum).'] continue ...<br>'; }
// ---- Switch To Desired Folder If Necessary ----
! $pre_opened_folder = '';
! if (($this->get_isset_arg('folder', $acctnum))
! && ($this->get_arg_value('folder', $acctnum) != ''))
! {
! $pre_opened_folder = $this->get_arg_value('folder',
$acctnum);
! }
! // an empty $input_folder_arg *should* means having a specific
folder opened is NOT important to the calling function
! // such as with "listmailbox", any folder will do
if ($input_folder_arg == '')
{
! // an empty string means folder is NOT important, such
as with "listmailbox"
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: NO need to switch folders: $input_folder_arg is
empty, so folder is *probably* not important to the calling process
$called_from: ['.$called_from.']<br>'; }
}
! elseif (($input_folder_arg == 'INBOX')
! && ($pre_opened_folder == 'INBOX' ))
{
! // no need to do anything because
! // 1) "INBOX" does not need to be passed thru
$this->prep_folder_in(), so we directly can test against $input_folder_arg
! // 2) if we're here then it's because we (a) had an
existing stream opened to INBOX or (b) we just opened a stream to INBOX just
above here
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: NO need to switch folders: both $input_folder_arg and
$pre_opened_folder == INBOX<br>'; }
}
else
{
! // class will get this data on its own to do the lookup
in prep_folder_in anyway, so might as well get it for us here at the same time
! $mailsvr_namespace =
$this->get_arg_value('mailsvr_namespace', $acctnum);
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: $mailsvr_namespace:
'.serialize($mailsvr_namespace).'<br>'; }
! $mailsvr_delimiter =
$this->get_arg_value('mailsvr_delimiter', $acctnum);
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: $mailsvr_delimiter:
'.serialize($mailsvr_delimiter).'<br>'; }
! // do this now so we can check against it in the elseif
block without having to call it several different times
! $processed_folder_arg =
$this->prep_folder_in($input_folder_arg);
!
! if (($pre_opened_folder != '')
! && ($pre_opened_folder == $processed_folder_arg))
! {
! // the desired folder is already opened, note
this could simply be INBOX
! // because we did set "folder" arg during the
initial open just above
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: NO need to switch folders: $processed_folder_arg
['.$processed_folder_arg.'] == $pre_opened_folder
['.$pre_opened_folder.']<br>'; }
}
else
{
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: need to switch folders (reopen) from
$pre_opened_folder ['.$pre_opened_folder.'] to $processed_folder_arg:
'.$processed_folder_arg.'<br>';}
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: about to issue:
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->reopen('.$mailsvr_stream.',
'.$mailsvr_callstr.$processed_folder_arg,', )'.'<br>';}
! $did_reopen =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->reopen($mailsvr_stream,
$mailsvr_callstr.$processed_folder_arg, '');
! if ($this->debug_logins > 1) { echo 'mail_msg:
ensure_stream_and_folder: reopen returns: '.serialize($did_reopen).'<br>';}
! if ($did_reopen == False)
! {
! if ($this->debug_logins > 0) { echo
'mail_msg: ensure_stream_and_folder: LEAVING with re-open ERROR, closing
stream, FAILED to reopen (change folders) $mailsvr_stream ['.$mailsvr_stream.']
$pre_opened_folder ['.$pre_opened_folder.'] to
['.$mailsvr_callstr.$processed_folder_arg.'<br>';}
! $end_request_args = array();
! $end_request_args['acctnum'] = $acctnum;
! // only need to close this specific
stream, leave other streams (if any) alone
! $this->end_request($end_request_args);
! return False;
! }
! else
! {
! if ($this->debug_logins > 1) { echo
'mail_msg: ensure_stream_and_folder: Successful switch folders (reopen) from
(default initial folder) INBOX to ['.$processed_folder_arg.']<br>';}
! if ($this->debug_logins > 1) { echo
'mail_msg: ensure_stream_and_folder: switched folders (via reopen), about to
issue: $this->set_arg_value("folder", '.$processed_folder_arg.')<br>'; }
! $this->set_arg_value('folder',
$processed_folder_arg, $acctnum);
! }
}
}
! $return_mailsvr_stream = $this->get_arg_value('mailsvr_stream',
$acctnum);
! if ($this->debug_logins > 0) { echo 'mail_msg:
ensure_stream_and_folder: LEAVING, returning
$this->get_arg_value(mailsvr_stream, '.$acctnum.')
['.$return_mailsvr_stream.']<br>'; }
! return $return_mailsvr_stream;
}
***************
*** 1423,1430 ****
// in addition to the users private mailboxes
// see http://www.faqs.org/rfcs/rfc2060.html section
6.3.8 (which is not entirely clear on this)
! // FIXME: abstract this class dcom call in
mail_msg_wrappers
! if ($this->debug_args_special_handlers > 1) { echo
'mail_msg: get_mailsvr_namespace: issuing:
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->listmailbox('.$mailsvr_stream.',
'.$mailsvr_callstr.', %)'.'<br>'; }
! $name_space =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,
$mailsvr_callstr, '%');
if ($this->debug_args_special_handlers > 2) { echo
'mail_msg: get_mailsvr_namespace: raw $name_space dump<pre>';
print_r($name_space); echo '</pre>'; }
--- 1456,1464 ----
// in addition to the users private mailboxes
// see http://www.faqs.org/rfcs/rfc2060.html section
6.3.8 (which is not entirely clear on this)
! //if ($this->debug_args_special_handlers > 1) { echo
'mail_msg: get_mailsvr_namespace: issuing:
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->listmailbox('.$mailsvr_stream.',
'.$mailsvr_callstr.', %)'.'<br>'; }
! if ($this->debug_args_special_handlers > 1) { echo
'mail_msg: get_mailsvr_namespace: issuing:
$this->phpgw_listmailbox('.$mailsvr_callstr.', \'%\', '.$acctnum.')<br>'; }
! //$name_space =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,
$mailsvr_callstr, '%');
! $name_space =
$this->phpgw_listmailbox($mailsvr_callstr, '%', $acctnum);
if ($this->debug_args_special_handlers > 2) { echo
'mail_msg: get_mailsvr_namespace: raw $name_space dump<pre>';
print_r($name_space); echo '</pre>'; }
***************
*** 1662,1670 ****
(old) Example (Cyrus only): drafts.rfc
*/
! function get_folder_short($feed_folder='INBOX')
{
// Example: "Sent"
// Cyrus may support "Sent.Today"
!
$feed_folder = urldecode($feed_folder);
$folder = $this->ensure_no_brackets($feed_folder);
--- 1696,1709 ----
(old) Example (Cyrus only): drafts.rfc
*/
! function get_folder_short($feed_folder='INBOX', $acctnum='')
{
// Example: "Sent"
// Cyrus may support "Sent.Today"
! // note: we need $acctnum to obtain the right namespace and
delimiter, so we can strip them
! if ((!isset($acctnum))
! || ((string)$acctnum == ''))
! {
! $acctnum = $this->get_acctnum();
! }
$feed_folder = urldecode($feed_folder);
$folder = $this->ensure_no_brackets($feed_folder);
***************
*** 1676,1681 ****
else
{
! $name_space = $this->get_arg_value('mailsvr_namespace');
! $delimiter = $this->get_arg_value('mailsvr_delimiter');
//if (strstr($folder,"$name_space" ."$delimiter") ==
False)
// "INBOX" as namespace is NOT supposed to be case
sensitive
--- 1715,1720 ----
else
{
! $name_space = $this->get_arg_value('mailsvr_namespace',
$acctnum);
! $delimiter = $this->get_arg_value('mailsvr_delimiter',
$acctnum);
//if (strstr($folder,"$name_space" ."$delimiter") ==
False)
// "INBOX" as namespace is NOT supposed to be case
sensitive
***************
*** 1722,1726 ****
if ($this->debug_args_special_handlers > 0) { echo 'mail_msg:
get_folder_list: ENTERING<br>'; }
if ($this->debug_args_special_handlers > 1) { echo 'mail_msg:
get_folder_list: for the rest of this function we will use $acctnum:
['.$acctnum.'] <br>'; }
!
if (stristr($this->skip_args_special_handlers,
'get_folder_list'))
{
--- 1761,1765 ----
if ($this->debug_args_special_handlers > 0) { echo 'mail_msg:
get_folder_list: ENTERING<br>'; }
if ($this->debug_args_special_handlers > 1) { echo 'mail_msg:
get_folder_list: for the rest of this function we will use $acctnum:
['.$acctnum.'] <br>'; }
! // hardcore debug
if (stristr($this->skip_args_special_handlers,
'get_folder_list'))
{
***************
*** 1734,1740 ****
}
! if ($this->debug_args_special_handlers > 2) { echo 'mail_msg:
get_folder_list: $$this->_direct_access_arg_value(folder_list, '.$acctnum.')
dump:<pre>'; print_r($this->_direct_access_arg_value('folder_list', $acctnum));
echo '</pre>'; }
! // check if class dcom reports that the folder list has changed
if ((is_object($GLOBALS['phpgw_dcom_'.$acctnum]->dcom))
&& ($GLOBALS['phpgw_dcom_'.$acctnum]->dcom->folder_list_changed
== True))
--- 1773,1780 ----
}
! //if ($this->debug_args_special_handlers > 2) { echo 'mail_msg:
get_folder_list: $this->_direct_access_arg_value(folder_list, '.$acctnum.')
dump:<pre>'; print_r($this->_direct_access_arg_value('folder_list', $acctnum));
echo '</pre>'; }
! // check if class dcom reports that the folder list has changed
! // is this accounts dcom object has not been created yet, then
obviously we did not just change its folder list
if ((is_object($GLOBALS['phpgw_dcom_'.$acctnum]->dcom))
&& ($GLOBALS['phpgw_dcom_'.$acctnum]->dcom->folder_list_changed
== True))
***************
*** 1764,1767 ****
--- 1804,1808 ----
// see if we have object class var cached data that we can use
$class_cached_folder_list =
$this->_direct_access_arg_value('folder_list', $acctnum);
+ if ($this->debug_args_special_handlers > 2) { echo 'mail_msg:
get_folder_list: $this->_direct_access_arg_value(folder_list, '.$acctnum.')
dump:<pre>'; print_r($this->_direct_access_arg_value('folder_list', $acctnum));
echo '</pre>'; }
if ((count($class_cached_folder_list) > 0)
&& ($force_refresh == False))
***************
*** 1824,1831 ****
// that cuts cached data in 1/2, no need to
cache something this easy to deduce
// therefor... add FOLDER SHORT element to
cached_data array structure
! if ($this->debug_args_special_handlers > 1) {
echo 'mail_msg: get_folder_list: adding [folder_short] element to
$this->a['.$acctnum.'][folder_list] array<br>';}
for ($i=0; $i<count($cached_data);$i++)
{
! $cached_data[$i]['folder_short'] =
$this->get_folder_short($cached_data[$i]['folder_long']);
if ($this->debug_args_special_handlers
> 2) { echo ' * *
$cached_data['.$i.'][folder_long]='.htmlspecialchars($cached_data[$i]['folder_long']).'
;
$cached_data['.$i.'][folder_short]='.htmlspecialchars($cached_data[$i]['folder_short']).'<br>';}
}
--- 1865,1877 ----
// that cuts cached data in 1/2, no need to
cache something this easy to deduce
// therefor... add FOLDER SHORT element to
cached_data array structure
! if ($this->debug_args_special_handlers > 1) {
echo 'mail_msg: get_folder_list: (L1) adding [folder_short] element to
$cached_data array<br>';}
for ($i=0; $i<count($cached_data);$i++)
{
! $my_folder_long =
$cached_data[$i]['folder_long'];
! $my_folder_acctnum =
$cached_data[$i]['acctnum'];
! $my_folder_short =
$this->get_folder_short($my_folder_long, $my_folder_acctnum);
! if ($this->debug_args_special_handlers
> 1) { echo '* * mail_msg: get_folder_list: add folder_short loop (L1)
['.$i.']: $my_folder_long ['.$my_folder_long.'] ; $my_folder_acctnum
['.$my_folder_acctnum.'] ; $my_folder_short ['.$my_folder_short.']<br>'; }
! $cached_data[$i]['folder_short'] =
$my_folder_short;
! //$cached_data[$i]['folder_short'] =
$this->get_folder_short($cached_data[$i]['folder_long']);
if ($this->debug_args_special_handlers
> 2) { echo ' * *
$cached_data['.$i.'][folder_long]='.htmlspecialchars($cached_data[$i]['folder_long']).'
;
$cached_data['.$i.'][folder_short]='.htmlspecialchars($cached_data[$i]['folder_short']).'<br>';}
}
***************
*** 1870,1874 ****
// UWash will consider it relative to the mailuser's
$HOME property as with "emails/*" (DOES THIS WORK ON ALL PLATFORMS??)
// BUT we use <tilde><slash> "~/" if no namespace is
given
! $mailboxes =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,
$mailsvr_callstr, "$name_space" ."$delimiter" ."*");
// UWASH IMAP returns information in this format:
// {SERVER_NAME:PORT}FOLDERNAME
--- 1916,1920 ----
// UWash will consider it relative to the mailuser's
$HOME property as with "emails/*" (DOES THIS WORK ON ALL PLATFORMS??)
// BUT we use <tilde><slash> "~/" if no namespace is
given
! $mailboxes = $this->phpgw_listmailbox($mailsvr_callstr,
"$name_space" ."$delimiter" ."*", $acctnum);
// UWASH IMAP returns information in this format:
// {SERVER_NAME:PORT}FOLDERNAME
***************
*** 1888,1893 ****
// UPDATED information of this issue: to get shared
folders included in the return, better NOT include the "." delimiter
// example: Cyrus does not like anything but a "*" as
the pattern IF you want shared folders returned.
! //$mailboxes =
$tmp_a['dcom']->listmailbox($mailsvr_stream, $mailsvr_callstr, "*");
! $mailboxes =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,
$mailsvr_callstr, "*");
// returns information in this format:
// {SERVER_NAME:PORT} NAMESPACE DELIMITER FOLDERNAME
--- 1934,1938 ----
// UPDATED information of this issue: to get shared
folders included in the return, better NOT include the "." delimiter
// example: Cyrus does not like anything but a "*" as
the pattern IF you want shared folders returned.
! $mailboxes = $this->phpgw_listmailbox($mailsvr_callstr,
"*", $acctnum);
// returns information in this format:
// {SERVER_NAME:PORT} NAMESPACE DELIMITER FOLDERNAME
***************
*** 1935,1939 ****
{
if ($this->debug_args_special_handlers > 1) { echo
'mail_msg: get_folder_list: adding INBOX to mailboxes data<br>'; }
! // use the same "fully qualified" folder name format
that "listmailbox" returns, includes the {serverName:port}
$add_inbox = $mailsvr_callstr.'INBOX';
$next_available = count($mailboxes);
--- 1980,1984 ----
{
if ($this->debug_args_special_handlers > 1) { echo
'mail_msg: get_folder_list: adding INBOX to mailboxes data<br>'; }
! // use the same "fully qualified" folder name format
that "phpgw_listmailbox" returns, includes the {serverName:port}
$add_inbox = $mailsvr_callstr.'INBOX';
$next_available = count($mailboxes);
***************
*** 1991,1995 ****
for ($i=0; $i<count($my_folder_list);$i++)
{
! $my_folder_list[$i]['folder_short'] =
$this->get_folder_short($my_folder_list[$i]['folder_long']);
}
// cache the result to "level 1 cache" class arg holder var
--- 2036,2044 ----
for ($i=0; $i<count($my_folder_list);$i++)
{
! $my_folder_long = $my_folder_list[$i]['folder_long'];
! $my_folder_acctnum = $my_folder_list[$i]['acctnum'];
! $my_folder_short =
$this->get_folder_short($my_folder_long, $my_folder_acctnum);
! if ($this->debug_args_special_handlers > 1) { echo
'mail_msg: get_folder_list: add folder_short loop['.$i.']: $my_folder_long
['.$my_folder_long.'] ; $my_folder_acctnum ['.$my_folder_acctnum.'] ;
$my_folder_short ['.$my_folder_short.']<br>'; }
! $my_folder_list[$i]['folder_short'] = $my_folder_short;
}
// cache the result to "level 1 cache" class arg holder var
Index: class.mail_msg_display.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_display.inc.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** class.mail_msg_display.inc.php 14 Jan 2002 20:51:37 -0000 1.32
--- class.mail_msg_display.inc.php 20 Jan 2002 23:58:47 -0000 1.33
***************
*** 214,218 ****
}
!
// ---- Messages Sort Order Start and Msgnum -----
function fill_sort_order_start_msgnum()
--- 214,379 ----
}
! /*!
! @function folders_mega_listbox
! @abstract like "all_folders_listbox" except it really shows ALL folder
from EVERY account
! @param $feed_args[] array or args that you will "feed" into the
function ??
! @result string representing an HTML listbox widget
! @discussion ?
! @access : private
! */
! function folders_mega_listbox($feed_args='')
! {
! if(!$feed_args)
! {
! $feed_args=array();
! }
! //$debug_widget = True;
! $debug_widget = False;
!
! $acctnum = $this->get_acctnum();
! // establish fallback default args
! $local_args = Array(
! 'acctnum' => $acctnum,
! 'mailsvr_stream' =>
$this->get_arg_value('mailsvr_stream', $acctnum),
! 'pre_select_folder' => '',
! 'pre_select_folder_acctnum' => $acctnum,
! 'skip_folder' => '',
! 'show_num_new' => False,
! 'widget_name' => 'folder_fake_uri',
! 'folder_key_name' => 'folder',
! 'acctnum_key_name' => 'acctnum',
! 'on_change' =>
'document.switchbox.submit()',
! 'first_line_txt' => lang('switch current folder
to')
! );
! // loop thru $local_args[], replacing defaults with any args
specified in $feed_args[]
! if ($debug_widget) { echo 'folders_mega_listbox $feed_args data
dump<pre>'; print_r($feed_args); echo '</pre>'; }
! if (count($feed_args) == 0)
! {
! if ($debug_widget) { echo 'folders_mega_listbox
$feed_args is EMPTY<br>'.serialize($feed_args).'<br>'; }
! }
! else
! {
! reset($local_args);
! // the feed args may not be an array, the @ will
supress warnings
! @reset($feed_args);
! while(list($key,$value) = each($local_args))
! {
! // DEBUG
! if ($debug_widget) { echo 'a: local_args:
key=['.$key.'] value=['.(string)$value.']<br>'; }
! if ($debug_widget) { echo 'b: feed_args:
key=['.$key.'] value=['.(string)$feed_args[$key].']<br>'; }
! if ((isset($feed_args[$key]))
! && ($feed_args[$key] != $value))
! {
! if (($key == 'mailsvr_stream')
! && ($feed_args[$key] == ''))
! {
! // do nothing, keep the default
value, can not over write a good default stream with an empty value
! if ($debug_widget) { echo '*
keeping default [mailsvr_stream] value, can not override with a blank
string<br>'; }
! }
! else
! {
! // we have a specified arg that
should replace the default value
! if ($debug_widget) { echo '***
override default value of ['.$local_args[$key] .'] with feed_args['.$key.'] of
['.(string)$feed_args[$key].']<br>'; }
! $local_args[$key] =
$feed_args[$key];
! }
! }
! }
! reset($local_args);
! @reset($feed_args);
! }
! // at this point, local_args[] has anything that was passed in
the feed_args[]
! if ($debug_widget) { echo 'FINAL Listbox Local
Args:<br>'.serialize($local_args).'<br>'; }
!
! $item_tags = '';
!
! // we need the loop to include the default account AS WELL AS
the extra accounts
! for ($x=0; $x < count($this->extra_and_default_acounts); $x++)
! {
! $this_acctnum =
$this->extra_and_default_acounts[$x]['acctnum'];
! $this_status =
$this->extra_and_default_acounts[$x]['status'];
! if ($this_status != 'enabled')
! {
! // Do Nothing, This account is not in use
! }
! else
! {
! // get the actual list of folders we are going
to put into the combobox
! $folder_list =
$this->get_folder_list($this_acctnum);
! if ($debug_widget) { echo 'folders_mega_listbox
$folder_list for $this_acctnum ['.$this_acctnum.'] DUMP<pre>';
print_r($folder_list); echo '</pre>'; }
! // NNTP = BORKED CODE!!! (ignore for now) ...
! if ($this->get_arg_value('newsmode',
$this_acctnum))
! {
! while($pref =
each($GLOBALS['phpgw_info']['user']['preferences']['nntp']))
! {
!
$GLOBALS['phpgw']->db->query('SELECT name FROM newsgroups WHERE con='.$pref[0]);
!
while($GLOBALS['phpgw']->db->next_record())
! {
! $item_tags .= '<option
value="' . urlencode($GLOBALS['phpgw']->db->f('name')) . '">' .
$GLOBALS['phpgw']->db->f('name')
! . '</option>';
! }
! }
! break;
! }
! // ... back to working code
!
! // iterate thru the folder list, building the
HTML tags using that data
! for ($i=0; $i<count($folder_list);$i++)
! {
! $folder_long =
$folder_list[$i]['folder_long'];
! $folder_short =
$folder_list[$i]['folder_short'];
! // yes we need $folder_acctnum to help
make the "folder ball", yes I know it *should* be the same as $this_acctnum
! $folder_acctnum =
$folder_list[$i]['acctnum'];
! // this logic determines if the
combobox should be initialized with certain folder already selected
! // we use "folder short" as the
comparator because that way at least we know we are comparing syntatic-ally
similar items
! if (($folder_short ==
$this->get_folder_short($local_args['pre_select_folder']))
! && ($folder_acctnum ==
$local_args['pre_select_folder_acctnum']))
! {
! $sel = ' selected';
! }
! else
! {
! $sel = '';
! }
! // this logic determines we should not
include a certain folder in the combobox list
! if ($folder_short !=
$this->get_folder_short($local_args['skip_folder']))
! {
! // we need to make value="X"
imitate URI type data, so we can embed the acctnum data
! // for the folder in there with
folder name, whereas normally option value="X" can only
! // hold no nore than one data
item as limited by BOTH html and php 's treatment of a combobox
!
! $option_value =
'&'.$local_args['folder_key_name'].'='.$this->prep_folder_out($folder_long)
!
.'&'.$local_args['acctnum_key_name'].'='.$folder_acctnum;
!
! $text_blurb =
'['.$folder_acctnum.'] '.$folder_short;
!
! $item_tags .= '<option
value="'.$option_value.'"'.$sel.'>'.$text_blurb.'</option>'."\r\n";
! }
! }
! }
! }
! // now $item_tags contains the internal (i.e. "option" items)
folder list for this "select" combobox widget
!
! // ---- add the HTML tags that surround this internal list
data ----
! if ((isset($local_args['on_change']))
! && ($local_args['on_change'] != ''))
! {
! $on_change_tag =
'onChange="'.$local_args['on_change'].'"';
! }
! else
! {
! $on_change_tag = '';
! }
!
! // the widget_name with "_fake_uri" tells the script what to do
with this data
! $listbox_widget =
! '<select name="'.$local_args['widget_name'].'"
'.$on_change_tag.'>'
! .'<option
value="">'.$local_args['first_line_txt'].' '
! . $item_tags
! .'</select>';
! // return a pre-built HTML listbox (selectbox) widget
! return $listbox_widget;
! }
!
!
// ---- Messages Sort Order Start and Msgnum -----
function fill_sort_order_start_msgnum()
***************
*** 417,421 ****
'folder_key_name' => 'folder',
'acctnum_key_name' => 'acctnum',
! 'on_change' => 'document.acctbox.submit()'
);
// loop thru $local_args[], replacing defaults with any args
specified in $feed_args[]
--- 578,585 ----
'folder_key_name' => 'folder',
'acctnum_key_name' => 'acctnum',
! 'on_change' =>
'document.acctbox.submit()',
! 'is_multiple' => False,
! 'multiple_rows' => '4',
! 'show_status_is' => 'enabled,disabled'
);
// loop thru $local_args[], replacing defaults with any args
specified in $feed_args[]
***************
*** 451,479 ****
$item_tags = '';
- // ---- add the default email account, account number 0 ----
- // this logic determines if the combobox should be initialized
with certain account already selected
- if ((string)$local_args['pre_select_acctnum'] == '0')
- {
- $sel = ' selected';
- }
- else
- {
- $sel = '';
- }
- // this fake_uri data will be converted to fldball data on
submit processing
- $option_value = '&'.$local_args['folder_key_name'].'=INBOX'
- .'&'.$local_args['acctnum_key_name'].'=0';
- //$option_text = lang('default account').' '.lang('as').'
"'.$this->get_pref_value('fullname', 0).'"';
- //$option_text =
lang('default').' '.$this->get_pref_value('fullname', 0);
- $option_text =
lang('default:').' '.$this->get_pref_value('fullname', 0);
-
- $item_tags .= '<option
value="'.$option_value.'"'.$sel.'>'.$option_text.'</option>'."\r\n";
-
// iterate thru the ex_accounts list, building the HTML tags
using that data
! for ($i=0; $i < count($this->extra_accounts); $i++)
{
! $this_acctnum = $this->extra_accounts[$i]['acctnum'];
// is this account "enabled", "disabled", or "empty"
! if ($this->extra_accounts[$i]['status'] == 'disabled')
{
// the option values below are in the form of
embedded fake_uri
--- 615,625 ----
$item_tags = '';
// iterate thru the ex_accounts list, building the HTML tags
using that data
! for ($i=0; $i < count($this->extra_and_default_acounts); $i++)
{
! $this_acctnum =
$this->extra_and_default_acounts[$i]['acctnum'];
// is this account "enabled", "disabled", or "empty"
! if ((stristr($local_args['show_status_is'], 'disabled'))
! && ($this->extra_and_default_acounts[$i]['status'] ==
'disabled'))
{
// the option values below are in the form of
embedded fake_uri
***************
*** 487,491 ****
$item_tags .= '<option
value="'.$option_value.'">'.$option_text.'</option>'."\r\n";
}
! elseif ($this->extra_accounts[$i]['status'] ==
'enabled')
{
// this logic determines if the combobox should
be initialized with certain account already selected
--- 633,638 ----
$item_tags .= '<option
value="'.$option_value.'">'.$option_text.'</option>'."\r\n";
}
! elseif ((stristr($local_args['show_status_is'],
'enabled'))
! && ($this->extra_and_default_acounts[$i]['status'] ==
'enabled'))
{
// this logic determines if the combobox should
be initialized with certain account already selected
***************
*** 526,532 ****
}
// the widget_name with "_fake_uri" tells the script what to do
with this data
$listbox_widget =
! '<select name="'.$local_args['widget_name'].'"
'.$on_change_tag.'>'
. $item_tags
.'</select>';
--- 673,688 ----
}
+ // if this is a multi-selectable scroll box, make the necessary
tags
+ if (!$local_args['is_multiple'])
+ {
+ $if_multiple_tags = '';
+ }
+ else
+ {
+ $if_multiple_tags =
'size="'.$local_args['multiple_rows'].'" multiple';
+ }
// the widget_name with "_fake_uri" tells the script what to do
with this data
$listbox_widget =
! '<select name="'.$local_args['widget_name'].'"
'.$on_change_tag.' '.$if_multiple_tags.'>'
. $item_tags
.'</select>';
Index: class.mail_msg_wrappers.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_wrappers.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** class.mail_msg_wrappers.inc.php 14 Jan 2002 20:51:37 -0000 1.24
--- class.mail_msg_wrappers.inc.php 20 Jan 2002 23:58:47 -0000 1.25
***************
*** 450,455 ****
{
$mailsvr_stream =
$this->get_arg_value('mailsvr_stream');
! $retval =
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->i_search($mailsvr_stream,$criteria,$flags);
! return $retval;
}
--- 450,454 ----
{
$mailsvr_stream =
$this->get_arg_value('mailsvr_stream');
! return
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->i_search($mailsvr_stream,$criteria,$flags);
}
***************
*** 459,464 ****
$mailsvr_stream =
$this->get_arg_value('mailsvr_stream', $acctnum);
$folder = $target_fldball['folder'];
! $retval =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->createmailbox($mailsvr_stream, $folder);
! return $retval;
}
--- 458,462 ----
$mailsvr_stream =
$this->get_arg_value('mailsvr_stream', $acctnum);
$folder = $target_fldball['folder'];
! return
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->createmailbox($mailsvr_stream, $folder);
}
***************
*** 468,473 ****
$mailsvr_stream =
$this->get_arg_value('mailsvr_stream', $acctnum);
$folder = $target_fldball['folder'];
! $retval =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->deletemailbox($mailsvr_stream, $folder);
! return $retval;
}
--- 466,470 ----
$mailsvr_stream =
$this->get_arg_value('mailsvr_stream', $acctnum);
$folder = $target_fldball['folder'];
! return
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->deletemailbox($mailsvr_stream, $folder);
}
***************
*** 478,483 ****
$folder_old = $source_fldball['folder'];
$folder_new = $target_fldball['folder'];
! $retval =
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->renamemailbox($mailsvr_stream,
$folder_old, $folder_new);
! return $retval;
}
--- 475,501 ----
$folder_old = $source_fldball['folder'];
$folder_new = $target_fldball['folder'];
! return
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->renamemailbox($mailsvr_stream,
$folder_old, $folder_new);
! }
!
! function phpgw_listmailbox($ref,$pattern,$acctnum)
! {
! if (!(isset($acctnum))
! || ((string)$acctnum == ''))
! {
! $acctnum = $this->get_acctnum();
! }
! // Make Sure Stream Exists
! // multiple accounts means one stream may be open but
another may not
! // "ensure_stream_and_folder" will verify for us,
! // folder logged into does not matter for listmailbox,
so leave it blank
! $fake_fldball = array();
! $fake_fldball['acctnum'] = $acctnum;
! $fake_fldball['folder'] = '';
! $this->ensure_stream_and_folder($fake_fldball,
'phpgw_listmailbox');
! $mailsvr_stream =
$this->get_arg_value('mailsvr_stream', $acctnum);
!
! // ... so stream exists, do the transaction ...
! //echo '<b>phpgw_listmailbox</b>: about to call
$GLOBALS[phpgw_dcom_'.$acctnum.']->dcom->listmailbox($mailsvr_stream['.$mailsvr_stream.'],$ref['.$ref.'],
$pattern['.$pattern.']); <br>';
! return
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->listmailbox($mailsvr_stream,$ref,$pattern);
}
Index: class.uifilters.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.uifilters.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.uifilters.inc.php 18 Jan 2002 23:15:52 -0000 1.1
--- class.uifilters.inc.php 20 Jan 2002 23:58:47 -0000 1.2
***************
*** 20,24 ****
);
var $bo;
! var $debug = 0;
function uifilters()
--- 20,24 ----
);
var $bo;
! var $debug = 3;
function uifilters()
***************
*** 51,55 ****
)
);
!
$GLOBALS['phpgw']->template->set_block('T_filters_blocks','B_account_and_or_ignore','V_account_and_or_ignore');
$GLOBALS['phpgw']->template->set_block('T_filters_blocks','B_action_no_ignore','V_action_no_ignore');
$GLOBALS['phpgw']->template->set_block('T_filters_blocks','B_action_with_ignore_me','V_action_with_ignore_me');
--- 51,56 ----
)
);
!
$GLOBALS['phpgw']->template->set_block('T_filters_blocks','B_match_account_box','V_match_account_box');
!
$GLOBALS['phpgw']->template->set_block('T_filters_blocks','B_match_and_or_ignore','V_match_and_or_ignore');
$GLOBALS['phpgw']->template->set_block('T_filters_blocks','B_action_no_ignore','V_action_no_ignore');
$GLOBALS['phpgw']->template->set_block('T_filters_blocks','B_action_with_ignore_me','V_action_with_ignore_me');
***************
*** 57,155 ****
$GLOBALS['phpgw']->template->set_block('T_filters_out','B_actions_row','V_actions_row');
! // setup some form vars
! $form_edit_filter_btn_name = 'submit_filters';
! $form_edit_filter_action = $GLOBALS['phpgw']->link(
! '/index.php',
!
'menuaction=email.uifilters.filters_edit');
! $form_cancel_btn_name = 'filerpage_cancel';
! $form_cancel_action = $GLOBALS['phpgw']->link(
! '/index.php',
!
'menuaction=email.uifilters.filters_list');
!
! // make the filters object
! $this->bo = CreateObject("email.bofilters");
! $this->bo->submit_flag = $form_edit_filter_btn_name;
! $this->bo->distill_filter_args();
! $mlist_html = '';
! if (count($this->bo->filters) > 0)
! {
!
! if ($this->debug > 1) { echo
'uifilters.filters_edit: count($this->bo->filters):
['.count($this->bo->filters).'] ; <br>'."\r\n"; }
! //$this->bo->sieve_to_imap_string();
! $this->bo->do_imap_search();
! //if ($this->debug > 0) { echo 'message list
print_r dump:<b><pre>'."\r\n"; print_r($this->bo->result_set_mlist); echo
'</pre><br><br>'."\r\n"; }
! $this->bo->make_mlist_box();
! $mlist_html =
! '<table border="0" cellpadding="4"
cellspacing="1" width="90%" align="center">'."\r\n"
! .$this->bo->finished_mlist."\r\n"
! .'</table>'."\r\n"
! .'<p> </p>'."\r\n"
! .$this->bo->submit_mlist_to_class_form
! .'<p> </p>'."\r\n";
!
! }
!
$GLOBALS['phpgw']->template->set_var('V_mlist_html',$mlist_html);
!
!
! // DEBUGGING
! if ($this->debug > 2) { echo 'uifilters.filters:
HTTP_POST_VARS dump:<b>'."\r\n"; var_dump($GLOBALS['HTTP_POST_VARS']); echo
'<br><br>'."\r\n"; }
! // dump submitted data for inspection
! //$show_data_dump = True;
! //$show_data_dump = False;
! $show_data_dump = ($this->debug > 2);
! if ($show_data_dump)
! {
! //raw HTTP_POST_VARS dump
! //echo 'uifilters.filters: HTTP_POST_VARS
print_r dump (a):<b><pre>'."\r\n"; print_r($GLOBALS['HTTP_POST_VARS']); echo
'</pre><br><br>'."\r\n";
!
! if
((isset($GLOBALS['HTTP_POST_VARS'][$form_edit_filter_btn_name]))
! &&
($GLOBALS['HTTP_POST_VARS'][$form_edit_filter_btn_name] != ''))
! {
! $data_dump_info =
'uifilters.filters_edit: filter data WAS submitted';
! }
! elseif
((isset($GLOBALS['HTTP_POST_VARS'][$form_cancel_btn_name]))
! &&
($GLOBALS['HTTP_POST_VARS'][$form_cancel_btn_name] != ''))
! {
! $data_dump_info =
'uifilters.filters_edit: cancel button was pressed';
! }
! else
! {
! $data_dump_info = 'uifilters.filters:
NO filter data was submitted';
! }
! }
! else
! {
! $data_dump_info = 'uifilters.filters: data dump
not set';
! }
!
$GLOBALS['phpgw']->template->set_var('data_dump_info',$data_dump_info);
!
!
!
$GLOBALS['phpgw']->template->set_var('form_edit_filter_action',$form_edit_filter_action);
!
$GLOBALS['phpgw']->template->set_var('form_edit_filter_btn_name',
$form_edit_filter_btn_name);
!
$GLOBALS['phpgw']->template->set_var('form_cancel_action',$form_cancel_action);
!
$GLOBALS['phpgw']->template->set_var('form_cancel_btn_name',
$form_cancel_btn_name);
!
! $filters_txt = lang('EMail Filters');
!
$GLOBALS['phpgw']->template->set_var('filters_txt',$filters_txt);
!
! // ---- Filter Number ----
! // I assume we'll have more than one sieve script
available to the user
! // of course, for now we have only one dummy slot
! $f_idx = '0';
! $GLOBALS['phpgw']->template->set_var('f_idx',$f_idx);
!
!
! // ---- Filter Name ----
! // Assuming we'll allow more than one script, then the
scripts must have names
! // pull the name from the database, else it's blank
! $filter_name = '';
!
$GLOBALS['phpgw']->template->set_var('filter_name',$filter_name);
!
! $filter_name_box_name = 'filter_'.$f_idx.'[filtername]';
!
$GLOBALS['phpgw']->template->set_var('filter_name_box_name',$filter_name_box_name);
!
!
$GLOBALS['phpgw']->template->set_var('lang_name',lang('Filter Name'));
$GLOBALS['phpgw']->template->set_var('lang_if_messages_match',lang('If Messages
Match'));
!
$not_available_yet = ' (NA)';
$GLOBALS['phpgw']->template->set_var('lang_from',lang('From Address'));
--- 58,67 ----
$GLOBALS['phpgw']->template->set_block('T_filters_out','B_actions_row','V_actions_row');
! // ---- LANGS ----
!
$GLOBALS['phpgw']->template->set_var('lang_email_filters',lang('EMail
Filters'));
!
$GLOBALS['phpgw']->template->set_var('lang_filter_name',lang('Filter Name'));
!
$GLOBALS['phpgw']->template->set_var('lang_filter_number',lang('Filter
Number'));
$GLOBALS['phpgw']->template->set_var('lang_if_messages_match',lang('If Messages
Match'));
!
$GLOBALS['phpgw']->template->set_var('lang_inbox_for_account',lang('Filter
INBOX for accounts'));
$not_available_yet = ' (NA)';
$GLOBALS['phpgw']->template->set_var('lang_from',lang('From Address'));
***************
*** 164,186 ****
$GLOBALS['phpgw']->template->set_var('lang_size_smaller',lang('Size Smaller
Than'.$not_available_yet));
$GLOBALS['phpgw']->template->set_var('lang_allmessages',lang('All
Messages'.$not_available_yet));
! // I do NOT think Sieve lets you search the body - but
I'm not sure
!
$GLOBALS['phpgw']->template->set_var('lang_body',lang('Body (extended
sieve)'));
!
$GLOBALS['phpgw']->template->set_var('lang_contains',lang('Contains'));
$GLOBALS['phpgw']->template->set_var('lang_notcontains',lang('Does Not
Contain'));
! // --- initially there will be 2 matches options rows
---
! $num_matchrow_pairs = 2;
for ($i=0; $i < $num_matchrow_pairs; $i++)
{
- // 1st row
- // does NOT have the and/or combo box
- // so substitute "N/A" for "and" , also make
"or" a " " so the combobox looks empty
if ($i == 0)
{
// 1st row has an account combobox
! // anything not specified will be
replace with a default value if the function has one for that param
! //$source_account_listbox_name =
'filter_'.$f_idx.'[match_'.(string)$i.'_source_account]';
! $source_account_listbox_name =
'filter_'.$f_idx.'[source_account]';
$feed_args = Array(
'pre_select_acctnum' => 0,
--- 76,144 ----
$GLOBALS['phpgw']->template->set_var('lang_size_smaller',lang('Size Smaller
Than'.$not_available_yet));
$GLOBALS['phpgw']->template->set_var('lang_allmessages',lang('All
Messages'.$not_available_yet));
!
$GLOBALS['phpgw']->template->set_var('lang_body',lang('Body'));
$GLOBALS['phpgw']->template->set_var('lang_contains',lang('Contains'));
$GLOBALS['phpgw']->template->set_var('lang_notcontains',lang('Does Not
Contain'));
+
$GLOBALS['phpgw']->template->set_var('lang_take_actions',lang('Then do this'));
+
$GLOBALS['phpgw']->template->set_var('lang_or_enter_text',lang('or enter
text'));
+
$GLOBALS['phpgw']->template->set_var('lang_stop_if_matched',lang('and stop
filtering'));
+
$GLOBALS['phpgw']->template->set_var('lang_ignore_me2',lang('not used'));
+
$GLOBALS['phpgw']->template->set_var('lang_keep',lang('Keep'));
+
$GLOBALS['phpgw']->template->set_var('lang_discard',lang('Discard'));
+
$GLOBALS['phpgw']->template->set_var('lang_reject',lang('Reject'));
+
$GLOBALS['phpgw']->template->set_var('lang_redirect',lang('Redirect'));
+
$GLOBALS['phpgw']->template->set_var('lang_fileinto',lang('File into'));
+
$GLOBALS['phpgw']->template->set_var('lang_ignore_me1',lang('not used'));
+
$GLOBALS['phpgw']->template->set_var('lang_and',lang('And'));
+
$GLOBALS['phpgw']->template->set_var('lang_or',lang('Or'));
+
$GLOBALS['phpgw']->template->set_var('lang_submit',lang('Submit'));
+
$GLOBALS['phpgw']->template->set_var('lang_clear',lang('Clear'));
+
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
+
+
+ // DEBUGGING
+ if ($this->debug > 2) { echo 'uifilters.filters:
HTTP_POST_VARS dump:<b>'."\r\n"; var_dump($GLOBALS['HTTP_POST_VARS']); echo
'<br><br>'."\r\n"; }
+
+
+ // THIS WILL BE MOVED
+ // make the filters object
+ $this->bo = CreateObject("email.bofilters");
+ $this->bo->distill_filter_args();
+
+
+ // setup some form vars
+ $form_edit_filter_action = $GLOBALS['phpgw']->link(
+ '/index.php',
+
'menuaction=email.uifilters.filters_edit');
! $form_cancel_action = $GLOBALS['phpgw']->link(
! '/index.php',
!
'menuaction=email.uifilters.filters_list');
!
! // ---- Filter Number ----
! // for now we have only one filter
! $filternum = 0;
!
$GLOBALS['phpgw']->template->set_var('filternum',$filternum);
!
! // ---- Filter Name ----
! $filter_name_box_name =
'filter_'.$filternum.'[filtername]';
! $filter_name_box_value = '';
!
!
$GLOBALS['phpgw']->template->set_var('filter_name_box_name',$filter_name_box_name);
!
$GLOBALS['phpgw']->template->set_var('filter_name_box_value',$filter_name_box_value);
!
! // --- many email apps offer 2 matches options rows
---
! // --- others offer 1 match options row with the
option of more ---
! // --- for now we will offer 4 rows ---
! $num_matchrow_pairs = 4;
for ($i=0; $i < $num_matchrow_pairs; $i++)
{
if ($i == 0)
{
// 1st row has an account combobox
! //$source_account_listbox_name =
'filter_'.$filternum.'[source_account]'
! // now that we use a multi select box,
and php3 can only handle one sub element on POST
! // we have to put this outside the
array that holds the other data
! // should we use checkboxes instead?
! $source_account_listbox_name =
'filter_'.$filternum.'_source_accounts[]';
$feed_args = Array(
'pre_select_acctnum' => 0,
***************
*** 188,241 ****
'folder_key_name'
=> 'folder',
'acctnum_key_name'
=> 'acctnum',
! 'on_change'
=> ''
);
// get you custom built HTML combobox
(a.k.a. selectbox) widget
!
$GLOBALS['phpgw']->template->set_var('V_account_and_or_ignore',
$GLOBALS['phpgw']->msg->all_ex_accounts_listbox($feed_args));
!
}
else
{
! // 2nd row DOES have the and/or combo
box with "not enabled"
! $andor_select_name =
'filter_'.$f_idx.'[match_'.(string)$i.'_andor]';
! $lang_ignore_me1 = lang('not used');
! $lang_and = lang('And');
! $lang_or = lang('Or');
$GLOBALS['phpgw']->template->set_var('andor_select_name',$andor_select_name);
!
$GLOBALS['phpgw']->template->set_var('lang_ignore_me1',$lang_ignore_me1);
!
$GLOBALS['phpgw']->template->set_var('lang_and',$lang_and);
!
$GLOBALS['phpgw']->template->set_var('lang_or',$lang_or);
! // 2nd row does NOT have s "source
folder" combobox
!
$GLOBALS['phpgw']->template->parse('V_account_and_or_ignore','B_account_and_or_ignore');
}
! // FIXME: select the correct AND/OR depending
on the data from the database
! // FIXME: select the correct COMPARATOR
depending on the data from the database
! // if there's existing match string data in the
database, put it here
$match_textbox_txt = '';
$GLOBALS['phpgw']->template->set_var('match_textbox_txt',$match_textbox_txt);
!
$GLOBALS['phpgw']->template->set_var('match_rownum',(string)$i);
$GLOBALS['phpgw']->template->parse('V_matches_row','B_matches_row',True);
}
!
//$GLOBALS['phpgw']->template->set_var('lang_more_choices',lang('More
Choices'));
!
//$GLOBALS['phpgw']->template->set_var('lang_fewer_choices',lang('Fewer
Choices'));
!
//$GLOBALS['phpgw']->template->set_var('lang_reset',lang('Reset'));
!
!
$GLOBALS['phpgw']->template->set_var('lang_take_actions',lang('Then take these
actions'));
!
$GLOBALS['phpgw']->template->set_var('lang_or_enter_text',lang('or enter
text'));
!
$GLOBALS['phpgw']->template->set_var('lang_stop_if_matched',lang('and stop
filtering'));
!
! // ---typically we provide 2 action rows ---
! $num_actionrows = 2;
for ($i=0; $i < $num_actionrows; $i++)
{
$action_rownum = (string)$i;
! $actionbox_name =
'filter_'.$f_idx.'[action_'.$action_rownum.'_judgement]';
!
$GLOBALS['phpgw']->template->set_var('actionbox_name',$actionbox_name);
!
$GLOBALS['phpgw']->template->set_var('lang_ignore_me2',lang('not used'));
!
$GLOBALS['phpgw']->template->set_var('lang_keep',lang('Keep'));
!
$GLOBALS['phpgw']->template->set_var('lang_discard',lang('Discard'));
!
$GLOBALS['phpgw']->template->set_var('lang_reject',lang('Reject'));
!
$GLOBALS['phpgw']->template->set_var('lang_redirect',lang('Redirect'));
!
$GLOBALS['phpgw']->template->set_var('lang_fileinto',lang('File into'));
// 1st row does NOT have the IGNORE_ME option
in the actionbox
if ($i == 0)
--- 146,193 ----
'folder_key_name'
=> 'folder',
'acctnum_key_name'
=> 'acctnum',
! 'on_change'
=> '',
! 'is_multiple'
=> True,
! 'multiple_rows'
=> '4',
! //'show_status_is'
=> 'enabled,disabled'
! 'show_status_is'
=> 'enabled'
);
// get you custom built HTML combobox
(a.k.a. selectbox) widget
! $account_multi_box =
$GLOBALS['phpgw']->msg->all_ex_accounts_listbox($feed_args);
!
$GLOBALS['phpgw']->template->set_var('account_multi_box', $account_multi_box);
! $V_match_left_td =
$GLOBALS['phpgw']->template->parse('V_match_account_box','B_match_account_box');
}
else
{
! // 2nd row has an and/or combo box with
"not enabled" option for when you do not need the 2nd line
! $andor_select_name =
'filter_'.$filternum.'[match_'.(string)$i.'_andor]';
$GLOBALS['phpgw']->template->set_var('andor_select_name',$andor_select_name);
! $V_match_left_td =
$GLOBALS['phpgw']->template->parse('V_match_and_or_ignore','B_match_and_or_ignore');
}
! // things both rows have
! $examine_selectbox_name =
'filter_'.$filternum.'[match_'.(string)$i.'_examine]';
! $comparator_selectbox_name =
'filter_'.$filternum.'[match_'.(string)$i.'_comparator]';
! $matchthis_textbox_name =
'filter_'.$filternum.'[match_'.(string)$i.'_matchthis]';
$match_textbox_txt = '';
+
+
$GLOBALS['phpgw']->template->set_var('examine_selectbox_name',$examine_selectbox_name);
+
$GLOBALS['phpgw']->template->set_var('comparator_selectbox_name',$comparator_selectbox_name);
+
$GLOBALS['phpgw']->template->set_var('matchthis_textbox_name',$matchthis_textbox_name);
$GLOBALS['phpgw']->template->set_var('match_textbox_txt',$match_textbox_txt);
!
$GLOBALS['phpgw']->template->set_var('V_match_left_td',$V_match_left_td);
$GLOBALS['phpgw']->template->parse('V_matches_row','B_matches_row',True);
}
! // ---- Action Row(s) ----
! // Mulberry;s Sieve filters provide 2 action rows
! // I'm not sure how the first action still allows for a
second action
! // for ex. if you "fileinto" a folder, what would the
second action be? Delete it? doesn't make sense
! // with evolution, the second action could be
"scoring", but we don't have scoring
! // so for now, offer ONE action row
! $num_actionrows = 1;
for ($i=0; $i < $num_actionrows; $i++)
{
$action_rownum = (string)$i;
! $actionbox_judgement_name =
'filter_'.$filternum.'[action_'.$action_rownum.'_judgement]';
!
$GLOBALS['phpgw']->template->set_var('actionbox_judgement_name',$actionbox_judgement_name);
// 1st row does NOT have the IGNORE_ME option
in the actionbox
if ($i == 0)
***************
*** 247,265 ****
$V_action_widget =
$GLOBALS['phpgw']->template->parse('V_action_with_ignore_me','B_action_with_ignore_me');
}
-
$GLOBALS['phpgw']->template->set_var('V_action_widget',$V_action_widget);
// --- Folders Listbox ---
! // setup an dropdown listbox that is a list of
all folders
! // digress:
! // in win32 this would be called an
dropdown listbox with first row being editbox-like
! // but in html we have to also show a
seperate textbox to get the same functionality
! $folder_listbox_name =
'filter_'.$f_idx.'[action_'.$action_rownum.'_folder]';
! // do we want to show the number of new
(unseen) messages in the listbox?
! //$listbox_show_unseen = True;
$listbox_show_unseen = False;
// for existing data, we must specify which
folder was selected in the script
$listbox_pre_select = '';
- // build the $feed_args array for the
all_folders_listbox function
- // anything not specified will be replace with
a default value if the function has one for that param
$feed_args = Array(
'mailsvr_stream' => '',
--- 199,208 ----
$V_action_widget =
$GLOBALS['phpgw']->template->parse('V_action_with_ignore_me','B_action_with_ignore_me');
}
// --- Folders Listbox ---
! $folder_listbox_name =
'filter_'.$filternum.'[action_'.$action_rownum.'_folder]';
$listbox_show_unseen = False;
// for existing data, we must specify which
folder was selected in the script
$listbox_pre_select = '';
$feed_args = Array(
'mailsvr_stream' => '',
***************
*** 273,303 ****
'first_line_txt' => lang('if
fileto then select destination folder')
);
! // get you custom built HTML listbox (a.k.a.
selectbox) widget
!
$GLOBALS['phpgw']->template->set_var('folder_listbox',
$GLOBALS['phpgw']->msg->all_folders_listbox($feed_args));
! // --- Action Textbox ---
! // if the textbox has existing data, it gets
filled here
$action_textbox_txt = '';
$GLOBALS['phpgw']->template->set_var('action_textbox_txt',$action_textbox_txt);
! // FIXME: check the checkbox "STOP" value
depending on the data from the database
!
$GLOBALS['phpgw']->template->set_var('action_rownum',$action_rownum);
$GLOBALS['phpgw']->template->parse('V_actions_row','B_actions_row',True);
}
!
//$GLOBALS['phpgw']->template->set_var('lang_more_actions',lang('More
Actions'));
!
//$GLOBALS['phpgw']->template->set_var('lang_fewer_actions',lang('Fewer
Actions'));
!
!
$GLOBALS['phpgw']->template->set_var('lang_submit',lang('Submit'));
!
$GLOBALS['phpgw']->template->set_var('lang_clear',lang('Clear'));
!
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
!
!
$GLOBALS['phpgw']->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
$GLOBALS['phpgw']->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
$GLOBALS['phpgw']->template->set_var('row_text',$GLOBALS['phpgw_info']['theme']['row_text']);
!
--- 216,264 ----
'first_line_txt' => lang('if
fileto then select destination folder')
);
! $folder_listbox =
$GLOBALS['phpgw']->msg->folders_mega_listbox($feed_args);
! $action_textbox_name =
'filter_'.$filternum.'[action_'.$action_rownum.'_actiontext]';
$action_textbox_txt = '';
+
+ $stop_filtering_checkbox_name =
'filter_'.$filternum.'[action_'.$action_rownum.'_stop_filtering]';
+ $stop_filtering_checkbox_checked = '';
+
+
$GLOBALS['phpgw']->template->set_var('V_action_widget',$V_action_widget);
+
$GLOBALS['phpgw']->template->set_var('folder_listbox', $folder_listbox);
+
$GLOBALS['phpgw']->template->set_var('action_textbox_name',$action_textbox_name);
$GLOBALS['phpgw']->template->set_var('action_textbox_txt',$action_textbox_txt);
!
$GLOBALS['phpgw']->template->set_var('stop_filtering_checkbox_name',$stop_filtering_checkbox_name);
!
$GLOBALS['phpgw']->template->set_var('stop_filtering_checkbox_checked',$stop_filtering_checkbox_checked);
$GLOBALS['phpgw']->template->parse('V_actions_row','B_actions_row',True);
}
+
$GLOBALS['phpgw']->template->set_var('form_edit_filter_action',$form_edit_filter_action);
+
$GLOBALS['phpgw']->template->set_var('form_cancel_action',$form_cancel_action);
!
$GLOBALS['phpgw']->template->set_var('body_bg_color',$GLOBALS['phpgw_info']['theme']['bg_color']);
$GLOBALS['phpgw']->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
$GLOBALS['phpgw']->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
$GLOBALS['phpgw']->template->set_var('row_text',$GLOBALS['phpgw_info']['theme']['row_text']);
+ // debugging result list
+ $mlist_html = '';
+ if (count($this->bo->filters) > 0)
+ {
+
+ if ($this->debug > 1) { echo
'uifilters.filters_edit: count($this->bo->filters):
['.count($this->bo->filters).'] ; <br>'."\r\n"; }
+ //$this->bo->sieve_to_imap_string();
+ $this->bo->do_imap_search();
+ //if ($this->debug > 0) { echo 'message list
print_r dump:<b><pre>'."\r\n"; print_r($this->bo->result_set_mlist); echo
'</pre><br><br>'."\r\n"; }
+ $this->bo->make_mlist_box();
+ $mlist_html =
+ '<table border="0" cellpadding="4"
cellspacing="1" width="90%" align="center">'."\r\n"
+ .$this->bo->finished_mlist."\r\n"
+ .'</table>'."\r\n"
+ .'<p> </p>'."\r\n"
+ .$this->bo->submit_mlist_to_class_form
+ .'<p> </p>'."\r\n";
! }
!
$GLOBALS['phpgw']->template->set_var('V_mlist_html',$mlist_html);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: email/inc class.bofilters.inc.php,1.1,1.2 class.bofolder.inc.php,1.4,1.5 class.bopreferences.inc.php,1.12,1.13 class.mail_msg_base.inc.php,1.64,1.65 class.mail_msg_display.inc.php,1.32,1.33 class.mail_msg_wrappers.inc.php,1.24,1.25 class.uifilters.inc.php,1.1,1.2,
Angelo Tony Puglisi <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: email/templates/default filters.tpl,1.3,1.4 filters_blocks.tpl,1.1,1.2
- Next by Date:
[Phpgroupware-cvs] CVS: stocks preferences_edit.php,1.11,NONE
- Previous by thread:
[Phpgroupware-cvs] CVS: email/templates/default filters.tpl,1.3,1.4 filters_blocks.tpl,1.1,1.2
- Next by thread:
[Phpgroupware-cvs] CVS: stocks preferences_edit.php,1.11,NONE
- Index(es):