Jump to content

Remove 0, O, I, l from Auto generated password for Service


Synister

Recommended Posts

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....

there is a third version of the hook, but that won't be relevant for your situation.

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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 😥

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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)]);
});

.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated