Single-sign-on and self-serve account management. https://netsyms.biz/apps/accounthub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getloginkey.php 755B

12345678910111213141516171819202122
  1. <?php
  2. /*
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. */
  7. $appicon = null;
  8. if (!empty($VARS['appicon'])) {
  9. $appicon = $VARS['appicon'];
  10. }
  11. $code = LoginKey::generate($VARS['appname'], $appicon);
  12. if (strpos($SETTINGS['url'], "http") === 0) {
  13. $url = $SETTINGS['url'] . "login/";
  14. } else {
  15. $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . (($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) ? ":" . $_SERVER['SERVER_PORT'] : "") . $SETTINGS['url'] . "login/";
  16. }
  17. exitWithJson(["status" => "OK", "code" => $code, "loginurl" => $url]);