phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: email/inc class.bopreferences.inc.php,1.19,1.20


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: email/inc class.bopreferences.inc.php,1.19,1.20 class.mail_msg_base.inc.php,1.72,1.73
Date: Tue, 23 Apr 2002 10:31:06 -0400

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

Modified Files:
        class.bopreferences.inc.php class.mail_msg_base.inc.php 
Log Message:
This should clear up any confsion of emial passwords being encrypted to a 
session or to the system.

Index: class.bopreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.bopreferences.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** class.bopreferences.inc.php 24 Jan 2002 22:58:07 -0000      1.19
--- class.bopreferences.inc.php 23 Apr 2002 14:31:04 -0000      1.20
***************
*** 551,555 ****
                                // ==== ACCTNUM ====
                                if ((!isset($this->acctnum))
!                               || ((string)$this->acctnum == ''))
                                {
                                        $this->acctnum = 
$this->obtain_ex_acctnum();
--- 551,555 ----
                                // ==== ACCTNUM ====
                                if ((!isset($this->acctnum))
!                               || ((string)$this->acctnum == ''))
                                {
                                        $this->acctnum = 
$this->obtain_ex_acctnum();
***************
*** 746,750 ****
                                                        // so the FIRST thing 
you do when reading from the db MUST be to "UN-defang"
                                                        // note this IS INDEED 
what happens in api/class,preferences,
!                                                       // unless 
"no_db_defang" is specified, any "user_string" will be defanged
                                                }
                                                else
--- 746,750 ----
                                                        // so the FIRST thing 
you do when reading from the db MUST be to "UN-defang"
                                                        // note this IS INDEED 
what happens in api/class,preferences,
!                                                       // unless 
"no_db_defang" is specified, any "user_string" will be defanged
                                                }
                                                else
***************
*** 1033,1037 ****
                        if ($this->debug_set_prefs > 1) { echo 'email: 
bopreferences: process_ex_accounts_submitted_prefs: pre discovery 
$this->acctnum : ['.serialize($this->acctnum).']<br>'; }
                        if ((!isset($this->acctnum))
!                       || ((string)$this->acctnum == ''))
                        {
                                $this->acctnum = $this->obtain_ex_acctnum();
--- 1033,1037 ----
                        if ($this->debug_set_prefs > 1) { echo 'email: 
bopreferences: process_ex_accounts_submitted_prefs: pre discovery 
$this->acctnum : ['.serialize($this->acctnum).']<br>'; }
                        if ((!isset($this->acctnum))
!                       || ((string)$this->acctnum == ''))
                        {
                                $this->acctnum = $this->obtain_ex_acctnum();
***************
*** 1153,1157 ****
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$processed_pref);
                                        // SORT THAT ARRAY by key, so the 
integer array heys go from lowest to hightest
!                                       
ksort($GLOBALS['phpgw']->preferences->data['email']['ex_accounts']);
                                }
                        }
--- 1153,1157 ----
                                        
$GLOBALS['phpgw']->preferences->add_struct('email', $pref_struct_str, 
$processed_pref);
                                        // SORT THAT ARRAY by key, so the 
integer array heys go from lowest to hightest
!                                       
ksort($GLOBALS['phpgw']->preferences->data['email']['ex_accounts']);
                                }
                        }
