Synister Posted December 22, 2020 Share Posted December 22, 2020 Hello, Id like to remove 0, O, I, l from the passwords that are generated for the service.. Is this possible? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 22, 2020 Share Posted December 22, 2020 6 minutes ago, Synister said: Hello, Id like to remove 0, O, I, l from the passwords that are generated for the service.. Is this possible? Kian has some relevant password generator hooks that I think you could slightly tweak for your situation, e.g remove those characters, numbers from the string of available characters and it should generate a password without using them.... https://github.com/Katamaze/WHMCS-Free-Scripts/blob/master/hooks/StrongerPasswordGeneratorForAutoProvisioning_v1.php https://github.com/Katamaze/WHMCS-Free-Scripts/blob/master/hooks/StrongerPasswordGeneratorForAutoProvisioning_v2.php there is a third version of the hook, but that won't be relevant for your situation. 1 Quote Link to comment Share on other sites More sharing options...
Synister Posted December 22, 2020 Author Share Posted December 22, 2020 I have tried v1 and v2 and it doesn't effect the password. I even tried setting it so it only generated 1234567890 to test it and when ran a test account and the Password still had mixed letters. Using 7.10.2 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 22, 2020 Share Posted December 22, 2020 39 minutes ago, Synister said: I have tried v1 and v2 and it doesn't effect the password. I even tried setting it so it only generated 1234567890 to test it and when ran a test account and the Password still had mixed letters. maybe the hook point isn't triggering with the method you're using to create the account - what happens if you use PreModuleCreate instead ? 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted December 23, 2020 Share Posted December 23, 2020 22 hours ago, brian! said: maybe the hook point isn't triggering with the method you're using to create the account - what happens if you use PreModuleCreate instead ? I had to stop using PreModuleCreate for the better 😕 Few weeks ago I realized that this hook point acts weirdly. Yes, it changes the password used for provisioning BUT in the same time stores a different password in tblhosting.password. The only way to make it sure that both password are the same, is via OverrideModuleUsernameGeneration 😥 1 Quote Link to comment Share on other sites More sharing options...
Synister Posted December 27, 2020 Author Share Posted December 27, 2020 On 12/23/2020 at 9:12 AM, Kian said: I had to stop using PreModuleCreate for the better 😕 Few weeks ago I realized that this hook point acts weirdly. Yes, it changes the password used for provisioning BUT in the same time stores a different password in tblhosting.password. The only way to make it sure that both password are the same, is via OverrideModuleUsernameGeneration 😥 How would this be done? Doesn't that just change the Username? 0 Quote Link to comment Share on other sites More sharing options...
Synister Posted December 27, 2020 Author Share Posted December 27, 2020 I tried this and it still does not use only the selected letters for the password  <?php /** * Stronger Password Generator for WHMCS Provisioning v1 * * @package WHMCS * @copyright Katamaze * @link https://katamaze.com * @author Davide Mantenuto <info@katamaze.com> */ use WHMCS\Database\Capsule; add_hook('OverrideModuleUsernameGeneration', 1, function($vars) { $password = substr(str_shuffle('0123456789'), 0, $length = '10'); Capsule::table('tblhosting')->where('id', $vars['params']['serviceid'])->update(['password' => Encrypt($password)]); }); . 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.