[ "sync mobile" => "Sync Mobile App", "scan sync qrcode" => "Scan this code with the mobile app or enter the code manually.", "sync explained" => "Access your account and apps on the go. Use a sync code to securely connect your phone or tablet to Portal with the Netsyms Business mobile app.", "generate sync" => "Create new sync code", "active sync codes" => "Active codes", "no active codes" => "No active codes.", "done adding sync code" => "Done adding code" ] ]); $APPS["sync_mobile"]["title"] = lang("sync mobile", false); $APPS["sync_mobile"]["icon"] = "mobile"; if (!is_empty($_GET['delsynccode'])) { if ($database->has("mobile_codes", ["AND" => ["uid" => $_SESSION['uid'], "codeid" => $_GET['delsynccode']]])) { $database->delete("mobile_codes", ["AND" => ["uid" => $_SESSION['uid'], "codeid" => $_GET['delsynccode']]]); } } if ($_GET['mobilecode'] == "generate") { if (!is_empty($_GET['showsynccode']) && $database->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)); $database->insert('mobile_codes', ['uid' => $_SESSION['uid'], 'code' => $code]); } $url = str_replace("/", "\\", URL . "mobile/index.php"); $codeuri = "bizsync://" . $url . "/" . $_SESSION['username'] . "/" . $code; $qrCode = new QrCode($codeuri); $qrCode->setSize(200); $qrCode->setErrorCorrection("H"); $qrcode = $qrCode->getDataUri(); $chunk_code = trim(chunk_split($code, 5, ' ')); $lang_done = lang("done adding sync code", false); $APPS["sync_mobile"]["content"] = '