|
251 | 251 |
|
252 | 252 | if($type == 'getcronplaceholders') { |
253 | 253 |
|
254 | | - $web = $app->db->queryOneRecord("SELECT `domain`, `document_root`, `php_cli_binary` |
255 | | - FROM `web_domain` |
256 | | - LEFT JOIN server_php ON web_domain.server_php_id = server_php.server_php_id |
257 | | - WHERE `domain_id` = ? AND ".$app->tform->getAuthSQL('r'), $web_id); |
| 254 | + $web_docroot_client = ''; |
258 | 255 |
|
| 256 | + if($web_id > 0) { |
| 257 | + $web = $app->db->queryOneRecord("SELECT wd.sys_groupid, wd.domain, wd.document_root, sp.php_cli_binary |
| 258 | + FROM web_domain wd |
| 259 | + LEFT JOIN server_php sp ON wd.server_php_id = sp.server_php_id |
| 260 | + WHERE wd.domain_id = ? AND ".$app->tform->getAuthSQL('r'), $web_id); |
259 | 261 |
|
| 262 | + $php_cli_binary = $web['php_cli_binary']; |
260 | 263 |
|
261 | | - if($cron_type != 'chrooted') { |
262 | | - $web_docroot_client = $web['document_root']; |
263 | | - } else { |
264 | | - $web_docroot_client = ''; |
265 | | - } |
| 264 | + $domain = $web['domain']; |
266 | 265 |
|
267 | | - if(empty($web['php_cli_binary'])) { |
268 | | - $web['php_cli_binary'] = "/usr/bin/php"; |
| 266 | + $domain_owner = $app->db->queryOneRecord("SELECT limit_cron_type FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $web["sys_groupid"]); |
| 267 | + |
| 268 | + //* True when the site is assigned to a client |
| 269 | + if(isset($domain_owner["limit_cron_type"])) { |
| 270 | + if($domain_owner["limit_cron_type"] == 'full') { |
| 271 | + $cron_type = 'full'; |
| 272 | + } else { |
| 273 | + $cron_type = 'chrooted'; |
| 274 | + } |
| 275 | + } else { |
| 276 | + //* True when the site is assigned to the admin |
| 277 | + $cron_type = 'full'; |
| 278 | + } |
| 279 | + |
| 280 | + if($cron_type != 'chrooted') { |
| 281 | + $web_docroot_client = $web['document_root']; |
| 282 | + } |
269 | 283 | } |
270 | 284 |
|
271 | 285 | $web_docroot_client .= '/web'; |
272 | 286 |
|
| 287 | + if(empty($web['php_cli_binary'])) { |
| 288 | + $php_cli_binary = "/usr/bin/php"; |
| 289 | + } |
| 290 | + |
273 | 291 | $json = json_encode(array( |
274 | | - 'php_cli_binary' => $web['php_cli_binary'], |
| 292 | + 'php_cli_binary' => $php_cli_binary, |
275 | 293 | 'docroot_client' => $web_docroot_client, |
276 | | - 'domain' => $web['domain'] |
| 294 | + //'cron_type' => $cron_type, |
| 295 | + 'domain' => $domain |
277 | 296 | )); |
278 | | - |
279 | | - |
280 | | - |
281 | 297 | } |
282 | 298 |
|
283 | 299 | header('Content-type: application/json'); |
|
0 commit comments