forked from Wavyzz/dolibarr
Factorize code into a function dolJSToSetRandomPassword()
This commit is contained in:
@@ -129,22 +129,11 @@ dol_print_cron_urls();
|
||||
|
||||
print '<br>';
|
||||
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print "\n".'<script type="text/javascript">';
|
||||
print '$(document).ready(function () {
|
||||
$("#generate_token").click(function() {
|
||||
console.log("Click done");
|
||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
|
||||
action: \'getrandompassword\',
|
||||
generic: true
|
||||
},
|
||||
function(token) {
|
||||
$("#CRON_KEY").val(token);
|
||||
});
|
||||
});
|
||||
});';
|
||||
print '</script>';
|
||||
}
|
||||
$constname = 'CRON_KEY';
|
||||
|
||||
// Add button to autosuggest a key
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
print dolJSToSetRandomPassword($constname);
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
Reference in New Issue
Block a user