|
1 | 1 | <?php |
2 | 2 | // Init |
3 | | -error_reporting(NULL); |
4 | | -ob_start(); |
| 3 | +//error_reporting(NULL); |
| 4 | +//ob_start(); |
5 | 5 | session_start(); |
6 | 6 | $TAB = 'SERVER'; |
7 | 7 |
|
|
333 | 333 | if (empty($_SESSION['error_msg'])) { |
334 | 334 | $_SESSION['ok_msg'] = __('Changes has been saved.'); |
335 | 335 | } |
| 336 | + |
| 337 | + // activating sftp licence |
| 338 | + if (empty($_SESSION['error_msg'])) { |
| 339 | + if($_SESSION['SFTP_KEY'] != $_POST['v_sftp_licence'] && $_POST['v_sftp'] == 'yes'){ |
| 340 | + $module = 'sftpjail'; |
| 341 | + $licence_key = escapeshellarg($_POST['v_sftp_licence']); |
| 342 | + exec (VESTA_CMD."v-activate-vesta-license ".$module." ".$licence_key, $output, $return_var); |
| 343 | + check_return_code($return_var,$output); |
| 344 | + unset($output); |
| 345 | + if (empty($_SESSION['error_msg'])) { |
| 346 | + $_SESSION['ok_msg'] = __('Licence Activated'); |
| 347 | + $_SESSION['SFTP_KEY'] = $_POST['v_sftp_licence']; |
| 348 | + } |
| 349 | + } |
| 350 | + } |
| 351 | + |
| 352 | + // cancel sftp licence |
| 353 | + if (empty($_SESSION['error_msg'])) { |
| 354 | + if($_POST['v_sftp'] == 'cancel' && $_SESSION['SFTP_KEY']){ |
| 355 | + $module = 'sftpjail'; |
| 356 | + $licence_key = escapeshellarg($_SESSION['SFTP_KEY']); |
| 357 | + exec (VESTA_CMD."v-deactivate-vesta-license ".$module." ".$licence_key, $output, $return_var); |
| 358 | + check_return_code($return_var,$output); |
| 359 | + unset($output); |
| 360 | + if (empty($_SESSION['error_msg'])) { |
| 361 | + $_SESSION['ok_msg'] = __('Licence Deactivated'); |
| 362 | + unset($_SESSION['SFTP_KEY']); |
| 363 | + } |
| 364 | + } |
| 365 | + } |
| 366 | + |
| 367 | + |
| 368 | + // activating filemanager licence |
| 369 | + if (empty($_SESSION['error_msg'])) { |
| 370 | + if($_SESSION['FILEMANAGER_KEY'] != $_POST['v_filemanager_licence'] && $_POST['v_filemanager'] == 'yes'){ |
| 371 | + $module = 'filemanager'; |
| 372 | + $licence_key = escapeshellarg($_POST['v_filemanager_licence']); |
| 373 | + exec (VESTA_CMD."v-activate-vesta-license ".$module." ".$licence_key, $output, $return_var); |
| 374 | + check_return_code($return_var,$output); |
| 375 | + unset($output); |
| 376 | + if (empty($_SESSION['error_msg'])) { |
| 377 | + $_SESSION['ok_msg'] = __('Licence Activated'); |
| 378 | + $_SESSION['FILEMANAGER_KEY'] = $_POST['v_filemanager_licence']; |
| 379 | + } |
| 380 | + } |
| 381 | + } |
| 382 | + |
| 383 | + // cancel filemanager licence |
| 384 | + if (empty($_SESSION['error_msg'])) { |
| 385 | + if($_POST['v_filemanager'] == 'cancel' && $_SESSION['FILEMANAGER_KEY']){ |
| 386 | + $module = 'filemanager'; |
| 387 | + $licence_key = escapeshellarg($_SESSION['FILEMANAGER_KEY']); |
| 388 | + exec (VESTA_CMD."v-deactivate-vesta-license ".$module." ".$licence_key, $output, $return_var); |
| 389 | + check_return_code($return_var,$output); |
| 390 | + unset($output); |
| 391 | + if (empty($_SESSION['error_msg'])) { |
| 392 | + $_SESSION['ok_msg'] = __('Licence Deactivated'); |
| 393 | + unset($_SESSION['FILEMANAGER_KEY']); |
| 394 | + } |
| 395 | + } |
| 396 | + } |
336 | 397 | } |
337 | 398 |
|
338 | 399 | // Check system configuration |
|
0 commit comments