***************
*** 1169,1173 ****
                        
                        if ((isset($acctnum))
!                       || ((string)$acctnum != ''))
                        {
                                $this->acctnum = $acctnum;
--- 1169,1173 ----
                        
                        if ((isset($acctnum))
!                       || ((string)$acctnum != ''))
                        {
                                $this->acctnum = $acctnum;
***************
*** 1175,1179 ****
                        
                        if ((!isset($this->acctnum))
!                       || ((string)$this->acctnum == ''))
                        {
                                $acctnum = $this->obtain_ex_acctnum();
--- 1175,1179 ----
                        
                        if ((!isset($this->acctnum))
!                       || ((string)$this->acctnum == ''))
                        {
                                $acctnum = $this->obtain_ex_acctnum();
***************
*** 1253,1257 ****
                        $this->account_group = 'extra_accounts';
                        if ((!isset($acctnum))
!                       || ((string)$acctnum == ''))
                        {
                                $acctnum = $this->obtain_ex_acctnum();
--- 1253,1257 ----
                        $this->account_group = 'extra_accounts';
                        if ((!isset($acctnum))
!                       || ((string)$acctnum == ''))
                        {
                                $acctnum = $this->obtain_ex_acctnum();
***************
*** 1542,1544 ****
  
        }
! ?>
\ No newline at end of file
--- 1542,1544 ----
  
        }
! ?>

Index: class.mail_msg_base.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.mail_msg_base.inc.php,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -r1.72 -r1.73
*** class.mail_msg_base.inc.php 26 Mar 2002 02:34:38 -0000      1.72
--- class.mail_msg_base.inc.php 23 Apr 2002 14:31:04 -0000      1.73
***************
*** 38,42 ****
        var $acctnum = 0;
        var $fallback_default_acctnum = 0;
!       
        // ----  args that are known to be used for email
        // externally filled args, such as thru GPC values, or xmlrpc call
--- 38,42 ----
        var $acctnum = 0;
        var $fallback_default_acctnum = 0;
! 
        // ----  args that are known to be used for email
        // externally filled args, such as thru GPC values, or xmlrpc call
***************
*** 58,71 ****
        // raw prefs, before we process them to extract extra acct and/or 
filters data, not of much use
        var $unprocessed_prefs=array();
!       
        // ---- Data Caching  ----
        // (A) session data caching in appsession, for data that is temporary 
in nature
        var $session_cache_enabled=True;
        //var $session_cache_enabled=False;
!       
        // ----  session cache runthru without actuall saving data to appsession
        //var $session_cache_debug_nosave = True;
        var $session_cache_debug_nosave = False;
!       
        // DEPRECIATED: folder_list now cached to appsession / temporary cache
        // (B) "folder list" caching (default value here, will be overridden by 
preferences item "cache_data")
--- 58,72 ----
        // raw prefs, before we process them to extract extra acct and/or 
filters data, not of much use
        var $unprocessed_prefs=array();
!       var $crypto;
! 
        // ---- Data Caching  ----
        // (A) session data caching in appsession, for data that is temporary 
in nature
        var $session_cache_enabled=True;
        //var $session_cache_enabled=False;
! 
        // ----  session cache runthru without actuall saving data to appsession
        //var $session_cache_debug_nosave = True;
        var $session_cache_debug_nosave = False;
! 
        // DEPRECIATED: folder_list now cached to appsession / temporary cache
        // (B) "folder list" caching (default value here, will be overridden by 
preferences item "cache_data")
***************
*** 80,84 ****
                2       => 'match_cached_account'
        );
!       
        // EXTRA ACCOUNTS
        // used for looping thru extra account data during begin request
--- 81,85 ----
                2       => 'match_cached_account'
        );
! 
        // EXTRA ACCOUNTS
        // used for looping thru extra account data during begin request
***************
*** 89,94 ****
        // 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 = 0;
--- 90,94 ----
        // 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 = 0;
***************
*** 103,111 ****
        var $skip_args_special_handlers = '';
  
-       
        // future (maybe never) usage
        //var $known_subtypes = array();
!       
!       
        /*
        function mail_msg_init()
--- 103,109 ----
        var $skip_args_special_handlers = '';
  
        // future (maybe never) usage
        //var $known_subtypes = array();
! 
        /*
        function mail_msg_init()
***************
*** 2322,2326 ****
        function encrypt_email_passwd($data)
        {
!               return $GLOBALS['phpgw']->crypto->encrypt($data);
        }
        
--- 2320,2330 ----
        function encrypt_email_passwd($data)
        {
!               if(!is_object($this->crypto))
!               {
!                       $cryptovars[0] = 
md5($GLOBALS['phpgw_info']['server']['encryptkey']);
!                       $cryptovars[1] = 
$GLOBALS['phpgw_info']['server']['mcrypt_iv'];
!                       $this->crypto = 
CreateObject('phpgwapi.crypto',$cryptovars);
!               }
!               return $this->crypto->encrypt($data);
        }
        
***************
*** 2334,2338 ****
        function decrypt_email_passwd($data)
        {
!               return $GLOBALS['phpgw']->crypto->decrypt($data);
        }
        /*
--- 2338,2355 ----
        function decrypt_email_passwd($data)
        {
!               if(!is_object($this->crypto))
!               {
!                       $cryptovars[0] = 
md5($GLOBALS['phpgw_info']['server']['encryptkey']);
!                       $cryptovars[1] = 
$GLOBALS['phpgw_info']['server']['mcrypt_iv'];
!                       $this->crypto = 
CreateObject('phpgwapi.crypto',$cryptovars);
!               }
!               $unencrypted = $this->crypto->decrypt($data);
!               $encrypted = $this->crypto->encrypt($unencrypted);
!               if($data <> $encrypted)
!               {
!                       $unencrypted = 
$GLOBALS['phpgw']->crypto->decrypt($data);
!                       $encrypted = 
$GLOBALS['phpgw']->crypto->encrypt($unencrypted);
!               }
!               return $unencrypted;
        }
        /*




reply via email to

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