About email hosting

General discussions around KeyHelp.
Post Reply
User avatar
saviorhost
Posts: 59
Joined: Sun 11. Jan 2026, 13:51
Location: Turkiye
Contact:

About email hosting

Post by saviorhost »

I plan to start selling email hosting soon. However, I am not sure if it is possible to set up a section in KeyHelp where I can create only email accounts. Could you help me with this?
User avatar
Alexander
Keyweb AG
Posts: 4957
Joined: Wed 20. Jan 2016, 02:23

Re: About email hosting

Post by Alexander »

Hello,

you can just remove all permissions you don't need for your users (User Administration -> Tab Resources + Permissions) and keep only the email permissions.

Additionally, you can hide navigation elements you don't need with the white-label feature.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
amarc
Posts: 59
Joined: Thu 7. May 2020, 18:56

Re: About email hosting

Post by amarc »

+1 for option of adjusting each users visible menu items without whitelabel hacks. Maybe I want user A to have Webmail in sidebar but not user B etc, etc..

In my experience removing item ID X for user removes something completely different for admin (same ID but different item).

Or am I doing this in wrong way.
User avatar
Alexander
Keyweb AG
Posts: 4957
Joined: Wed 20. Jan 2016, 02:23

Re: About email hosting

Post by Alexander »

Below the JS code for your needs. It should be self-explanatory. You just need to adjust the content of the arrays below "Configuration".

Code: Select all

$(function () {
    // --- Configuration ---------------------------------------------------

    // Users the restrictions apply to
    var restrictedUsers = [
        'my-username-1',
        'my-username-2'
    ];

    // Whole menu groups (value of data-group)
    var removeGroups = [
        'resources'
    ];

    // Single menu entries, matched by a substring of the href
    var removeLinks = [
        'page=whois'
    ];

    // --- Logic -----------------------------------------------------------

    var currentUser = $('#app-user-menu-toggle ul.horizontal-separated-list li')
        .last()
        .text()
        .trim();

    if ($.inArray(currentUser, restrictedUsers) === -1) {
        return;
    }

    var $nav = $('#sidebar-navigation');

    // Remove groups
    $.each(removeGroups, function (i, group) {
        $nav.find('.menu-label[data-group="' + group + '"]')
            .closest('.app-menu-group')
            .remove();
    });

    // Remove single entries
    $.each(removeLinks, function (i, needle) {
        $nav.find('.menu-list a').filter(function () {
            return ($(this).attr('href') || '').indexOf(needle) !== -1;
        }).closest('li').remove();
    });

    // Clean up groups that have no entries left
    $nav.find('.app-menu-group').each(function () {
        if ($(this).find('.menu-list li').length === 0) {
            $(this).remove();
        }
    });
});
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
amarc
Posts: 59
Joined: Thu 7. May 2020, 18:56

Re: About email hosting

Post by amarc »

Thanks but it does not work for me. I copy/pasted your code into Whitelabel > All languages > Additional JS and I adjusted

Code: Select all

 'my-username-1'
'my-username-2'
part.. Expecting Link "Whois" and whole "Resources" section to be invisible.. But it's still there when logging in as these 2 users
User avatar
Alexander
Keyweb AG
Posts: 4957
Joined: Wed 20. Jan 2016, 02:23

Re: About email hosting

Post by Alexander »

I missed a comma to separate the two example records.

Code: Select all

        'my-username-1',
        'my-username-2'
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
amarc
Posts: 59
Joined: Thu 7. May 2020, 18:56

Re: About email hosting

Post by amarc »

Great, that works :)

Now, I get it for page=XYZ but how about Database Web Interface under "Tools" that is just link to /db/ ?
User avatar
Alexander
Keyweb AG
Posts: 4957
Joined: Wed 20. Jan 2016, 02:23

Re: About email hosting

Post by Alexander »

This will get removed, when the user has no right to create databases - just set Databases to zero.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Post Reply