forked from Wavyzz/dolibarr
Factorize code into a function dolJSToSetRandomPassword()
This commit is contained in:
@@ -107,21 +107,11 @@ llxHeader('', $langs->trans("MailingSetup"));
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("MailingSetup"), $linkback, 'title_setup');
|
||||
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print "\n".'<script type="text/javascript">';
|
||||
print '$(document).ready(function () {
|
||||
$("#generate_token").click(function() {
|
||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
|
||||
action: \'getrandompassword\',
|
||||
generic: true
|
||||
},
|
||||
function(token) {
|
||||
$("#MAILING_EMAIL_UNSUBSCRIBE_KEY").val(token);
|
||||
});
|
||||
});
|
||||
});';
|
||||
print '</script>';
|
||||
}
|
||||
$constname = 'MAILING_EMAIL_UNSUBSCRIBE_KEY';
|
||||
|
||||
// Add button to autosuggest a key
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
print dolJSToSetRandomPassword($constname);
|
||||
|
||||
print '<br>';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
Reference in New Issue
Block a user