Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
I
ISPConfig 3
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 485
    • Issues 485
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 23
    • Merge Requests 23
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #4725

Closed
Open
Opened Jul 24, 2017 by Rein van 't Veer@reinvtv

bug in client limits

A reseller should be able to set multiple servers to his clients.

At the moment this it not possible, only one server shows in the client limit edit.

Tested in a clean multi-server dev environment.

What I think is the cause is that a reseller is not an admin in "./lib/classes/custom_datasource.inc.php"

if($_SESSION["s"]["user"]["typ"] == 'user') {
        // Get the limits of the client
        $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
        $sql = "SELECT $server_type as server_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?";
        $client = $app->db->queryOneRecord($sql, $client_group_id);
        if($client['server_id'] > 0) {
                //* Select the default server for the client
                $sql = "SELECT server_id,server_name FROM server WHERE server_id = ?";
                $records = $app->db->queryAllRecords($sql, $client['server_id']);
        } else {
                //* Not able to find the clients defaults, use this as fallback and add a warning message to the log
                $app->log('Unable to find default server for client in custom_datasource.inc.php', 1);
                $sql = "SELECT server_id,server_name FROM server WHERE ?? = 1 AND mirror_server_id = 0 ORDER BY server_name";
                $records = $app->db->queryAllRecords($sql, $field);
        }
} else {
        //* The logged in user is admin, so we show him all available servers of a specific type.
        $sql = "SELECT server_id,server_name FROM server WHERE ?? = 1 AND mirror_server_id = 0 ORDER BY server_name";
        $records = $app->db->queryAllRecords($sql, $field);
}
Edited Jul 24, 2017 by Rein van 't Veer
Assignee
Assign to
3.2
Milestone
3.2
Assign milestone
Time tracking
None
Due date
None
Reference: ispconfig/ispconfig3#4725