mirror of
https://github.com/salesagility/SuiteCRM.git
synced 2025-03-16 22:33:34 +00:00
password change field added
This commit is contained in:
parent
c1975825cd
commit
476876a526
5 changed files with 59 additions and 6 deletions
modules/OutboundEmailAccounts
|
@ -48,16 +48,41 @@ class OutboundEmailAccounts extends OutboundEmailAccounts_sugar {
|
|||
}
|
||||
|
||||
public function save($check_notify = false) {
|
||||
$this->password = blowfishEncode(blowfishGetKey('OutboundEmailAccounts.password'), $this->password);
|
||||
if(!$this->password && $this->id) {
|
||||
$bean = new OutboundEmailAccounts();
|
||||
$bean->retrieve($this->id);
|
||||
$this->password = $bean->password;
|
||||
}
|
||||
$this->password = $this->password ? blowfishEncode(blowfishGetKey('OutboundEmailAccounts.password'), $this->password) : null;
|
||||
$results = parent::save($check_notify);
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function retrieve($id = -1, $encode = true, $deleted = true) {
|
||||
$results = parent::retrieve($id, $encode, $deleted);
|
||||
$this->password = blowfishDecode(blowfishGetKey('OutboundEmailAccounts.password'), $this->password);
|
||||
$this->password = $this->password ? blowfishDecode(blowfishGetKey('OutboundEmailAccounts.password'), $this->password) : null;
|
||||
return $results;
|
||||
}
|
||||
|
||||
public static function getPasswordChange() {
|
||||
global $mod_strings;
|
||||
$html = <<<HTML
|
||||
<script type="text/javascript">
|
||||
var passwordToggle = function(sel) {
|
||||
$(sel).toggle();
|
||||
if($(sel).css('display') == 'none') {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div id="password_toggle" style="display:none;">
|
||||
<input type="password" id="password" name="password" />
|
||||
</div>
|
||||
<a href="javascript:;" onclick="passwordToggle('#password_toggle');">{$mod_strings['LBL_CHANGE_PASSWORD']}</a>
|
||||
|
||||
HTML;
|
||||
return $html;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
|
@ -78,4 +78,5 @@ $mod_strings = array (
|
|||
'LNK_IMPORT_OUTBOUNDEMAILACCOUNTS' => 'Import Outbound Email Accounts',
|
||||
'LBL_OUTBOUNDEMAILACCOUNTS_SUBPANEL_TITLE' => 'Outbound Email Accounts',
|
||||
'LBL_OUTBOUNDEMAILACCOUNT_CAMPA' => 'outboundemailaccount_campaigns_name',
|
||||
'LBL_CHANGE_PASSWORD' => 'Change password'
|
||||
);
|
|
@ -61,7 +61,7 @@ array (
|
|||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'password',
|
||||
'name' => 'password_change',
|
||||
'label' => 'LBL_PASSWORD',
|
||||
),
|
||||
),
|
||||
|
|
|
@ -65,7 +65,7 @@ array (
|
|||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'password',
|
||||
'name' => 'password_change',
|
||||
'label' => 'LBL_PASSWORD',
|
||||
),
|
||||
),
|
||||
|
|
|
@ -267,10 +267,10 @@
|
|||
),
|
||||
'password' =>
|
||||
array (
|
||||
'required' => true,
|
||||
'required' => false,
|
||||
'name' => 'password',
|
||||
'vname' => 'LBL_PASSWORD',
|
||||
'type' => 'password',
|
||||
'type' => 'varchar',
|
||||
'massupdate' => 0,
|
||||
'no_default' => false,
|
||||
'comments' => '',
|
||||
|
@ -286,6 +286,33 @@
|
|||
'len' => '255',
|
||||
'size' => '20',
|
||||
),
|
||||
'password_change' =>
|
||||
array (
|
||||
'required' => false,
|
||||
'name' => 'password_change',
|
||||
'vname' => 'LBL_PASSWORD',
|
||||
'type' => 'function',
|
||||
'source' => 'non-db',
|
||||
'massupdate' => 0,
|
||||
'no_default' => false,
|
||||
'comments' => '',
|
||||
'help' => '',
|
||||
'importable' => 'true',
|
||||
'duplicate_merge' => 'disabled',
|
||||
'duplicate_merge_dom_value' => '0',
|
||||
'audited' => false,
|
||||
'inline_edit' => true,
|
||||
'reportable' => true,
|
||||
'unified_search' => false,
|
||||
'merge_filter' => 'disabled',
|
||||
'len' => '255',
|
||||
'size' => '20',
|
||||
'function' => array(
|
||||
'name' => 'OutboundEmailAccounts::getPasswordChange',
|
||||
'returns' => 'html',
|
||||
'include' => 'modules/OutboundEmailAccounts/OutboundEmailAccounts.php'
|
||||
),
|
||||
),
|
||||
'smtp_servername' =>
|
||||
array (
|
||||
'required' => true,
|
||||
|
|
Loading…
Reference in a new issue