[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: phpgwapi/inc class.preferences.inc.php,1.43,1.43
From: |
Dan Kuykendall <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: phpgwapi/inc class.preferences.inc.php,1.43,1.43.2.1 |
Date: |
Fri, 15 Feb 2002 16:03:49 -0500 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv12356/phpgwapi/inc
Modified Files:
Tag: Version-0_9_14-branch
class.preferences.inc.php
Log Message:
fixed minor stuff
Index: class.preferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.preferences.inc.php,v
retrieving revision 1.43
retrieving revision 1.43.2.1
diff -C2 -r1.43 -r1.43.2.1
*** class.preferences.inc.php 13 Jan 2002 03:58:41 -0000 1.43
--- class.preferences.inc.php 15 Feb 2002 21:03:46 -0000 1.43.2.1
***************
*** 40,48 ****
/*! @var db */
var $db;
- /*! @var debug_init_prefs */
- var $debug_init_prefs = 0;
- //var $debug_init_prefs = 1;
- //var $debug_init_prefs = 2;
- //var $debug_init_prefs = 3;
/**************************************************************************\
--- 40,43 ----
***************
*** 177,183 ****
{
$code = '$this->data[$app_name]'.$var.' = $value;';
! //echo 'class.preferences: add_struct: $code:
'.$code.'<br>';
eval($code);
! //echo 'class.preferences: add_struct:
$this->data[$app_name] dump:'; _debug_array($this->data[$app_name]); echo
'<br>';
reset($this->data);
return $this->data;
--- 172,178 ----
{
$code = '$this->data[$app_name]'.$var.' = $value;';
! print_debug('class.preferences: add_struct: $code: ',
$code,'api');
eval($code);
! print_debug('class.preferences: add_struct:
$this->data[$app_name] dump:', $this->data[$app_name],'api');
reset($this->data);
return $this->data;
***************
*** 194,203 ****
{
$code_1 = '$this->data[$app_name]'.$var.' = "";';
! //echo 'class.preferences: delete_struct: $code_1:
'.$code_1.'<br>';
eval($code_1);
$code_2 = 'unset($this->data[$app_name]'.$var.');' ;
! //echo 'class.preferences: delete_struct: $code_2:
'.$code_2.'<br>';
eval($code_2);
! //echo ' * $this->data[$app_name] dump:';
_debug_array($this->data[$app_name]); echo '<br>';
reset ($this->data);
return $this->data;
--- 189,198 ----
{
$code_1 = '$this->data[$app_name]'.$var.' = "";';
! print_debug('class.preferences: delete_struct:
$code_1:', $code_1,'api');
eval($code_1);
$code_2 = 'unset($this->data[$app_name]'.$var.');' ;
! print_debug('class.preferences: delete_struct:
$code_2: ', $code_2,'api');
eval($code_2);
! print_debug('* $this->data[$app_name] dump:',
$this->data[$app_name],'api');
reset ($this->data);
return $this->data;
***************
*** 380,402 ****
@access Private
*/
! function sub_get_mailsvr_port($prefs)
{
- /*// UNCOMMENT WHEN mail_port IS A REAL, USER SET OPTION
// first we try the port number supplied in preferences
! if ( (isset($prefs['email']['mail_port']))
! && ($prefs['email']['mail_port'] != '') )
{
! $port_number = $prefs['email']['mail_port'];
}
// preferences does not have a port number, generate a
default value
else
{
! */
! switch($prefs['email']['mail_server_type'])
{
- case 'imaps':
- // IMAP over SSL
- $port_number = 993;
- break;
case 'pop3s':
// POP3 over SSL
--- 375,396 ----
@access Private
*/
! function sub_get_mailsvr_port($prefs, $acctnum=0)
{
// first we try the port number supplied in preferences
! if (
(isset($prefs['email']['accounts'][$acctnum]['mail_port']))
! && ($prefs['email']['accounts'][$acctnum]['mail_port']
!= '') )
{
! $port_number =
$prefs['email']['accounts'][$acctnum]['mail_port'];
}
// preferences does not have a port number, generate a
default value
else
{
! if
(!isset($prefs['email']['accounts'][$acctnum]['mail_server_type']))
! {
!
$prefs['email']['accounts'][$acctnum]['mail_server_type'] =
$prefs['email']['mail_server_type'];
! }
!
!
switch($prefs['email']['accounts'][$acctnum]['mail_server_type'])
{
case 'pop3s':
// POP3 over SSL
***************
*** 412,415 ****
--- 406,413 ----
$port_number = 119;
break;
+ case 'imaps':
+ // IMAP over SSL
+ $port_number = 993;
+ break;
case 'imap':
// IMAP normal connection, No
SSL
***************
*** 421,428 ****
break;
}
! // set the preference string, since it was not
set and that's why we are here
! //$prefs['email']['mail_port'] = $port_number;
! // UNCOMMENT WHEN mail_port IS A REAL, USER SET OPTION
! //}
return $port_number;
}
--- 419,423 ----
break;
}
! }
return $port_number;
}
***************
*** 482,488 ****
@access Public
*/
! function create_email_preferences($accountid='', $acctnum='')
{
! if ($this->debug_init_prefs > 0) { echo
'class.preferences: create_email_preferences: ENTERING<br>'; }
// we may need function "html_quotes_decode" from the
mail_msg class
$email_base = CreateObject("email.mail_msg");
--- 477,483 ----
@access Public
*/
! function create_email_preferences($accountid='', $acctnum=0)
{
! print_debug('class.preferences:
create_email_preferences: ENTERING<br>', 'messageonly','api');
// we may need function "html_quotes_decode" from the
mail_msg class
$email_base = CreateObject("email.mail_msg");
***************
*** 513,524 ****
}
// are we dealing with the default email account or an
extra email account?
! if (!(isset($acctnum)) || ((string)$acctnum == ''))
! {
! settype($acctnum,'integer');
! // account 0 is the default email account
! $acctnum = 0;
! // $prefs stays AS IS!
! }
! else
{
// prefs are actually a sub-element of the main
email prefs
--- 508,512 ----
}
// are we dealing with the default email account or an
extra email account?
! if ($acctnum != 0)
{
// prefs are actually a sub-element of the main
email prefs
***************
*** 537,546 ****
// since we return just $prefs, it's up to the
calling program to put the sub prefs in the right place
}
!
! if ($this->debug_init_prefs > 0)
! {
! echo 'class.preferences:
create_email_preferences: $acctnum: ['.$acctnum.'] ; raw $this->data dump';
! _debug_array($this->data);
! }
// = = = = NOT-SIMPLE PREFS = = = =
--- 525,529 ----
// since we return just $prefs, it's up to the
calling program to put the sub prefs in the right place
}
! print_debug('class.preferences:
create_email_preferences: $acctnum: ['.$acctnum.'] ; raw $this->data dump',
$this->data,'api');
// = = = = NOT-SIMPLE PREFS = = = =
***************
*** 566,578 ****
// else use the system default (which we temporarily
hard coded to "mail" just above here)
- //--- [email][newsmode] ---
- // == Orphan == currently NOT USED
- // This is going to be used to switch to the nntp class
- if ((isset($GLOBALS['phpgw_info']['flags']['newsmode'])
&&
- $GLOBALS['phpgw_info']['flags']['newsmode']))
- {
- $prefs['email']['mail_server_type'] = 'nntp';
- }
-
//--- [email][mail_port] ---
// These sets the mail_port server variable
--- 549,552 ----
***************
*** 621,629 ****
$avail_pref_array[$next_idx] =
$bo_mail_prefs->cust_prefs[$i];
}
! if ($this->debug_init_prefs > 1)
! {
! echo 'class.preferences:
create_email_preferences: std AND cust arrays combined:';
! _debug_array($avail_pref_array);
! }
// --- make the schema-based pref data for this user ---
--- 595,599 ----
$avail_pref_array[$next_idx] =
$bo_mail_prefs->cust_prefs[$i];
}
! print_debug('class.preferences:
create_email_preferences: std AND cust arrays combined:',
$avail_pref_array,'api');
// --- make the schema-based pref data for this user ---
***************
*** 658,667 ****
{
$this_avail_pref = $avail_pref_array[$i];
! if ($this->debug_init_prefs > 1) { echo
'class.preferences: create_email_preferences: value from DB for
$prefs[email]['.$this_avail_pref['id'].'] =
['.$prefs['email'][$this_avail_pref['id']].']<br>'; }
! if ($this->debug_init_prefs > 2)
! {
! echo 'class.preferences:
create_email_preferences: std/cust_prefs $this_avail_pref['.$i.'] dump:';
! _debug_array($this_avail_pref);
! }
// --- is there a value in the DB for this
preference item ---
--- 628,633 ----
{
$this_avail_pref = $avail_pref_array[$i];
! print_debug('class.preferences:
create_email_preferences: value from DB for
$prefs[email]['.$this_avail_pref['id'].'] =
['.$prefs['email'][$this_avail_pref['id']].']', 'messageonly','api');
! print_debug('class.preferences:
create_email_preferences: std/cust_prefs $this_avail_pref['.$i.'] dump:',
$this_avail_pref,'api');
// --- is there a value in the DB for this
preference item ---
***************
*** 676,680 ****
// --- get instructions on how to
generate a default value ---
$set_proc = explode(',',
$this_avail_pref['init_default']);
! if ($this->debug_init_prefs > 1) { echo
' * set_proc=['.serialize($set_proc).']<br>'; }
// --- use "instructional token" in
$set_proc[0] to take appropriate action ---
--- 642,646 ----
// --- get instructions on how to
generate a default value ---
$set_proc = explode(',',
$this_avail_pref['init_default']);
! print_debug(' *
set_proc=['.serialize($set_proc).']', 'messageonly','api');
// --- use "instructional token" in
$set_proc[0] to take appropriate action ---
***************
*** 684,688 ****
// means this pref item's value
type is string
// which defined string default
value is in $set_proc[1]
! if ($this->debug_init_prefs >
2) { echo ' * handle "string" set_proc: '.serialize($set_proc).'<br>'; }
if (trim($set_proc[1]) == '')
{
--- 650,654 ----
// means this pref item's value
type is string
// which defined string default
value is in $set_proc[1]
! print_debug('* handle "string"
set_proc: ', serialize($set_proc),'api');
if (trim($set_proc[1]) == '')
{
***************
*** 700,704 ****
{
// typical with boolean
options, True = "set/exists" and False = unset
! if ($this->debug_init_prefs >
2) { echo ' * handle "set_or_not" set_proc: '.serialize($set_proc).'<br>'; }
if ($set_proc[1] == 'not_set')
{
--- 666,670 ----
{
// typical with boolean
options, True = "set/exists" and False = unset
! print_debug('* handle
"set_or_not" set_proc: ', serialize($set_proc),'api');
if ($set_proc[1] == 'not_set')
{
***************
*** 717,733 ****
// string in $set_proc[1]
should be "eval"uated as code, calling a function
// which will give us a default
value to put in users session [email][] prefs array
! if ($this->debug_init_prefs >
2) { echo ' * handle "function" set_proc: '.serialize($set_proc).'<br>'; }
$evaled = '';
//eval('$evaled =
$this->'.$set_proc[1].'('.$account_id.');');
$code = '$evaled =
$this->'.$set_proc[1].'('.$account_id.');';
! if ($this->debug_init_prefs >
2) { echo ' * $code: '.$code.'<br>'; }
eval($code);
! //$code = '$evaled =
'.$set_proc[1];
! //if ($this->debug_init_prefs >
1) { echo ' * $code: '.$code.'<br>'; }
! //eval($code);
!
! if ($this->debug_init_prefs >
2) { echo ' * $evaled: '.$evaled.'<br>'; }
$prefs['email'][$this_avail_pref['id']] = $evaled;
}
--- 683,695 ----
// string in $set_proc[1]
should be "eval"uated as code, calling a function
// which will give us a default
value to put in users session [email][] prefs array
! print_debug(' * handle
"function" set_proc: ', serialize($set_proc),'api');
$evaled = '';
//eval('$evaled =
$this->'.$set_proc[1].'('.$account_id.');');
$code = '$evaled =
$this->'.$set_proc[1].'('.$account_id.');';
! print_debug(' * $code: ',
$code,'api');
eval($code);
! print_debug('* $evaled:',
$evaled,'api');
$prefs['email'][$this_avail_pref['id']] = $evaled;
}
***************
*** 737,741 ****
// we have an available
preference item that we may NOT fill with a default
// value. Only the user may
supply a value for this pref item.
! if ($this->debug_init_prefs >
1) { echo ' * handle "init_no_fill" set_proc: '.serialize($set_proc).'<br>'; }
// we are FORBADE from filling
this at this time!
}
--- 699,703 ----
// we have an available
preference item that we may NOT fill with a default
// value. Only the user may
supply a value for this pref item.
! print_debug('* handle
"init_no_fill" set_proc:', serialize($set_proc),'api');
// we are FORBADE from filling
this at this time!
}
***************
*** 745,754 ****
// similar to "function" but
used for array references, the string in $set_proc[1]
// represents code which
typically is an array referencing a system/api property
! if ($this->debug_init_prefs >
2) { echo ' * handle "GLOBALS" set_proc: '.serialize($set_proc).'<br>'; }
$evaled = '';
$code = '$evaled =
'.$set_proc[1];
! if ($this->debug_init_prefs >
2) { echo ' * $code: '.$code.'<br>'; }
eval($code);
! if ($this->debug_init_prefs >
2) { echo ' * $evaled: '.$evaled.'<br>'; }
$prefs['email'][$this_avail_pref['id']] = $evaled;
}
--- 707,716 ----
// similar to "function" but
used for array references, the string in $set_proc[1]
// represents code which
typically is an array referencing a system/api property
! print_debug('* handle "GLOBALS"
set_proc:', serialize($set_proc),'api');
$evaled = '';
$code = '$evaled =
'.$set_proc[1];
! print_debug(' * $code:',
$code,'api');
eval($code);
! print_debug('* $evaled:',
$evaled,'api');
$prefs['email'][$this_avail_pref['id']] = $evaled;
}
***************
*** 805,815 ****
//$prefs['email']['p_persistent'] = 'True';
! if ($this->debug_init_prefs > 1)
! {
! echo 'class.preferences: $acctnum:
['.$acctnum.'] ; create_email_preferences: $prefs[email]';
! _debug_array($prefs['email']);
! }
!
! if ($this->debug_init_prefs > 0) { echo
'class.preferences: create_email_preferences: LEAVING<br>'; }
return $prefs;
}
--- 767,772 ----
//$prefs['email']['p_persistent'] = 'True';
! print_debug('class.preferences: $acctnum:
['.$acctnum.'] ; create_email_preferences: $prefs[email]',
$prefs['email'],'api');
! print_debug('class.preferences:
create_email_preferences: LEAVING', 'messageonly','api');
return $prefs;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: phpgwapi/inc class.preferences.inc.php,1.43,1.43.2.1,
Dan Kuykendall <address@hidden> <=