| | |
| | | } |
| | | |
| | | //* get data from web |
| | | $parent_domain = $app->db->queryOneRecord("SELECT `domain_id`, `system_user`, `system_group`, `document_root`, `domain` FROM `web_domain` WHERE `domain_id` = ".intval($data["new"]["parent_domain_id"])); |
| | | $parent_domain = $app->db->queryOneRecord("SELECT `domain_id`, `system_user`, `system_group`, `document_root`, `domain` FROM `web_domain` WHERE `domain_id` = ?", $data["new"]["parent_domain_id"]); |
| | | if(!$parent_domain["domain_id"]) { |
| | | $app->log("Parent domain not found", LOGLEVEL_WARN); |
| | | return 0; |
| | | } elseif($parent_domain["system_user"] == 'root' or $parent_domain["system_group"] == 'root') { |
| | | $app->log("Websites (and Crons) cannot be owned by the root user or group.", LOGLEVEL_WARN); |
| | | return 0; |
| | | } |
| | | |
| | | if(!$app->system->is_allowed_user($parent_domain['system_user'], true, true) |
| | | || !$app->system->is_allowed_group($parent_domain['system_group'], true, true)) { |
| | | $app->log("Websites (and Crons) cannot be owned by the root user or group.", LOGLEVEL_WARN); |
| | | return false; |
| | | } |
| | | |
| | | |
| | | $this->parent_domain = $parent_domain; |
| | | |
| | |
| | | return 0; |
| | | } |
| | | //* get data from web |
| | | $parent_domain = $app->db->queryOneRecord("SELECT `domain_id`, `system_user`, `system_group`, `document_root`, `domain` FROM `web_domain` WHERE `domain_id` = ".intval($data["new"]["parent_domain_id"])); |
| | | $parent_domain = $app->db->queryOneRecord("SELECT `domain_id`, `system_user`, `system_group`, `document_root`, `domain` FROM `web_domain` WHERE `domain_id` = ?", $data["new"]["parent_domain_id"]); |
| | | if(!$parent_domain["domain_id"]) { |
| | | $app->log("Parent domain not found", LOGLEVEL_WARN); |
| | | return 0; |
| | | } elseif($parent_domain["system_user"] == 'root' or $parent_domain["system_group"] == 'root') { |
| | | } |
| | | if(!$app->system->is_allowed_user($parent_domain['system_user'], true, true) |
| | | || !$app->system->is_allowed_group($parent_domain['system_group'], true, true)) { |
| | | $app->log("Websites (and Crons) cannot be owned by the root user or group.", LOGLEVEL_WARN); |
| | | return 0; |
| | | return false; |
| | | } |
| | | |
| | | $app->uses('system'); |
| | |
| | | $web_config = $app->getconf->get_server_config($conf["server_id"], 'web'); |
| | | |
| | | // Get the parent website of this shell user |
| | | $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$this->data['new']['parent_domain_id']); |
| | | $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ?", $this->data['new']['parent_domain_id']); |
| | | |
| | | //* If the security level is set to high |
| | | if($web_config['security_level'] == 20 && is_array($web)) { |