remove some extra spaces and tabs, change all print_r to _debug_array() calls

This commit is contained in:
Miles Lott 2001-12-24 04:53:07 +00:00
parent 32c2f16f8c
commit 1073d1d61a

View File

@ -44,7 +44,6 @@
//var $debug_init_prefs = 2;
//var $debug_init_prefs = 3;
/**************************************************************************\
* Standard constructor for setting $this->account_id *
\**************************************************************************/
@ -177,7 +176,7 @@
{
$this->db->transaction_begin();
$this->db->query("delete from phpgw_preferences where preference_owner='" . $this->account_id
. "'",__LINE__,__FILE__);
. "'",__LINE__,__FILE__);
if (floor(phpversion()) < 4)
{
@ -188,7 +187,7 @@
$pref_info = serialize($this->data);
}
$this->db->query("insert into phpgw_preferences (preference_owner,preference_value) values ('"
. $this->account_id . "','" . $pref_info . "')",__LINE__,__FILE__);
. $this->account_id . "','" . $pref_info . "')",__LINE__,__FILE__);
$this->db->transaction_commit();
}
@ -304,9 +303,9 @@
}
}
/**************************************************************************\
* Email Preferences and Private Support Functions *
\**************************************************************************/
/****************************************************\
* Email Preferences and Private Support Functions *
\****************************************************/
/*!
@function sub_get_mailsvr_port
@ -339,23 +338,29 @@
*/
switch($prefs['email']['mail_server_type'])
{
case 'imaps': // IMAP over SSL
case 'imaps':
// IMAP over SSL
$port_number = 993;
break;
case 'pop3s': // POP3 over SSL
case 'pop3s':
// POP3 over SSL
$port_number = 995;
break;
case 'pop3': // POP3 normal connection, No SSL
// ( same string as normal imap above)
case 'pop3':
// POP3 normal connection, No SSL
// ( same string as normal imap above)
$port_number = 110;
break;
case 'nntp': // NNTP news server port
case 'nntp':
// NNTP news server port
$port_number = 119;
break;
case 'imap': // IMAP normal connection, No SSL
default: // UNKNOWN SERVER in Preferences, return a
// default value that is likely to work
// probably should raise some kind of error here
case 'imap':
// IMAP normal connection, No SSL
default:
// UNKNOWN SERVER in Preferences, return a
// default value that is likely to work
// probably should raise some kind of error here
$port_number = 143;
break;
}
@ -450,7 +455,11 @@
{
$prefs = $this->data;
}
if ($this->debug_init_prefs > 0) { echo 'class.preferences: create_email_preferences: raw $this->data dump<pre>'; print_r($this->data); echo '</pre>'; }
if ($this->debug_init_prefs > 0)
{
echo 'class.preferences: create_email_preferences: raw $this->data dump';
_debug_array($this->data);
}
// = = = = NOT-SIMPLE PREFS = = = =
// Default Preferences info that is:
@ -477,8 +486,8 @@
//--- [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']))
if ((isset($GLOBALS['phpgw_info']['flags']['newsmode']) &&
$GLOBALS['phpgw_info']['flags']['newsmode']))
{
$prefs['email']['mail_server_type'] = 'nntp';
}
@ -500,7 +509,6 @@
// --- create the objectified /email/class.bopreferences.inc.php ---
$bo_mail_prefs = CreateObject('email.bopreferences');
// --- bo_mail_prefs->init_available_prefs() ---
// this fills object_email_bopreferences->std_prefs and ->cust_prefs
// we will initialize the users preferences according to the rules and instructions
@ -521,7 +529,11 @@
$next_idx = count($avail_pref_array);
$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:<pre>'; print_r($avail_pref_array); echo '</pre>'; }
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 ---
// user defined values and/or user specified custom email prefs are read from the
@ -555,7 +567,11 @@
{
$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:<pre>'; print_r($this_avail_pref); echo "</pre>\r\n"; }
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 ---
// if the prefs DB has no value for this defined available preference, we must make one.
@ -664,8 +680,8 @@
// NOTE: if database de-fanging is eventually handled deeper in the
// preferences class, then the following code would become depreciated
// and should be removed in that case.
if (($this_avail_pref['type'] == 'user_string')
&& (stristr($this_avail_pref['write_props'], 'no_db_defang') == False))
if (($this_avail_pref['type'] == 'user_string') &&
(stristr($this_avail_pref['write_props'], 'no_db_defang') == False))
{
// this value was "de-fanged" before putting it in the database
// undo that defanging now
@ -697,12 +713,15 @@
// DEBUG : force some settings to test stuff
//$prefs['email']['p_persistent'] = 'True';
if ($this->debug_init_prefs > 1) { echo 'class.preferences: create_email_preferences: $prefs[email]<pre>'; print_r($prefs['email']) ; echo '</pre>'; }
if ($this->debug_init_prefs > 1)
{
echo 'class.preferences: 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;
}
/*
// ==== DEPRECIATED - ARCHIVAL CODE ====
// used to be part of function this->create_email_preferences()
@ -836,7 +855,5 @@
// .'<pre>'.serialize($prefs['email']) .'</pre><br>';
return $prefs;
*/
} /* end of preferences class */
?>