diff --git a/pages/security.php b/pages/security.php index b941e80..c4ec88a 100644 --- a/pages/security.php +++ b/pages/security.php @@ -16,6 +16,7 @@ $user = new User($_SESSION['uid']);
get("change password"); ?>
+
" /> " /> @@ -75,7 +76,7 @@ $user = new User($_SESSION['uid']); $codesecret = $totp->getSecret(); $chunk_secret = trim(chunk_split($codesecret, 4, ' ')); ?> - +
get("scan 2fa qrcode") ?>
diff --git a/pages/sync.php b/pages/sync.php index 3769766..61d1a2b 100644 --- a/pages/sync.php +++ b/pages/sync.php @@ -15,36 +15,35 @@ if (!empty($_GET['delsynccode'])) { } ?>
-
+
get("sync mobile"); ?>
-
- has("mobile_codes", ["AND" => ["uid" => $_SESSION['uid'], "codeid" => $_GET['showsynccode']]])) { - $code = $database->get("mobile_codes", 'code', ["AND" => ["uid" => $_SESSION['uid'], "codeid" => $_GET['showsynccode']]]); - } else { - $code = strtoupper(substr(md5(mt_rand() . uniqid("", true)), 0, 20)); - $desc = htmlspecialchars($_POST['desc']); - $database->insert('mobile_codes', ['uid' => $_SESSION['uid'], 'code' => $code, 'description' => $desc]); - } - if (strpos(URL, "http") !== FALSE) { - $url = URL . "mobile/index.php"; - } else { - $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . (($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) ? ":" . $_SERVER['SERVER_PORT'] : "") . URL . "mobile/index.php"; - } - $encodedurl = str_replace("/", "\\", $url); - $codeuri = "bizsync://" . $encodedurl . "/" . $_SESSION['username'] . "/" . $code; - $qrCode = new QrCode($codeuri); - $qrCode->setWriterByName('svg'); - $qrCode->setSize(550); - $qrCode->setErrorCorrectionLevel(ErrorCorrectionLevel::HIGH); - $qrcode = $qrCode->writeDataUri(); - $chunk_code = trim(chunk_split($code, 5, ' ')); - $lang_done = $Strings->get("done adding sync code", false); - ?> -
+
+ has("mobile_codes", ["AND" => ["uid" => $_SESSION['uid'], "codeid" => $_GET['showsynccode']]])) { + $code = $database->get("mobile_codes", 'code', ["AND" => ["uid" => $_SESSION['uid'], "codeid" => $_GET['showsynccode']]]); + } else { + $code = strtoupper(substr(md5(mt_rand() . uniqid("", true)), 0, 20)); + $desc = htmlspecialchars($_POST['desc']); + $database->insert('mobile_codes', ['uid' => $_SESSION['uid'], 'code' => $code, 'description' => $desc]); + } + if (strpos(URL, "http") !== FALSE) { + $url = URL . "mobile/index.php"; + } else { + $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . (($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) ? ":" . $_SERVER['SERVER_PORT'] : "") . URL . "mobile/index.php"; + } + $encodedurl = str_replace("/", "\\", $url); + $codeuri = "bizsync://" . $encodedurl . "/" . $_SESSION['username'] . "/" . $code; + $qrCode = new QrCode($codeuri); + $qrCode->setWriterByName('svg'); + $qrCode->setSize(550); + $qrCode->setErrorCorrectionLevel(ErrorCorrectionLevel::HIGH); + $qrcode = $qrCode->writeDataUri(); + $chunk_code = trim(chunk_split($code, 5, ' ')); + $lang_done = $Strings->get("done adding sync code", false); + ?>

get("scan sync qrcode"); ?>

@@ -72,57 +71,57 @@ if (!empty($_GET['delsynccode'])) { } else { $activecodes = $database->select("mobile_codes", ["codeid", "code", "description"], ["uid" => $_SESSION['uid']]); ?> -
-

- get("sync explained"); ?> -

- - " required /> - - +

+ get("sync explained"); ?> +

+
+ " required /> + +
+
+
+
+ get("active sync codes"); ?>
-
-
- get("active sync codes"); ?> -
- 0) { - foreach ($activecodes as $c) { - ?> -
-
-
- -
-
- -
+ 0) { + foreach ($activecodes as $c) { + ?> +
+
+
+
-
- - - - - - +
+
- -
- get("no active codes"); ?> +
-
+
+ get("no active codes"); ?> +
+
+
+
\ No newline at end of file