Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add a hosting service with similar domain names. #17

Closed
openarun opened this issue Oct 23, 2021 · 3 comments · Fixed by #18
Closed

Unable to add a hosting service with similar domain names. #17

openarun opened this issue Oct 23, 2021 · 3 comments · Fixed by #18

Comments

@openarun
Copy link

Hi there,

Issue: Unable to add a hosting service when the domain name's initial 7 characters are same.

Expected: Increment the integer at the end if the domain name's initials are same.
eg. mydomainname.com => mydomai0 and mydomain.com => mydomai1 .

LOG:
v-add-user a:2:{s:6:"status";s:5:"false";s:8:"response";s:28:"Error: user mydomai0 exists ";}

@JReissmueller
Copy link
Member

JReissmueller commented Oct 26, 2021

Confirmed. I'll create a task. To resolve, you can update vesta.php around line 1345 from

        if (isset($user['status']) && $user['status']) {
            for ($i = 0; $i < (int) str_repeat(9, $account_matching_characters); $i++) {
                $new_username = substr($username, 0, -strlen($i)) . $i;

                $user = $vesta->getAccountsUsage($new_username);
                if (isset($user['status']) && $user['status']) {
                    $username = $new_username;
                    break;
                }
            }
        }

to

        if (isset($user['status']) && $user['status'] == 'true') {
            for ($i = 0; $i < (int) str_repeat(9, $account_matching_characters); $i++) {
                $new_username = substr($username, 0, -strlen($i)) . $i;

                $user = $vesta->getAccountsUsage($new_username);
                if (isset($user['status']) && $user['status'] == 'false') {
                    $username = $new_username;
                    break;
                }
            }
        }

@JReissmueller
Copy link
Member

@openarun
Copy link
Author

Thanks for quickly rectifying the issue, :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants