BUG 8173 password is encrypted of email settings

This commit is contained in:
Alvaro Campos
2011-12-22 10:16:52 -04:00
parent fe09cc865f
commit cfe3c19041
8 changed files with 57 additions and 8 deletions

View File

@@ -4140,6 +4140,11 @@ class Cases {
$aConfiguration = $oConfiguration->load('Emails', '', '', '', ''); $aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
if ($aConfiguration['CFG_VALUE'] != '') { if ($aConfiguration['CFG_VALUE'] != '') {
$aConfiguration = unserialize($aConfiguration['CFG_VALUE']); $aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
$passwd = $aConfiguration['MESS_PASSWORD'];
if(strpos( $passwd, 'hush:' ) !== false){
list($hush, $pass) = explode(":", $passwd);
$aConfiguration['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
}
} else { } else {
$aConfiguration = array(); $aConfiguration = array();
} }

View File

@@ -327,6 +327,11 @@ class spoolRun {
$oPHPMailer->Host = $this->config['MESS_SERVER']; $oPHPMailer->Host = $this->config['MESS_SERVER'];
$oPHPMailer->Port = $this->config['MESS_PORT']; $oPHPMailer->Port = $this->config['MESS_PORT'];
$oPHPMailer->Username = $this->config['MESS_ACCOUNT']; $oPHPMailer->Username = $this->config['MESS_ACCOUNT'];
$passwd = $this->config['MESS_PASSWORD'];
if(strpos( $passwd, 'hush:' ) !== false){
list($hush, $pass) = explode(":", $passwd);
$this->config['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
}
$oPHPMailer->Password = $this->config['MESS_PASSWORD']; $oPHPMailer->Password = $this->config['MESS_PASSWORD'];
$oPHPMailer->From = $this->fileData['from_email']; $oPHPMailer->From = $this->fileData['from_email'];
$oPHPMailer->FromName = utf8_decode($this->fileData['from_name']); $oPHPMailer->FromName = utf8_decode($this->fileData['from_name']);
@@ -375,6 +380,11 @@ class spoolRun {
$oPHPMailer->Host = $this->config['MESS_SERVER']; $oPHPMailer->Host = $this->config['MESS_SERVER'];
$oPHPMailer->Port = $this->config['MESS_PORT']; $oPHPMailer->Port = $this->config['MESS_PORT'];
$oPHPMailer->Username = $this->config['MESS_ACCOUNT']; $oPHPMailer->Username = $this->config['MESS_ACCOUNT'];
$passwd = $this->config['MESS_PASSWORD'];
if(strpos( $passwd, 'hush:' ) !== false){
list($hush, $pass) = explode(":", $passwd);
$this->config['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
}
$oPHPMailer->Password = $this->config['MESS_PASSWORD']; $oPHPMailer->Password = $this->config['MESS_PASSWORD'];
$oPHPMailer->From = $this->fileData['from_email']; $oPHPMailer->From = $this->fileData['from_email'];
$oPHPMailer->FromName = utf8_decode($this->fileData['from_name']); $oPHPMailer->FromName = utf8_decode($this->fileData['from_name']);
@@ -454,6 +464,12 @@ class spoolRun {
$send->setServer($this->config['MESS_SERVER']); $send->setServer($this->config['MESS_SERVER']);
$send->setPort($this->config['MESS_PORT']); $send->setPort($this->config['MESS_PORT']);
$send->setUsername($this->config['MESS_ACCOUNT']); $send->setUsername($this->config['MESS_ACCOUNT']);
$passwd = $this->config['MESS_PASSWORD'];
if(strpos( $passwd, 'hush:' ) !== false){
list($hush, $pass) = explode(":", $passwd);
$this->config['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
}
$send->setPassword($this->config['MESS_PASSWORD']); $send->setPassword($this->config['MESS_PASSWORD']);
$send->setReturnPath($this->fileData['from_email']); $send->setReturnPath($this->fileData['from_email']);
$send->setHeaders($header); $send->setHeaders($header);
@@ -482,7 +498,11 @@ class spoolRun {
$oConfiguration = new Configuration(); $oConfiguration = new Configuration();
$aConfiguration = $oConfiguration->load('Emails', '', '', '', ''); $aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
$aConfiguration = unserialize($aConfiguration['CFG_VALUE']); $aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
$passwd = $aConfiguration['MESS_PASSWORD'];
if(strpos( $passwd, 'hush:' ) !== false){
list($hush, $pass) = explode(":", $passwd);
$aConfiguration['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
}
if( $aConfiguration['MESS_ENABLED'] == '1' ) { if( $aConfiguration['MESS_ENABLED'] == '1' ) {
$this->setConfig(array ( $this->setConfig(array (
'MESS_ENGINE' => $aConfiguration['MESS_ENGINE'], 'MESS_ENGINE' => $aConfiguration['MESS_ENGINE'],

View File

@@ -599,7 +599,12 @@ class wsBase
public function sendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $aAttachment = null ) { public function sendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $aAttachment = null ) {
try { try {
$aSetup = getEmailConfiguration(); $aSetup = getEmailConfiguration();
$passwd =$aSetup['MESS_PASSWORD'];
if(strpos( $passwd, 'hush:' ) !== false)
{
list($hush, $pass) = explode(":", $passwd);
$aSetup['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
}
$oSpool = new spoolRun(); $oSpool = new spoolRun();
$oSpool->setConfig(array( $oSpool->setConfig(array(
'MESS_ENGINE' => $aSetup['MESS_ENGINE'], 'MESS_ENGINE' => $aSetup['MESS_ENGINE'],
@@ -677,11 +682,11 @@ class wsBase
); );
$oSpool->create( $messageArray ); $oSpool->create( $messageArray );
$oSpool->sendMail(); $oSpool->sendMail();
if ( $oSpool->status == 'sent' ) if ( $oSpool->status == 'sent' )
$result = new wsResponse (0, "message sent : $sTo" ); $result = new wsResponse (0, "message sent : $sTo" );
else else
$result = new wsResponse (29, $oSpool->status . ' ' . $oSpool->error . print_r ($aSetup ,1 ) ); $result = new wsResponse (29, $oSpool->status . ' ' . $oSpool->error . print_r ($aSetup ,1 ) );
return $result; return $result;
} }
catch ( Exception $e ) { catch ( Exception $e ) {

View File

@@ -724,6 +724,11 @@ class Xpdl extends processes
$oConfiguration = new Configuration(); $oConfiguration = new Configuration();
$emailArray = $oConfiguration->load('Emails','','','',''); $emailArray = $oConfiguration->load('Emails','','','','');
$arrayFrom = unserialize($emailArray['CFG_VALUE']); $arrayFrom = unserialize($emailArray['CFG_VALUE']);
$passwd = $arrayFrom['MESS_PASSWORD'];
if(strpos( $passwd, 'hush:' ) !== false){
list($hush, $pass) = explode(":", $passwd);
$arrayFrom['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
}
$from = $arrayFrom['MESS_ACCOUNT']; $from = $arrayFrom['MESS_ACCOUNT'];
if($to == 'ext'){ if($to == 'ext'){
$oUser = new Users(); $oUser = new Users();

View File

@@ -142,6 +142,11 @@ class AppNotes extends BaseAppNotes {
$aConfiguration = $oConfiguration->load('Emails', '', '', '', ''); $aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
if ($aConfiguration['CFG_VALUE'] != '') { if ($aConfiguration['CFG_VALUE'] != '') {
$aConfiguration = unserialize($aConfiguration['CFG_VALUE']); $aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
$passwd = $aConfiguration['MESS_PASSWORD'];
if(strpos( $passwd, 'hush:' ) !== false){
list($hush, $pass) = explode(":", $passwd);
$aConfiguration['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
}
} else { } else {
$aConfiguration = array(); $aConfiguration = array();
} }

View File

@@ -73,6 +73,10 @@ switch ($request) {
$port = ($_POST['port'] == 'default')? 25: $_POST['port']; $port = ($_POST['port'] == 'default')? 25: $_POST['port'];
$user = $_POST['account']; $user = $_POST['account'];
$passwd = $_POST['passwd']; $passwd = $_POST['passwd'];
if(strpos( $passwd, 'hush:' ) !== false){
list($hush, $pass) = explode(":", $passwd);
$passwd = G::decrypt($pass,'EMAILENCRYPT');
}
$step = $_POST['step']; $step = $_POST['step'];
$auth_required = $_POST['auth_required']; $auth_required = $_POST['auth_required'];
$send_test_mail = $_POST['send_test_mail']; $send_test_mail = $_POST['send_test_mail'];
@@ -159,7 +163,7 @@ switch ($request) {
$smtp->Hello($hello); $smtp->Hello($hello);
} }
if( $smtp->Authenticate($user, $passwd) ) { if( $smtp->Authenticate($user, $passwd ) ) {
print(SUCCESSFUL.','.$smtp->status); print(SUCCESSFUL.','.$smtp->status);
} else { } else {
print(FAILED.','.$smtp->error['error']); print(FAILED.','.$smtp->error['error']);

View File

@@ -32,6 +32,10 @@ $aFields['MESS_RAUTH'] = isset($_POST['form']['MESS_ENABLED']) ?is
$aFields['MESS_PORT'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_PORT']: ''; $aFields['MESS_PORT'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_PORT']: '';
$aFields['MESS_ACCOUNT'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_ACCOUNT']: ''; $aFields['MESS_ACCOUNT'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_ACCOUNT']: '';
$aFields['MESS_PASSWORD'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_PASSWORD']: ''; $aFields['MESS_PASSWORD'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_PASSWORD']: '';
if(strpos( $aFields['MESS_PASSWORD'], 'hush:' ) === false){
$aFields['MESS_PASSWORD'] = G::encrypt($aFields['MESS_PASSWORD'],'EMAILENCRYPT');
$aFields['MESS_PASSWORD'] = 'hush:'.$aFields['MESS_PASSWORD'];
}
$aFields['MESS_BACKGROUND'] = isset($_POST['form']['MESS_ENABLED']) ?isset($_POST['form']['MESS_BACKGROUND']) ? $_POST['form']['MESS_BACKGROUND'] : '': ''; $aFields['MESS_BACKGROUND'] = isset($_POST['form']['MESS_ENABLED']) ?isset($_POST['form']['MESS_BACKGROUND']) ? $_POST['form']['MESS_BACKGROUND'] : '': '';
$aFields['MESS_EXECUTE_EVERY'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_EXECUTE_EVERY']: ''; $aFields['MESS_EXECUTE_EVERY'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_EXECUTE_EVERY']: '';
$aFields['MESS_SEND_MAX'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_SEND_MAX']: ''; $aFields['MESS_SEND_MAX'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_SEND_MAX']: '';

View File

@@ -67,6 +67,7 @@
autocomplete : true, autocomplete : true,
hideTrigger : Boolean, hideTrigger : Boolean,
alignTo : 'right', alignTo : 'right',
selectOnFocus:true,
mode : 'remote', mode : 'remote',
triggerAction : 'all', triggerAction : 'all',
emptyText : _('ID_ENTER_SEARCH_TERM'), emptyText : _('ID_ENTER_SEARCH_TERM'),