2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Affero General Public License version 3 as published by the
8 * Free Software Foundation with the addition of the following permission added
9 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
18 * You should have received a copy of the GNU Affero General Public License along with
19 * this program; if not, see http://www.gnu.org/licenses or write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU Affero General Public License version 3.
30 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33 * technical reasons, the Appropriate Legal Notices must display the words
34 * "Powered by SugarCRM".
35 ********************************************************************************/
40 <form name="ConfigurePasswordSettings" method="POST" action="index.php" >
41 <input type='hidden' name='action' value='PasswordManager'/>
42 <input type='hidden' name='module' value='Administration'/>
43 <input type='hidden' name='saveConfig' value='1'/>
44 <span class='error'>{$error.main}</span>
45 <table width="100%" cellpadding="0" cellspacing="0" border="0" class="actionsContainer">
48 <td style="padding-bottom: 2px;" >
49 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" id="btn_save" type="submit" onclick="addcheck(form);return check_form('ConfigurePasswordSettings');" name="save" value="{$APP.LBL_SAVE_BUTTON_LABEL}" >
50 <input title="{$MOD.LBL_CANCEL_BUTTON_TITLE}" id="btn_cancel" onclick="document.location.href='index.php?module=Administration&action=index'" class="button" type="button" name="cancel" value="{$APP.LBL_CANCEL_BUTTON_LABEL}" >
54 <table width="100%" border="0" cellspacing="0" cellpadding="0">
58 <table id="sysGeneratedId" name="sysGeneratedName" width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
60 <th align="left" scope="row" colspan="4">
62 {$MOD.LBL_PASSWORD_SYST_GENERATED_TITLE}
67 <td scope="row" width='25%'>
68 {$MOD.LBL_PASSWORD_SYST_GENERATED_PWD_ON}: {sugar_help text=$MOD.LBL_PASSWORD_SYST_GENERATED_PWD_HELP WIDTH=400}
71 {if ($config.passwordsetting.SystemGeneratedPasswordON ) == '1'}
72 {assign var='SystemGeneratedPasswordON' value='CHECKED'}
74 {assign var='SystemGeneratedPasswordON' value=''}
76 <input type='hidden' name='passwordsetting_SystemGeneratedPasswordON' value='0'>
77 <input name='passwordsetting_SystemGeneratedPasswordON' id='SystemGeneratedPassword_checkbox' type='checkbox' value='1' {$SystemGeneratedPasswordON} onclick='enable_syst_generated_pwd(this);toggleDisplay("SystemGeneratedPassword_warning");'>
79 {if !($config.passwordsetting.SystemGeneratedPasswordON)}
80 {assign var='smtp_warning' value='none'}
84 <td colspan="2" id="SystemGeneratedPassword_warning" scope="row" style='display:{$smtp_warning}';>
85 <i>{if $SMTP_SERVER_NOT_SET} {$MOD.ERR_SMTP_SERVER_NOT_SET}<br>{/if}
86 {$MOD.LBL_EMAIL_ADDRESS_REQUIRED_FOR_FEATURE}</i>
90 <td align="left" scope="row" colspan="4">
91 {$MOD.LBL_PASSWORD_SYST_EXPIRATION}
96 <table width="100%" id='syst_generated_pwd_table' border="0" cellspacing="1" cellpadding="0">
98 {assign var='systexplogin' value=''}
99 {assign var='systexptime' value=''}
100 {assign var='systexpnone' value=''}
101 {if ($config.passwordsetting.systexpiration) == '0' || $config.passwordsetting.systexpiration==''}
102 {assign var='systexpnone' value='CHECKED'}
104 {if ($config.passwordsetting.systexpiration) == '1'}
105 {assign var='systexptime' value='CHECKED'}
107 {if ($config.passwordsetting.systexpiration) == '2'}
108 {assign var='systexplogin' value='CHECKED'}
111 <input type="radio" name="passwordsetting_systexpiration" value='0' {$systexpnone} onclick="form.passwordsetting_systexpirationtime.value='';form.passwordsetting_systexpirationlogin.value='';">
115 <input type="radio" name="passwordsetting_systexpiration" id="required_sys_pwd_exp_time" value='1' {$systexptime} onclick="form.passwordsetting_systexpirationlogin.value='';">
116 {$MOD.LBL_PASSWORD_EXP_IN}
117 {assign var='sdays' value=''}
118 {assign var='sweeks' value=''}
119 {assign var='smonths' value=''}
120 {if ($config.passwordsetting.systexpirationtype ) == '1'}
121 {assign var='sdays' value='SELECTED'}
123 {if ($config.passwordsetting.systexpirationtype ) == '7'}
124 {assign var='sweeks' value='SELECTED'}
126 {if ($config.passwordsetting.systexpirationtype ) == '30'}
127 {assign var='smonths' value='SELECTED'}
129 <input type='text' maxlength="3" and style="width:2em" name='passwordsetting_systexpirationtime' value='{$config.passwordsetting.systexpirationtime}'>
130 <SELECT NAME="passwordsetting_systexpirationtype">
131 <OPTION VALUE='1' {$sdays}>{$MOD.LBL_DAYS}
132 <OPTION VALUE='7' {$sweeks}>{$MOD.LBL_WEEKS}
133 <OPTION VALUE='30' {$smonths}>{$MOD.LBL_MONTHS}
136 <td colspan='2' width='40%'>
137 <input type="radio" name="passwordsetting_systexpiration" id="required_sys_pwd_exp_login" value='2' {$systexplogin} onclick="form.passwordsetting_systexpirationtime.value='';">
138 {$MOD.LBL_PASSWORD_EXP_AFTER}
139 <input type='text' maxlength="3" and style="width:2em" name='passwordsetting_systexpirationlogin' value="{$config.passwordsetting.systexpirationlogin}">
140 {$MOD.LBL_PASSWORD_LOGINS}
148 <table id="userResetPassId" name="userResetPassName" width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
150 <th align="left" scope="row" colspan="2"><h4>{$MOD.LBL_PASSWORD_USER_RESET}</h4>
155 <td width="25%" scope="row">{$MOD.LBL_PASSWORD_FORGOT_FEATURE}: {sugar_help text=$MOD.LBL_PASSWORD_FORGOT_FEATURE_HELP WIDTH=400}</td>
156 <td scope="row" width="25%" >
157 {if ($config.passwordsetting.forgotpasswordON ) == '1'}
158 {assign var='forgotpasswordON' value='CHECKED'}
160 {assign var='forgotpasswordON' value=''}
162 <input type='hidden' name='passwordsetting_forgotpasswordON' value='0'>
163 <input name="passwordsetting_forgotpasswordON" id="forgotpassword_checkbox" value="1" class="checkbox" type="checkbox" onclick='forgot_password_enable(this); toggleDisplay("SystemGeneratedPassword_warning2");' {$forgotpasswordON}>
165 {if !($config.passwordsetting.forgotpasswordON)}
166 {assign var='smtp_warning_2' value='none'}
169 <tr><td colspan="4" id="SystemGeneratedPassword_warning2" scope="row" style='display:{$smtp_warning_2}';>
170 <i>{if $SMTP_SERVER_NOT_SET} {$MOD.ERR_SMTP_SERVER_NOT_SET}<br>{/if}
171 {$MOD.LBL_EMAIL_ADDRESS_REQUIRED_FOR_FEATURE}</i>
175 <td width="25%" scope="row">{$MOD.LBL_PASSWORD_LINK_EXPIRATION}: {sugar_help text=$MOD.LBL_PASSWORD_LINK_EXPIRATION_HELP WIDTH=400}</td>
177 <table width="100%" border="0" cellspacing="0" cellpadding="0" id="forgot_password_table">
180 {assign var='linkexptime' value=''}
181 {assign var='linkexpnone' value=''}
182 {if ($config.passwordsetting.linkexpiration) == '0'}
183 {assign var='linkexpnone' value='CHECKED'}
185 {if ($config.passwordsetting.linkexpiration) == '1'}
186 {assign var='linkexptime' value='CHECKED'}
189 <input type="radio" name="passwordsetting_linkexpiration" value='0' {$linkexpnone} onclick="form.passwordsetting_linkexpirationtime.value='';">
193 <input type="radio" name="passwordsetting_linkexpiration" id="required_link_exp_time" value='1' {$linkexptime}>
194 {$MOD.LBL_PASSWORD_LINK_EXP_IN}
195 {assign var='ldays' value=''}
196 {assign var='lweeks' value=''}
197 {assign var='lmonths' value=''}
198 {if ($config.passwordsetting.linkexpirationtype ) == '1'}
199 {assign var='ldays' value='SELECTED'}
201 {if ($config.passwordsetting.linkexpirationtype ) == '60'}
202 {assign var='lweeks' value='SELECTED'}
204 {if ($config.passwordsetting.linkexpirationtype ) == '1440'}
205 {assign var='lmonths' value='SELECTED'}
207 <input type='text' maxlength="3" and style="width:2em" name='passwordsetting_linkexpirationtime' value='{$config.passwordsetting.linkexpirationtime}'>
208 <SELECT NAME="passwordsetting_linkexpirationtype">
209 <OPTION VALUE='1' {$ldays}>{$MOD.LBL_MINUTES}
210 <OPTION VALUE='60' {$lweeks}>{$MOD.LBL_HOURS}
211 <OPTION VALUE='1440' {$lmonths}>{$MOD.LBL_DAYS}
221 {if !empty($settings.captcha_on) || !($VALID_PUBLIC_KEY)}
222 {assign var='captcha_checked' value='CHECKED'}
224 {assign var='captcha_checked' value=''}
226 <td width="25%" scope="row">{$MOD.ENABLE_CAPTCHA}: {sugar_help text=$MOD.LBL_CAPTCHA_HELP_TEXT WIDTH=400}</td>
227 <td scope="row" width="75%"><input type='hidden' name='captcha_on' value='0'><input name="captcha_on" id="captcha_id" value="1" class="checkbox" tabindex='1' type="checkbox" onclick='document.getElementById("captcha_config_display").style.display=this.checked?"":"none";' {$captcha_checked}></td>
230 <table width="100%" border="0" cellspacing="0" cellpadding="0">
233 <div id="captcha_config_display" style="display:{$CAPTCHA_CONFIG_DISPLAY}">
234 <table width="100%" cellpadding="0" cellspacing="0">
236 <td width="10%" scope="row">{$MOD.LBL_PUBLIC_KEY}<span class="required">*</span></td>
237 <td width="40%" ><input type="text" name="captcha_public_key" id="captcha_public_key" size="45" value="{$settings.captcha_public_key}" tabindex='1' onblur="this.value=this.value.replace(/^\s+/,'').replace(/\s+$/,'')"></td>
238 <td width="10%" scope="row">{$MOD.LBL_PRIVATE_KEY}<span class="required">*</span></td>
239 <td width="40%" ><input type="text" name="captcha_private_key" size="45" value="{$settings.captcha_private_key}" tabindex='1' onblur="this.value=this.value.replace(/^\s+/,'').replace(/\s+$/,'')"></td>
245 {if !($VALID_PUBLIC_KEY)}
246 <tr><td scope="row"><span class='error'>{$MOD.ERR_PUBLIC_CAPTCHA_KEY}</span></td></tr>
253 <table id="emailTemplatesId" name="emailTemplatesName" width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
255 <th align="left" scope="row" colspan="4">
257 {$MOD.LBL_PASSWORD_TEMPLATE}
263 <td scope="row" width="35%">{$MOD.LBL_PASSWORD_GENERATE_TEMPLATE_MSG}: </td>
266 <select tabindex='251' id="generatepasswordtmpl" name="passwordsetting_generatepasswordtmpl" {$IE_DISABLED}>{$TMPL_DRPDWN_GENERATE}</select>
267 <input type="button" class="button" onclick="javascript:open_email_template_form('generatepasswordtmpl')" value="{$MOD.LBL_PASSWORD_CREATE_TEMPLATE}" {$IE_DISABLED}>
268 <input type="button" value="{$MOD.LBL_PASSWORD_EDIT_TEMPLATE}" class="button" onclick="javascript:edit_email_template_form('generatepasswordtmpl')" name='edit_generatepasswordtmpl' id='edit_generatepasswordtmpl' style="{$EDIT_TEMPLATE}">
275 <td scope="row">{$MOD.LBL_PASSWORD_LOST_TEMPLATE_MSG}: </td>
278 <select tabindex='251' id="lostpasswordtmpl" name="passwordsetting_lostpasswordtmpl" {$IE_DISABLED}>{$TMPL_DRPDWN_LOST}</select>
279 <input type="button" class="button" onclick="javascript:open_email_template_form('lostpasswordtmpl')" value="{$MOD.LBL_PASSWORD_CREATE_TEMPLATE}" {$IE_DISABLED}>
280 <input type="button" value="{$MOD.LBL_PASSWORD_EDIT_TEMPLATE}" class="button" onclick="javascript:edit_email_template_form('lostpasswordtmpl')" name='edit_lostpasswordtmpl' id='edit_lostpasswordtmpl' style="{$EDIT_TEMPLATE}">
289 {if !empty($settings.system_ldap_enabled)}
290 {assign var='system_ldap_enabled_checked' value='CHECKED'}
291 {assign var='ldap_display' value='inline'}
293 {assign var='system_ldap_enabled_checked' value=''}
294 {assign var='ldap_display' value='none'}
296 <table id='ldap_table' width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
299 <table width="100%" border="0" cellspacing="0" cellpadding="0">
301 <th align="left" scope="row" colspan='3'><h4>{$MOD.LBL_LDAP_TITLE}</h4></th>
304 <td width="25%" scope="row" valign='middle'>
305 {$MOD.LBL_LDAP_ENABLE}{sugar_help text=$MOD.LBL_LDAP_HELP_TXT}
306 </td><td valign='middle'><input name="system_ldap_enabled" id="system_ldap_enabled" class="checkbox" type="checkbox" {$system_ldap_enabled_checked} onclick='toggleDisplay("ldap_display");enableDisablePasswordTable("system_ldap_enabled");'></td><td> </td><td> </td></tr>
309 <table cellspacing='0' cellpadding='1' id='ldap_display' style='display:{$ldap_display}' width='100%'>
311 <td width='25%' scope="row" valign='top' nowrap>{$MOD.LBL_LDAP_SERVER_HOSTNAME} {sugar_help text=$MOD.LBL_LDAP_SERVER_HOSTNAME_DESC}</td>{$settings.proxy_host}
312 <td width='25%' align="left" valign='top'><input name="ldap_hostname" size='25' type="text" value="{$settings.ldap_hostname}"></td>
313 <td width='25%' scope="row" valign='top' nowrap>{$MOD.LBL_LDAP_SERVER_PORT} {sugar_help text=$MOD.LBL_LDAP_SERVER_PORT_DESC}</td>{$settings.proxy_port}
314 <td width='25%' align="left" valign='top' ><input name="ldap_port" size='6' type="text" value="{$settings.ldap_port}"></td>
317 <td scope="row" valign='middle' nowrap>{$MOD.LBL_LDAP_USER_DN} {sugar_help text=$MOD.LBL_LDAP_USER_DN_DESC}</td>
318 <td align="left" valign='middle'><input name="ldap_base_dn" size='35' type="text" value="{$settings.ldap_base_dn}"></td>
319 <td scope="row" valign='middle' nowrap>{$MOD.LBL_LDAP_USER_FILTER} {sugar_help text=$MOD.LBL_LDAP_USER_FILTER_DESC}</td>
320 <td align="left" valign='middle'><input name="ldap_login_filter" size='25' type="text" value="{$settings.ldap_login_filter}"></td>
323 <td scope="row" valign='top' nowrap>{$MOD.LBL_LDAP_BIND_ATTRIBUTE} {sugar_help text=$MOD.LBL_LDAP_BIND_ATTRIBUTE_DESC}</td>
324 <td align="left" valign='top'><input name="ldap_bind_attr" size='25' type="text" value="{$settings.ldap_bind_attr}"> </td>
325 <td scope="row" valign='middle' nowrap>{$MOD.LBL_LDAP_LOGIN_ATTRIBUTE} {sugar_help text=$MOD.LBL_LDAP_LOGIN_ATTRIBUTE_DESC}</td>
326 <td align="left" valign='middle'><input name="ldap_login_attr" size='25' type="text" value="{$settings.ldap_login_attr}"></td>
329 <td scope="row" valign='top'nowrap>{$MOD.LBL_LDAP_GROUP_MEMBERSHIP} {sugar_help text=$MOD.LBL_LDAP_GROUP_MEMBERSHIP_DESC}</td>
330 <td align="left" valign='top'>
331 {if !empty($settings.ldap_group)}
332 {assign var='ldap_group_checked' value='CHECKED'}
333 {assign var='ldap_group_display' value=''}
335 {assign var='ldap_group_checked' value=''}
336 {assign var='ldap_group_display' value='none'}
338 <input name="ldap_group_checkbox" class="checkbox" type="checkbox" {$ldap_group_checked} onclick='toggleDisplay("ldap_group")'>
340 <td valign='middle' nowrap></td>
341 <td align="left" valign='middle'></td>
346 <span id='ldap_group' style='display:{$ldap_group_display}'>
349 <td width='25%' scope="row" valign='top'nowrap>{$MOD.LBL_LDAP_GROUP_DN} {sugar_help text=$MOD.LBL_LDAP_GROUP_DN_DESC}</td>
350 <td width='25%' align="left" valign='top'><input name="ldap_group_dn" size='20' type="text" value="{$settings.ldap_group_dn}"></td>
351 <td width='25%' scope="row" valign='top'nowrap>{$MOD.LBL_LDAP_GROUP_NAME} {sugar_help text=$MOD.LBL_LDAP_GROUP_NAME_DESC}</td>
352 <td width='25%' align="left" valign='top'><input name="ldap_group_name" size='20' type="text" value="{$settings.ldap_group_name}"></td>
355 <td scope="row" valign='top' nowrap>{$MOD.LBL_LDAP_GROUP_USER_ATTR} {sugar_help text=$MOD.LBL_LDAP_GROUP_USER_ATTR_DESC}</td>
356 <td align="left" valign='top'><input name="ldap_group_user_attr" size='20' type="text" value="{$settings.ldap_group_user_attr}"> </td>
357 <td scope="row" valign='top' nowrap>{$MOD.LBL_LDAP_GROUP_ATTR} {sugar_help text=$MOD.LBL_LDAP_GROUP_ATTR_DESC}</td>
358 <td align="left" valign='top'><input name="ldap_group_attr" size='20' type="text" value="{$settings.ldap_group_attr}"> </td>
366 <td scope="row" valign='top'nowrap>{$MOD.LBL_LDAP_AUTHENTICATION} {sugar_help text=$MOD.LBL_LDAP_AUTHENTICATION_DESC}</td>
367 <td align="left" valign='top' >
368 {if !empty($settings.ldap_authentication)}
369 {assign var='ldap_authentication_checked' value='CHECKED'}
370 {assign var='ldap_authentication_display' value=''}
372 {assign var='ldap_authentication_checked' value=''}
373 {assign var='ldap_authentication_display' value='none'}
375 <input name="ldap_authentication_checkbox" class="checkbox" type="checkbox" {$ldap_authentication_checked} onclick='toggleDisplay("ldap_authentication")'>
377 <td valign='middle' nowrap></td>
378 <td align="left" valign='middle'></td>
383 <span id='ldap_authentication' style='display:{$ldap_authentication_display}'>
384 <table width='100%' >
386 <td width='25%' scope="row" valign='top'nowrap>{$MOD.LBL_LDAP_ADMIN_USER} {sugar_help text=$MOD.LBL_LDAP_ADMIN_USER_DESC}</td>
387 <td width='25%' align="left" valign='top'><input name="ldap_admin_user" size='20' type="text" value="{$settings.ldap_admin_user}"></td>
388 <td width='25%' scope="row" valign='middle' nowrap>{$MOD.LBL_LDAP_ADMIN_PASSWORD}</td>
389 <td width='25%' align="left" valign='middle'><input name="ldap_admin_password" size='20' type="password" value="{$settings.ldap_admin_password}"> </td>
397 <td scope="row" valign='top' nowrap>{$MOD.LBL_LDAP_AUTO_CREATE_USERS} {sugar_help text=$MOD.LBL_LDAP_AUTO_CREATE_USERS_DESC}</td>
398 {if !empty($settings.ldap_auto_create_users)}
399 {assign var='ldap_auto_create_users_checked' value='CHECKED'}
401 {assign var='ldap_auto_create_users_checked' value=''}
403 <td align="left" valign='top'><input type='hidden' name='ldap_auto_create_users' value='0'><input name="ldap_auto_create_users" value="1" class="checkbox" type="checkbox" {$ldap_auto_create_users_checked}></td>
404 <td valign='middle' nowrap></td>
405 <td align="left" valign='middle'></td>
408 <td scope="row" valign='middle' nowrap>{$MOD.LBL_LDAP_ENC_KEY} {sugar_help text=$LDAP_ENC_KEY_DESC}</td>
409 <td align="left" valign='middle'><input name="ldap_enc_key" size='35' type="password" value="{$settings.ldap_enc_key}" {$LDAP_ENC_KEY_READONLY}> </td>
410 <td valign='middle' nowrap></td>
411 <td align="left" valign='middle'></td>
422 {if !empty($config.authenticationClass) && $config.authenticationClass == 'SAMLAuthenticate'}
423 {assign var='saml_enabled_checked' value='CHECKED'}
424 {assign var='saml_display' value='inline'}
426 {assign var='saml_enabled_checked' value=''}
427 {assign var='saml_display' value='none'}
430 <table id = 'saml_table' width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
433 <table width="100%" border="0" cellspacing="0" cellpadding="0">
435 <th align="left" scope="row" colspan='3'><h4>{$MOD.LBL_SAML_TITLE}</h4></th>
438 <td width="25%" scope="row" valign='middle'>
439 {$MOD.LBL_SAML_ENABLE}{sugar_help text=$MOD.LBL_SAML_HELP_TXT}
440 </td><td valign='middle'>
442 <input name="authenticationClass" id="system_saml_enabled" class="checkbox"
443 value="SAMLAuthenticate" type="checkbox"
444 {if $saml_enabled_checked}checked="1"{/if}
445 onclick='toggleDisplay("saml_display");enableDisablePasswordTable("system_saml_enabled");'>
446 </td><td> </td><td> </td></tr>
449 <table cellspacing='0' cellpadding='1' id='saml_display' style='display:{$saml_display}' width='100%'>
451 <td scope="row" valign='middle' nowrap>{$MOD.LBL_SAML_LOGIN_URL} {sugar_help text=$MOD.LBL_SAML_LOGIN_URL_DESC}</td>
452 <td align="left" valign='middle'><input name="SAML_loginurl" size='35' type="text" value="{$config.SAML_loginurl}"></td>
456 <td width='25%' scope="row" valign='top' nowrap>{$MOD.LBL_SAML_CERT} {sugar_help text=$MOD.LBL_SAML_CERT_DESC}</td>{$settings.proxy_host}
457 <td width='25%' align="left" valign='top'><textarea style='height:200px;width:600px' name="SAML_X509Cert" >{$config.SAML_X509Cert}</textarea></td>
472 <div style="padding-top: 2px;">
473 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button primary" id="btn_save" type="submit" onclick="addcheck(form);return check_form('ConfigurePasswordSettings');" name="save" value="{$APP.LBL_SAVE_BUTTON_LABEL}" />
474 <input title="{$MOD.LBL_CANCEL_BUTTON_TITLE}" onclick="document.location.href='index.php?module=Administration&action=index'" class="button" type="button" name="cancel" value="{$APP.LBL_CANCEL_BUTTON_LABEL}" />
487 {if !($VALID_PUBLIC_KEY)}
489 document.getElementById('captcha_public_key').focus();
490 document.getElementById('captcha_id').checked=true;
491 document.getElementById('forgotpassword_checkbox').checked=true;
498 function addcheck(form){{/literal}
499 addForm('ConfigurePasswordSettings');
502 if(document.getElementById('forgotpassword_checkbox').checked){literal}{{/literal}
503 addToValidate('ConfigurePasswordSettings', 'passwordsetting_linkexpirationtime', 'int', form.required_link_exp_time.checked,"{$MOD.ERR_PASSWORD_LINK_EXPIRE_TIME} ");
506 if(document.getElementById('SystemGeneratedPassword_checkbox').checked){literal}{{/literal}
507 addToValidate('ConfigurePasswordSettings', 'passwordsetting_systexpirationtime', 'int', form.required_sys_pwd_exp_time.checked,"{$MOD.ERR_PASSWORD_EXPIRE_TIME}" );
508 addToValidate('ConfigurePasswordSettings', 'passwordsetting_systexpirationlogin', 'int', form.required_sys_pwd_exp_login.checked,"{$MOD.ERR_PASSWORD_EXPIRE_LOGIN}" );
515 function open_email_template_form(fieldToSet) {
516 fieldToSetValue = fieldToSet;
517 URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
518 windowName = 'email_template';
519 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
521 win = window.open(URL, windowName, windowFeatures);
524 // put the focus on the popup if the browser supports the focus() method
529 function enableDisablePasswordTable(checkbox_id) {
530 var other = checkbox_id == "system_saml_enabled" ? "ldap_table" : "saml_table";
531 var enabled = document.getElementById(checkbox_id).checked;
533 document.getElementById("emailTemplatesId").style.display = "none";
534 document.getElementById("sysGeneratedId").style.display = "none";
535 document.getElementById("userResetPassId").style.display = "none";
537 document.getElementById("emailTemplatesId").style.display = "";
538 document.getElementById("sysGeneratedId").style.display = "";
539 document.getElementById("userResetPassId").style.display = "";
544 function edit_email_template_form(templateField) {
545 fieldToSetValue = templateField;
546 var field=document.getElementById(templateField);
547 URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
548 if (field.options[field.selectedIndex].value != 'undefined') {
549 URL+="&record="+field.options[field.selectedIndex].value;
551 windowName = 'email_template';
552 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
554 win = window.open(URL, windowName, windowFeatures);
557 // put the focus on the popup if the browser supports the focus() method
562 function refresh_email_template_list(template_id, template_name) {
563 var field=document.getElementById(fieldToSetValue);
565 for (var i=0; i < field.options.length; i++) {
566 if (field.options[i].value == template_id) {
567 if (field.options[i].selected==false) {
568 field.options[i].selected=true;
570 field.options[i].text = template_name;
574 //add item to selection list.
576 var newElement=document.createElement('option');
577 newElement.text=template_name;
578 newElement.value=template_id;
579 field.options.add(newElement);
580 newElement.selected=true;
583 //enable the edit button.
584 var editButtonName = 'edit_generatepasswordtmpl';
585 if (fieldToSetValue == 'generatepasswordtmpl') {
586 editButtonName = 'edit_lostpasswordtmpl';
588 var field1=document.getElementById(editButtonName);
589 field1.style.visibility="visible";
591 var applyListToTemplateField = 'generatepasswordtmpl';
592 if (fieldToSetValue == 'generatepasswordtmpl') {
593 applyListToTemplateField = 'lostpasswordtmpl';
595 var field=document.getElementById(applyListToTemplateField);
597 for (var i=0; i < field.options.length; i++) {
598 if (field.options[i].value == template_id) {
599 field.options[i].text = template_name;
604 var newElement=document.createElement('option');
605 newElement.text=template_name;
606 newElement.value=template_id;
607 field.options.add(newElement);
612 function testregex(customregex)
616 var string = 'hello';
617 string.match(customregex.value);
621 alert(SUGAR.language.get("Administration", "ERR_INCORRECT_REGEX"));
622 setTimeout("document.getElementById('customregex').select()",10);
625 function toggleDisplay_2(id){
627 if(this.document.getElementById(id).style.display=='none'){
628 this.document.getElementById(id).style.display='';
629 this.document.getElementById(id+"_lbl").innerHTML='{/literal}{$MOD.LBL_HIDE_ADVANCED_OPTIONS}{literal}';
630 this.document.getElementById("regex_config_display_img").src = '{/literal}{sugar_getimagepath file="basic_search.gif"}{literal}';
632 this.document.getElementById(id).style.display='none'
633 this.document.getElementById(id+"_lbl").innerHTML='{/literal}{$MOD.LBL_SHOW_ADVANCED_OPTIONS}{literal}';
634 this.document.getElementById("regex_config_display_img").src = '{/literal}{sugar_getimagepath file="advanced_search.gif"}{literal}';
638 function forgot_password_enable(check){
639 var table_fields=document.getElementById('forgot_password_table');
640 var forgot_password_input=table_fields.getElementsByTagName('input');
641 var forgot_password_select=table_fields.getElementsByTagName('select');
643 for (i=0;i<forgot_password_input.length;i++)
644 forgot_password_input[i].disabled='';
645 for (j=0;j<forgot_password_select.length;j++)
646 forgot_password_select[j].disabled='';
647 document.ConfigurePasswordSettings.captcha_on[1].disabled='';
650 document.ConfigurePasswordSettings.captcha_on[1].disabled='disabled';
651 document.ConfigurePasswordSettings.captcha_on[1].checked='';
652 document.getElementById("captcha_config_display").style.display='none';
653 for (i=0;i<forgot_password_input.length;i++)
654 forgot_password_input[i].disabled='disabled';
655 for (j=0;j<forgot_password_select.length;j++)
656 forgot_password_select[j].disabled='disabled';
660 function enable_syst_generated_pwd(check){
661 var table_fields=document.getElementById('syst_generated_pwd_table');
662 var syst_generated_pwd_input=table_fields.getElementsByTagName('input');
663 var syst_generated_pwd_select=table_fields.getElementsByTagName('select');
665 for (i=0;i<syst_generated_pwd_input.length;i++)
666 syst_generated_pwd_input[i].disabled='';
667 for (j=0;j<syst_generated_pwd_select.length;j++)
668 syst_generated_pwd_select[j].disabled='';
671 for (i=0;i<syst_generated_pwd_input.length;i++)
672 syst_generated_pwd_input[i].disabled='disabled';
673 for (j=0;j<syst_generated_pwd_select.length;j++)
674 syst_generated_pwd_select[j].disabled='disabled';
677 forgot_password_enable(document.getElementById('forgotpassword_checkbox'));
678 enable_syst_generated_pwd(document.getElementById('SystemGeneratedPassword_checkbox'));
679 if(document.getElementById('system_saml_enabled').checked)enableDisablePasswordTable('system_saml_enabled');
680 if(document.getElementById('system_ldap_enabled').checked)enableDisablePasswordTable('system_ldap_enabled');