active.php 555 B

1234567891011121314151617181920212223
  1. <?php
  2. define('NO_AUTH_REQUIRED',true);
  3. // Main include
  4. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  5. if (isset($_GET['user'])) {
  6. $v_user = escapeshellarg($_GET['user']);
  7. // Get user speciefic parameters
  8. exec (HESTIA_CMD . "v-list-user ".$v_user." json", $output, $return_var);
  9. $data = json_decode(implode('', $output), true);
  10. // Check if 2FA is active
  11. if ($data[$_GET['user']]['TWOFA'] != '') {
  12. header("HTTP/1.0 200 OK");
  13. exit;
  14. } else {
  15. header("HTTP/1.0 404 Not Found");
  16. exit;
  17. }
  18. }