Password generator - v.1.3.0

Copyright © PHP-Fusion Inc
Version: 9.10.30 - Released: 2022/09/01

Copyright đ Fusion.BltFM
Version: 1.3.0 - Released: 2022/11/01
-=Description=-

With this modification, a “Password generator” window was added to the password field, which can be used to generate a strong, long password. It is possible to specify how long the password should be, with a length of 8-64 characters and containing only characters allowed by the PHP-Fusion system. The generated password is automatically copied to the clipboard and into the appropriate password fields.

To use the add-on, it is necessary to modify the following PHP-Fusion Core files:

1. /includes/api/index.php

2. /includes/dynamics/includes/form_text.php

3. /locale/Hungarian/user_fields.php

The package contains the PHP-Fusion 9.10.30 files listed above, on which I made the necessary modifications. If these files do not contain modifications, i.e. original Core files, then all you have to do is copy the contents of the Files and Core-Mod_Files folders. If the files do not match the PHP-Fusion 9.10.30 Core files, then the “Installation” Follow the steps described in point 2.

tested on version v9.10.30.

If you have any questions, contact me here https://fusion.bltfm.hu/ on the license page.

Copyright đ 2022 Fusion.BltFM.hu reserves the right to change.

-=Installation=-

INSTALLING A NEW SYSTEM

1. Upload the contents of the Files and Core-Mod_Files folders to the main server directory. /eg: public_html, www_root/ and you're done.

If you want to modify the Core files, do not copy the contents of the Core-Mod_Files folder, but perform the steps described in point 2.

2. If you want to modify the Core files, open the following files for editing

I marked changes with this /* BltFMHU MOD _PASSWORD_GENERATOR */

/includes/api/index.php

Look for this

$endpoints = [
        "username-check" => "username_validation.php",
        "userpass-check" => "userpass_validation.php",
        'calling-codes'  => 'calling_codes.php', //get
        'geomap-states'  => 'states.php' //get
    ]
    + get_extended_endpoints();

Replace this with

$endpoints = [
        "username-check" => "username_validation.php",
        "userpass-check" => "userpass_validation.php",
        'calling-codes'  => 'calling_codes.php', //get
        'geomap-states'  => 'states.php', //get
        'password-generator' => 'password_generator.inc.php' /* BltFMHU MOD _PASSWORD_GENERATOR */
    ]
    + get_extended_endpoints();

/includes/dynamics/includes/form_text.php

Look for this


'password_toggle'    => TRUE,
'descript'           => TRUE,

Replace this with


'password_toggle'    => TRUE,
'password_generator'    => TRUE, /* BltFMHU MOD _PASSWORD_GENERATOR */
'descript'           => TRUE,

Look for this


break;
        default:
            $input_type = "text";

