2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2011 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 <script type='text/javascript' src='include/javascript/overlibmws.js'></script>
41 <form name="ConfigurePasswordSettings" method="POST" action="index.php" >
42 <input type='hidden' name='action' value='PasswordManager'/>
43 <input type='hidden' name='module' value='Administration'/>
44 <input type='hidden' name='saveConfig' value='1'/>
45 <span class='error'>{$error.main}</span>
46 <table width="100%" cellpadding="0" cellspacing="0" border="0" class="actionsContainer">
49 <td style="padding-bottom: 2px;" >
50 <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}" >
51 <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}" >
55 <table width="100%" border="0" cellspacing="0" cellpadding="0">
59 <table id="sysGeneratedId" name="sysGeneratedName" width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
61 <th align="left" scope="row" colspan="4">
63 {$MOD.LBL_PASSWORD_SYST_GENERATED_TITLE}
68 <td scope="row" width='25%'>
69 {$MOD.LBL_PASSWORD_SYST_GENERATED_PWD_ON}: {sugar_help text=$MOD.LBL_PASSWORD_SYST_GENERATED_PWD_HELP WIDTH=400}
72 {if ($config.passwordsetting.SystemGeneratedPasswordON ) == '1'}
73 {assign var='SystemGeneratedPasswordON' value='CHECKED'}
75 {assign var='SystemGeneratedPasswordON' value=''}
77 <input type='hidden' name='passwordsetting_SystemGeneratedPasswordON' value='0'>
78 <input name='passwordsetting_SystemGeneratedPasswordON' id='SystemGeneratedPassword_checkbox' type='checkbox' value='1' {$SystemGeneratedPasswordON} onclick='enable_syst_generated_pwd(this);toggleDisplay("SystemGeneratedPassword_warning");'>
80 {if !($config.passwordsetting.SystemGeneratedPasswordON)}
81 {assign var='smtp_warning' value='none'}
85 <td colspan="2" id='SystemGeneratedPassword_warning'scope="row" style='display:{$smtp_warning}';>
86 <i>{if $SMTP_SERVER_NOT_SET} {$MOD.ERR_SMTP_SERVER_NOT_SET}<br>{/if}
87 {$MOD.LBL_EMAIL_ADDRESS_REQUIRED_FOR_FEATURE}</i>
91 <td align="left" scope="row" colspan="4">
92 {$MOD.LBL_PASSWORD_SYST_EXPIRATION}
97 <table width="100%" id='syst_generated_pwd_table' border="0" cellspacing="1" cellpadding="0">
99 {assign var='systexplogin' value=''}
100 {assign var='systexptime' value=''}
101 {assign var='systexpnone' value=''}
102 {if ($config.passwordsetting.systexpiration) == '0' || $config.passwordsetting.systexpiration==''}
103 {assign var='systexpnone' value='CHECKED'}
105 {if ($config.passwordsetting.systexpiration) == '1'}
106 {assign var='systexptime' value='CHECKED'}
108 {if ($config.passwordsetting.systexpiration) == '2'}
109 {assign var='systexplogin' value='CHECKED'}
112 <input type="radio" name="passwordsetting_systexpiration" value='0' {$systexpnone} onclick="form.passwordsetting_systexpirationtime.value='';form.passwordsetting_systexpirationlogin.value='';">
116 <input type="radio" name="passwordsetting_systexpiration" id="required_sys_pwd_exp_time" value='1' {$systexptime} onclick="form.passwordsetting_systexpirationlogin.value='';">
117 {$MOD.LBL_PASSWORD_EXP_IN}
118 {assign var='sdays' value=''}
119 {assign var='sweeks' value=''}
120 {assign var='smonths' value=''}
121 {if ($config.passwordsetting.systexpirationtype ) == '1'}
122 {assign var='sdays' value='SELECTED'}
124 {if ($config.passwordsetting.systexpirationtype ) == '7'}
125 {assign var='sweeks' value='SELECTED'}
127 {if ($config.passwordsetting.systexpirationtype ) == '30'}
128 {assign var='smonths' value='SELECTED'}
130 <input type='text' maxlength="3" and style="width:2em" name='passwordsetting_systexpirationtime' value='{$config.passwordsetting.systexpirationtime}'>
131 <SELECT NAME="passwordsetting_systexpirationtype">
132 <OPTION VALUE='1' {$sdays}>{$MOD.LBL_DAYS}
133 <OPTION VALUE='7' {$sweeks}>{$MOD.LBL_WEEKS}
134 <OPTION VALUE='30' {$smonths}>{$MOD.LBL_MONTHS}
137 <td colspan='2' width='40%'>
138 <input type="radio" name="passwordsetting_systexpiration" id="required_sys_pwd_exp_login" value='2' {$systexplogin} onclick="form.passwordsetting_systexpirationtime.value='';">
139 {$MOD.LBL_PASSWORD_EXP_AFTER}
140 <input type='text' maxlength="3" and style="width:2em" name='passwordsetting_systexpirationlogin' value="{$config.passwordsetting.systexpirationlogin}">
141 {$MOD.LBL_PASSWORD_LOGINS}
149 <table id="userResetPassId" name="userResetPassName" width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
151 <th align="left" scope="row" colspan="2"><h4>{$MOD.LBL_PASSWORD_USER_RESET}</h4>
156 <td width="25%" scope="row">{$MOD.LBL_PASSWORD_FORGOT_FEATURE}: {sugar_help text=$MOD.LBL_PASSWORD_FORGOT_FEATURE_HELP WIDTH=400}</td>
157 <td scope="row" width="25%" >
158 {if ($config.passwordsetting.forgotpasswordON ) == '1'}
159 {assign var='forgotpasswordON' value='CHECKED'}
161 {assign var='forgotpasswordON' value=''}
163 <input type='hidden' name='passwordsetting_forgotpasswordON' value='0'>
164 <input name="passwordsetting_forgotpasswordON" id="forgotpassword_checkbox" value="1" class="checkbox" type="checkbox" onclick='forgot_password_enable(this); toggleDisplay("SystemGeneratedPassword_warning2");' {$forgotpasswordON}>
166 {if !($config.passwordsetting.forgotpasswordON)}
167 {assign var='smtp_warning_2' value='none'}
170 <tr><td colspan="4" id='SystemGeneratedPassword_warning2'scope="row" style='display:{$smtp_warning_2}';>
171 <i>{if $SMTP_SERVER_NOT_SET} {$MOD.ERR_SMTP_SERVER_NOT_SET}<br>{/if}
172 {$MOD.LBL_EMAIL_ADDRESS_REQUIRED_FOR_FEATURE}</i>
176 <td width="25%" scope="row">{$MOD.LBL_PASSWORD_LINK_EXPIRATION}: {sugar_help text=$MOD.LBL_PASSWORD_LINK_EXPIRATION_HELP WIDTH=400}</td>
178 <table width="100%" border="0" cellspacing="0" cellpadding="0" id="forgot_password_table">
181 {assign var='linkexptime' value=''}
182 {assign var='linkexpnone' value=''}
183 {if ($config.passwordsetting.linkexpiration) == '0'}
184 {assign var='linkexpnone' value='CHECKED'}
186 {if ($config.passwordsetting.linkexpiration) == '1'}
187 {assign var='linkexptime' value='CHECKED'}
190 <input type="radio" name="passwordsetting_linkexpiration" value='0' {$linkexpnone} onclick="form.passwordsetting_linkexpirationtime.value='';">
194 <input type="radio" name="passwordsetting_linkexpiration" id="required_link_exp_time" value='1' {$linkexptime}>
195 {$MOD.LBL_PASSWORD_LINK_EXP_IN}
196 {assign var='ldays' value=''}
197 {assign var='lweeks' value=''}
198 {assign var='lmonths' value=''}
199 {if ($config.passwordsetting.linkexpirationtype ) == '1'}
200 {assign var='ldays' value='SELECTED'}
202 {if ($config.passwordsetting.linkexpirationtype ) == '60'}
203 {assign var='lweeks' value='SELECTED'}
205 {if ($config.passwordsetting.linkexpirationtype ) == '1440'}
206 {assign var='lmonths' value='SELECTED'}
208 <input type='text' maxlength="3" and style="width:2em" name='passwordsetting_linkexpirationtime' value='{$config.passwordsetting.linkexpirationtime}'>
209 <SELECT NAME="passwordsetting_linkexpirationtype">
210 <OPTION VALUE='1' {$ldays}>{$MOD.LBL_MINUTES}
211 <OPTION VALUE='60' {$lweeks}>{$MOD.LBL_HOURS}
212 <OPTION VALUE='1440' {$lmonths}>{$MOD.LBL_DAYS}
222 {if !empty($settings.captcha_on) || !($VALID_PUBLIC_KEY)}
223 {assign var='captcha_checked' value='CHECKED'}
225 {assign var='captcha_checked' value=''}
227 <td width="25%" scope="row">{$MOD.ENABLE_CAPTCHA}: {sugar_help text=$MOD.LBL_CAPTCHA_HELP_TEXT WIDTH=400}</td>
228 <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>
231 <table width="100%" border="0" cellspacing="0" cellpadding="0">
234 <div id="captcha_config_display" style="display:{$CAPTCHA_CONFIG_DISPLAY}">
235 <table width="100%" cellpadding="0" cellspacing="0">
237 <td width="10%" scope="row">{$MOD.LBL_PUBLIC_KEY}<span class="required">*</span></td>
238 <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>
239 <td width="10%" scope="row">{$MOD.LBL_PRIVATE_KEY}<span class="required">*</span></td>
240 <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>
246 {if !($VALID_PUBLIC_KEY)}
247 <tr><td scope="row"><span class='error'>{$MOD.ERR_PUBLIC_CAPTCHA_KEY}</span></td></tr>
254 <table id="emailTemplatesId" name="emailTemplatesName" width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
256 <th align="left" scope="row" colspan="4">
258 {$MOD.LBL_PASSWORD_TEMPLATE}
264 <td scope="row" width="35%">{$MOD.LBL_PASSWORD_GENERATE_TEMPLATE_MSG}: </td>
267 <select tabindex='251' id="generatepasswordtmpl" name="passwordsetting_generatepasswordtmpl" {$IE_DISABLED}>{$TMPL_DRPDWN_GENERATE}</select>
268 <input type="button" class="button" onclick="javascript:open_email_template_form('generatepasswordtmpl')" value="{$MOD.LBL_PASSWORD_CREATE_TEMPLATE}" {$IE_DISABLED}>
269 <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}">
276 <td scope="row">{$MOD.LBL_PASSWORD_LOST_TEMPLATE_MSG}: </td>
279 <select tabindex='251' id="lostpasswordtmpl" name="passwordsetting_lostpasswordtmpl" {$IE_DISABLED}>{$TMPL_DRPDWN_LOST}</select>
280 <input type="button" class="button" onclick="javascript:open_email_template_form('lostpasswordtmpl')" value="{$MOD.LBL_PASSWORD_CREATE_TEMPLATE}" {$IE_DISABLED}>
281 <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}">
290 {if !empty($settings.system_ldap_enabled)}
291 {assign var='system_ldap_enabled_checked' value='CHECKED'}
292 {assign var='ldap_display' value='inline'}
294 {assign var='system_ldap_enabled_checked' value=''}
295 {assign var='ldap_display' value='none'}
297 <table id='ldap_table' width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
300 <table width="100%" border="0" cellspacing="0" cellpadding="0">
302 <th align="left" scope="row" colspan='3'><h4>{$MOD.LBL_LDAP_TITLE}</h4></th>
305 <td width="25%" scope="row" valign='middle'>
306 {$MOD.LBL_LDAP_ENABLE}{sugar_help text=$MOD.LBL_LDAP_HELP_TXT}
307 </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>
310 <table cellspacing='0' cellpadding='1' id='ldap_display' style='display:{$ldap_display}' width='100%'>
312 <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}
313 <td width='25%' align="left" valign='top'><input name="ldap_hostname" size='25' type="text" value="{$settings.ldap_hostname}"></td>
314 <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}
315 <td width='25%' align="left" valign='top' ><input name="ldap_port" size='6' type="text" value="{$settings.ldap_port}"></td>
318 <td scope="row" valign='middle' nowrap>{$MOD.LBL_LDAP_USER_DN} {sugar_help text=$MOD.LBL_LDAP_USER_DN_DESC}</td>
319 <td align="left" valign='middle'><input name="ldap_base_dn" size='35' type="text" value="{$settings.ldap_base_dn}"></td>
320 <td scope="row" valign='middle' nowrap>{$MOD.LBL_LDAP_USER_FILTER} {sugar_help text=$MOD.LBL_LDAP_USER_FILTER_DESC}</td>
321 <td align="left" valign='middle'><input name="ldap_login_filter" size='25' type="text" value="{$settings.ldap_login_filter}"></td>
324 <td scope="row" valign='top' nowrap>{$MOD.LBL_LDAP_BIND_ATTRIBUTE} {sugar_help text=$MOD.LBL_LDAP_BIND_ATTRIBUTE_DESC}</td>
325 <td align="left" valign='top'><input name="ldap_bind_attr" size='25' type="text" value="{$settings.ldap_bind_attr}"> </td>
326 <td scope="row" valign='middle' nowrap>{$MOD.LBL_LDAP_LOGIN_ATTRIBUTE} {sugar_help text=$MOD.LBL_LDAP_LOGIN_ATTRIBUTE_DESC}</td>
327 <td align="left" valign='middle'><input name="ldap_login_attr" size='25' type="text" value="{$settings.ldap_login_attr}"></td>
330 <td scope="row" valign='top'nowrap>{$MOD.LBL_LDAP_GROUP_MEMBERSHIP} {sugar_help text=$MOD.LBL_LDAP_GROUP_MEMBERSHIP_DESC}</td>
331 <td align="left" valign='top'>
332 {if !empty($settings.ldap_group)}
333 {assign var='ldap_group_checked' value='CHECKED'}
334 {assign var='ldap_group_display' value=''}
336 {assign var='ldap_group_checked' value=''}
337 {assign var='ldap_group_display' value='none'}
339 <input name="ldap_group_checkbox" class="checkbox" type="checkbox" {$ldap_group_checked} onclick='toggleDisplay("ldap_group")'>
341 <td valign='middle' nowrap></td>
342 <td align="left" valign='middle'></td>
347 <span id='ldap_group' style='display:{$ldap_group_display}'>
350 <td width='25%' scope="row" valign='top'nowrap>{$MOD.LBL_LDAP_GROUP_DN} {sugar_help text=$MOD.LBL_LDAP_GROUP_DN_DESC}</td>
351 <td width='25%' align="left" valign='top'><input name="ldap_group_dn" size='20' type="text" value="{$settings.ldap_group_dn}"></td>
352 <td width='25%' scope="row" valign='top'nowrap>{$MOD.LBL_LDAP_GROUP_NAME} {sugar_help text=$MOD.LBL_LDAP_GROUP_NAME_DESC}</td>
353 <td width='25%' align="left" valign='top'><input name="ldap_group_name" size='20' type="text" value="{$settings.ldap_group_name}"></td>
356 <td scope="row" valign='top' nowrap>{$MOD.LBL_LDAP_GROUP_USER_ATTR} {sugar_help text=$MOD.LBL_LDAP_GROUP_USER_ATTR_DESC}</td>
357 <td align="left" valign='top'><input name="ldap_group_user_attr" size='20' type="text" value="{$settings.ldap_group_user_attr}"> </td>
358 <td scope="row" valign='top' nowrap>{$MOD.LBL_LDAP_GROUP_ATTR} {sugar_help text=$MOD.LBL_LDAP_GROUP_ATTR_DESC}</td>
359 <td align="left" valign='top'><input name="ldap_group_attr" size='20' type="text" value="{$settings.ldap_group_attr}"> </td>
367 <td scope="row" valign='top'nowrap>{$MOD.LBL_LDAP_AUTHENTICATION} {sugar_help text=$MOD.LBL_LDAP_AUTHENTICATION_DESC}</td>
368 <td align="left" valign='top' >
369 {if !empty($settings.ldap_authentication)}
370 {assign var='ldap_authentication_checked' value='CHECKED'}
371 {assign var='ldap_authentication_display' value=''}
373 {assign var='ldap_authentication_checked' value=''}
374 {assign var='ldap_authentication_display' value='none'}
376 <input name="ldap_authentication_checkbox" class="checkbox" type="checkbox" {$ldap_authentication_checked} onclick='toggleDisplay("ldap_authentication")'>
378 <td valign='middle' nowrap></td>
379 <td align="left" valign='middle'></td>
384 <span id='ldap_authentication' style='display:{$ldap_authentication_display}'>
385 <table width='100%' >
387 <td width='25%' scope="row" valign='top'nowrap>{$MOD.LBL_LDAP_ADMIN_USER} {sugar_help text=$MOD.LBL_LDAP_ADMIN_USER_DESC}</td>
388 <td width='25%' align="left" valign='top'><input name="ldap_admin_user" size='20' type="text" value="{$settings.ldap_admin_user}"></td>
389 <td width='25%' scope="row" valign='middle' nowrap>{$MOD.LBL_LDAP_ADMIN_PASSWORD}</td>
390 <td width='25%' align="left" valign='middle'><input name="ldap_admin_password" size='20' type="password" value="{$settings.ldap_admin_password}"> </td>
398 <td scope="row" valign='top' nowrap>{$MOD.LBL_LDAP_AUTO_CREATE_USERS} {sugar_help text=$MOD.LBL_LDAP_AUTO_CREATE_USERS_DESC}</td>
399 {if !empty($settings.ldap_auto_create_users)}
400 {assign var='ldap_auto_create_users_checked' value='CHECKED'}
402 {assign var='ldap_auto_create_users_checked' value=''}
404 <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>
405 <td valign='middle' nowrap></td>
406 <td align="left" valign='middle'></td>
409 <td scope="row" valign='middle' nowrap>{$MOD.LBL_LDAP_ENC_KEY} {sugar_help text=$LDAP_ENC_KEY_DESC}</td>
410 <td align="left" valign='middle'><input name="ldap_enc_key" size='35' type="password" value="{$settings.ldap_enc_key}" {$LDAP_ENC_KEY_READONLY}> </td>
411 <td valign='middle' nowrap></td>
412 <td align="left" valign='middle'></td>
423 {if !empty($config.authenticationClass) && $config.authenticationClass === 'SAMLAuthenticate'}
424 {assign var='saml_enabled_checked' value='CHECKED'}
425 {assign var='saml_display' value='inline'}
427 {assign var='saml_enabled_checked' value=''}
428 {assign var='saml_display' value='none'}
431 <table id = 'saml_table' width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
434 <table width="100%" border="0" cellspacing="0" cellpadding="0">
436 <th align="left" scope="row" colspan='3'><h4>{$MOD.LBL_SAML_TITLE}</h4></th>
439 <td width="25%" scope="row" valign='middle'>
440 {$MOD.LBL_SAML_ENABLE}{sugar_help text=$MOD.LBL_SAML_HELP_TXT}
441 </td><td valign='middle'>
443 <input name="authenticationClass" id="system_saml_enabled" class="checkbox"
444 value="SAMLAuthenticate" type="checkbox"
445 {if $saml_enabled_checked}checked="1"{/if}
446 onclick='toggleDisplay("saml_display");enableDisablePasswordTable("system_saml_enabled");'>
447 </td><td> </td><td> </td></tr>
450 <table cellspacing='0' cellpadding='1' id='saml_display' style='display:{$saml_display}' width='100%'>
452 <td scope="row" valign='middle' nowrap>{$MOD.LBL_SAML_LOGIN_URL} {sugar_help text=$MOD.LBL_SAML_LOGIN_URL_DESC}</td>
453 <td align="left" valign='middle'><input name="SAML_loginurl" size='35' type="text" value="{$config.SAML_loginurl}"></td>
457 <td width='25%' scope="row" valign='top' nowrap>{$MOD.LBL_SAML_CERT} {sugar_help text=$MOD.LBL_SAML_CERT_DESC}</td>{$settings.proxy_host}
458 <td width='25%' align="left" valign='top'><textarea style='height:200px;width:600px' name="SAML_X509Cert" >{$config.SAML_X509Cert}</textarea></td>
473 <div style="padding-top: 2px;">
474 <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}" />
475 <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}" />
488 {if !($VALID_PUBLIC_KEY)}
490 document.getElementById('captcha_public_key').focus();
491 document.getElementById('captcha_id').checked=true;
492 document.getElementById('forgotpassword_checkbox').checked=true;
499 function addcheck(form){{/literal}
500 addForm('ConfigurePasswordSettings');
503 if(document.getElementById('forgotpassword_checkbox').checked){literal}{{/literal}
504 addToValidate('ConfigurePasswordSettings', 'passwordsetting_linkexpirationtime', 'int', form.required_link_exp_time.checked,"{$MOD.ERR_PASSWORD_LINK_EXPIRE_TIME} ");
507 if(document.getElementById('SystemGeneratedPassword_checkbox').checked){literal}{{/literal}
508 addToValidate('ConfigurePasswordSettings', 'passwordsetting_systexpirationtime', 'int', form.required_sys_pwd_exp_time.checked,"{$MOD.ERR_PASSWORD_EXPIRE_TIME}" );
509 addToValidate('ConfigurePasswordSettings', 'passwordsetting_systexpirationlogin', 'int', form.required_sys_pwd_exp_login.checked,"{$MOD.ERR_PASSWORD_EXPIRE_LOGIN}" );
516 function open_email_template_form(fieldToSet) {
517 fieldToSetValue = fieldToSet;
518 URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
519 windowName = 'email_template';
520 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
522 win = window.open(URL, windowName, windowFeatures);
525 // put the focus on the popup if the browser supports the focus() method
530 function enableDisablePasswordTable(checkbox_id) {
531 var other = checkbox_id == "system_saml_enabled" ? "ldap_table" : "saml_table";
532 var enabled = document.getElementById(checkbox_id).checked;
534 document.getElementById("emailTemplatesId").style.display = "none";
535 document.getElementById("sysGeneratedId").style.display = "none";
536 document.getElementById("userResetPassId").style.display = "none";
538 document.getElementById("emailTemplatesId").style.display = "";
539 document.getElementById("sysGeneratedId").style.display = "";
540 document.getElementById("userResetPassId").style.display = "";
545 function edit_email_template_form(templateField) {
546 fieldToSetValue = templateField;
547 var field=document.getElementById(templateField);
548 URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
549 if (field.options[field.selectedIndex].value != 'undefined') {
550 URL+="&record="+field.options[field.selectedIndex].value;
552 windowName = 'email_template';
553 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
555 win = window.open(URL, windowName, windowFeatures);
558 // put the focus on the popup if the browser supports the focus() method
563 function refresh_email_template_list(template_id, template_name) {
564 var field=document.getElementById(fieldToSetValue);
566 for (var i=0; i < field.options.length; i++) {
567 if (field.options[i].value == template_id) {
568 if (field.options[i].selected==false) {
569 field.options[i].selected=true;
571 field.options[i].text = template_name;
575 //add item to selection list.
577 var newElement=document.createElement('option');
578 newElement.text=template_name;
579 newElement.value=template_id;
580 field.options.add(newElement);
581 newElement.selected=true;
584 //enable the edit button.
585 var editButtonName = 'edit_generatepasswordtmpl';
586 if (fieldToSetValue == 'generatepasswordtmpl') {
587 editButtonName = 'edit_lostpasswordtmpl';
589 var field1=document.getElementById(editButtonName);
590 field1.style.visibility="visible";
592 var applyListToTemplateField = 'generatepasswordtmpl';
593 if (fieldToSetValue == 'generatepasswordtmpl') {
594 applyListToTemplateField = 'lostpasswordtmpl';
596 var field=document.getElementById(applyListToTemplateField);
598 for (var i=0; i < field.options.length; i++) {
599 if (field.options[i].value == template_id) {
600 field.options[i].text = template_name;
605 var newElement=document.createElement('option');
606 newElement.text=template_name;
607 newElement.value=template_id;
608 field.options.add(newElement);
613 function testregex(customregex)
617 var string = 'hello';
618 string.match(customregex.value);
622 alert(SUGAR.language.get("Administration", "ERR_INCORRECT_REGEX"));
623 setTimeout("document.getElementById('customregex').select()",10);
626 function toggleDisplay_2(id){
628 if(this.document.getElementById(id).style.display=='none'){
629 this.document.getElementById(id).style.display='';
630 this.document.getElementById(id+"_lbl").innerHTML='{/literal}{$MOD.LBL_HIDE_ADVANCED_OPTIONS}{literal}';
631 this.document.getElementById("regex_config_display_img").src = '{/literal}{sugar_getimagepath file="basic_search.gif"}{literal}';
633 this.document.getElementById(id).style.display='none'
634 this.document.getElementById(id+"_lbl").innerHTML='{/literal}{$MOD.LBL_SHOW_ADVANCED_OPTIONS}{literal}';
635 this.document.getElementById("regex_config_display_img").src = '{/literal}{sugar_getimagepath file="advanced_search.gif"}{literal}';
639 function forgot_password_enable(check){
640 var table_fields=document.getElementById('forgot_password_table');
641 var forgot_password_input=table_fields.getElementsByTagName('input');
642 var forgot_password_select=table_fields.getElementsByTagName('select');
644 for (i=0;i<forgot_password_input.length;i++)
645 forgot_password_input[i].disabled='';
646 for (j=0;j<forgot_password_select.length;j++)
647 forgot_password_select[j].disabled='';
648 document.ConfigurePasswordSettings.captcha_on[1].disabled='';
651 document.ConfigurePasswordSettings.captcha_on[1].disabled='disabled';
652 document.ConfigurePasswordSettings.captcha_on[1].checked='';
653 document.getElementById("captcha_config_display").style.display='none';
654 for (i=0;i<forgot_password_input.length;i++)
655 forgot_password_input[i].disabled='disabled';
656 for (j=0;j<forgot_password_select.length;j++)
657 forgot_password_select[j].disabled='disabled';
661 function enable_syst_generated_pwd(check){
662 var table_fields=document.getElementById('syst_generated_pwd_table');
663 var syst_generated_pwd_input=table_fields.getElementsByTagName('input');
664 var syst_generated_pwd_select=table_fields.getElementsByTagName('select');
666 for (i=0;i<syst_generated_pwd_input.length;i++)
667 syst_generated_pwd_input[i].disabled='';
668 for (j=0;j<syst_generated_pwd_select.length;j++)
669 syst_generated_pwd_select[j].disabled='';
672 for (i=0;i<syst_generated_pwd_input.length;i++)
673 syst_generated_pwd_input[i].disabled='disabled';
674 for (j=0;j<syst_generated_pwd_select.length;j++)
675 syst_generated_pwd_select[j].disabled='disabled';
678 forgot_password_enable(document.getElementById('forgotpassword_checkbox'));
679 enable_syst_generated_pwd(document.getElementById('SystemGeneratedPassword_checkbox'));
680 if(document.getElementById('system_saml_enabled').checked)enableDisablePasswordTable('system_saml_enabled');
681 if(document.getElementById('system_ldap_enabled').checked)enableDisablePasswordTable('system_ldap_enabled');