Copy this in front


				/* BltFMHU MOD _PASSWORD_GENERATOR */
				if ($options['password_generator'] == TRUE) {
					if ($options['input_id'] == 'user_password1' || $options['input_id'] == 'user_admin_password1') {

						$pw_gen_modal = openmodal('pwgen_modal', $locale['pwdgen00'], ['button_id' => 'modal_pwgen']);
						$pw_gen_modal .= $locale['pwdgen01'];
						$pw_gen_modal .= "<br><br>".form_button('pwd_use', $locale['pwdgen02'], 'pwd_use', ['type' => 'button', 'class' => 'btn-default']);
						$pw_gen_modal .= form_button('pwd_no', $locale['pwdgen03'], 'pwd_no', ['type' => 'button', 'class' => 'btn-default']);
						$pw_gen_modal .= modalfooter("
						<div style='position: absolute;left:0;bottom: 0;padding: 5px;'>
						<a href='https://fusion.bltfm.hu/' title='".$locale['pwdgen04']."' target='_blank'><img src='".INCLUDES."dynamics/assets/password_generator/pwgen.svg' alt='' style='width: 30px;border: 0px;' /> <span> ".$locale['pwdgen05']." </span></a></div>", TRUE);
						$pw_gen_modal .= closemodal();
						PHPFusion\OutputHandler::addToFooter($pw_gen_modal);

						$pw_gen_use_modal = openmodal('pwgenuse_modal', $locale['pwdgen00'], ['button_id' => 'modal_pwdgenuse']);
						$pw_gen_use_modal .= form_text('pwd_inp', $locale['pwdgen06'], '', 
						['type' => 'text', 'max_length' => 64, 'deactivate' => TRUE, 'append_button' => TRUE, 'append_value' => $locale['pwdgen07'], 'append_button_id' => 'cp_btn', 'append_form_value' => $locale['pwdgen07'], 'append_button_name' => 'cp_btn', 'append_class' => 'btn btn-default', 'append_type' => 'button']);
						$pw_gen_use_modal .= form_checkbox('settings_check', $locale['pwdgen08'], '0', ['type' => 'checkbox', 'toggle' => FALSE]);
						$pw_gen_use_modal .= form_text('pwd_length', $locale['pwdgen09'], '16', ['type' => 'number', 'number_step' => '4', 'number_min' => 8, 'number_max' => 64, 'max_length' => 2, 'class' => 'collapse', 'ext_tip' => 'Min.: 8, Max.: 64']);
						$pw_gen_use_modal .= form_checkbox('pwd_alikes', $locale['pwdgen10'], '0', ['type' => 'checkbox', 'inline' => FALSE, 'toggle' => TRUE, 'class' => 'collapse']);
						$pw_gen_use_modal .= modalfooter("
						<br><div style='position: absolute;left:0;bottom: 0;padding: 5px;'>
						<a href='https://fusion.bltfm.hu/' title='".$locale['pwdgen04']."' target='_blank'><img src='".INCLUDES."dynamics/assets/password_generator/pwgen.svg' alt='' style='width: 30px;border: 0px;' /> <span> ".$locale['pwdgen05']." </span></a></div>"
						.form_checkbox('copy_check', $locale['pwdgen11'], '0', ['type' => 'checkbox', 'required' => TRUE, 'toggle' => FALSE, 'class' => 'row-center text-left'])
						.form_button('pwd_copy', $locale['pwdgen12'], 'pwd_copy', ['deactivate' => TRUE, 'type' => 'button', 'class' => 'btn-default']), TRUE);
						$pw_gen_use_modal .= closemodal();
						PHPFusion\OutputHandler::addToFooter($pw_gen_use_modal);

						// locale file
						if (file_exists(LOCALE.LOCALESET."includes/dynamics/assets/password_generator/lang/".$locale['password_strength'].".js")) {
							$path = LOCALE.LOCALESET."includes/dynamics/assets/password_generator/lang/".$locale['password_strength'].".js";
						} else {
							$path = LOCALE.LOCALESET."includes/dynamics/assets/password_generator/lang/en.js";
						}
						fusion_load_script($path);
						fusion_load_script(INCLUDES.'dynamics/assets/password_generator/pwgen.min.js');

					}
				}
				/* BltFMHU MOD _PASSWORD_GENERATOR END */

/locale/Hungarian/user_fields.php

Look for this

$locale['u303'] = "Password should be at least 8 characters long";

Copy this in below


/* BltFMHU MOD _PASSWORD_GENERATOR */
$locale['pwdgen00'] = "Generate a secure password";
$locale['pwdgen01'] = "The purpose of this page is to generate a secure password so that the user can use a unique, secure password. The displayed password is randomly generated and is not stored on the server side.

Would you like us to generate a secure password?"; $locale['pwdgen02'] = "Yes, password generator"; $locale['pwdgen03'] = "No"; $locale['pwdgen04'] = "v.1.3.0 Fusion.BltFm.hu"; $locale['pwdgen05'] = "v.1.3.0 by ".utf8_encode('đ'); $locale['pwdgen06'] = 'Suggested password'; $locale['pwdgen07'] = "Generator"; $locale['pwdgen08'] = "Settings"; $locale['pwdgen09'] = "Password length"; $locale['pwdgen10'] = "Hide confusing characters [l-I-1] [o-O-0]"; $locale['pwdgen11'] = "I copied the password to a safe place!"; $locale['pwdgen12'] = "Using a password"; /* BltFMHU MOD _PASSWORD_GENERATOR END */
-=Novelty=-

1. A pop-up window instead of a generate button.

2. Setting options. Password length, alikes characters

3. PasswordGen class

-=Corrected=-

1. The script code was removed from the form_text() function, and a .js file was created instead.

-=Picture recommendation=-

password_generator_sample_1.png

password_generator_sample_2.png

-=Change Log=-

1.2.0 - 2022.04.05.

Creating a password generator version 1.2.0.-:)

-=Novelty=-

1. The generated password is automatically copied to the clipboard, so you can immediately save it to a safe place.

-=Corrected=-

1. form_text() function slightly modified, so that the last special character was also included.

1.1.0 - 2022.03.26.

Creating a password generator version 1.1.0.-:)

-=Novelty=-

1. integrated into the form_text() function, so it appears for every password field, it can be turned off if it is not needed.

-=Corrected=-

1. Generated password extended to 16 characters, making the password more secure.

1.0.0 - 2021.12.20.

Creating a password generator version 1.0.0.-:)

Please report any comments or errors. Contact: https://fusion.bltfm.hu
 đ