X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=217a5f4e1d9ba834df26bcc3ba5f3455e933f4a6;hb=f97636193552ffeed8b531139d9fe632e4f8ae7d;hp=a699a66f95d29cc5b0c17c3624584808959c687a;hpb=9b37f5c0855c8071075fa3ce49b7e9c38f2c6a2e;p=friendica.git diff --git a/boot.php b/boot.php index a699a66f95..217a5f4e1d 100644 --- a/boot.php +++ b/boot.php @@ -1,6 +1,6 @@ get_hostname()); + $prefix = hash('crc32', $a->get_hostname()); } while (strlen($prefix) < ($size - 13)) { @@ -862,22 +878,19 @@ function get_guid($size = 16, $prefix = "") if ($size >= 24) { $prefix = substr($prefix, 0, $size - 22); - return(str_replace(".", "", uniqid($prefix, true))); + return str_replace('.', '', uniqid($prefix, true)); } else { $prefix = substr($prefix, 0, max($size - 13, 0)); - return(uniqid($prefix)); + return uniqid($prefix); } } /** * @brief Used to end the current process, after saving session state. + * @deprecated */ function killme() { - if (!get_app()->is_backend()) { - session_write_close(); - } - exit(); } @@ -921,10 +934,10 @@ function public_contact() if (!$public_contact_id && x($_SESSION, 'authenticated')) { if (x($_SESSION, 'my_address')) { // Local user - $public_contact_id = intval(Contact::getIdForURL($_SESSION['my_address'], 0)); + $public_contact_id = intval(Contact::getIdForURL($_SESSION['my_address'], 0, true)); } elseif (x($_SESSION, 'visitor_home')) { // Remote user - $public_contact_id = intval(Contact::getIdForURL($_SESSION['visitor_home'], 0)); + $public_contact_id = intval(Contact::getIdForURL($_SESSION['visitor_home'], 0, true)); } } elseif (!x($_SESSION, 'authenticated')) { $public_contact_id = false; @@ -940,10 +953,12 @@ function public_contact() */ function remote_user() { - // You cannot be both local and remote - if (local_user()) { - return false; - } + // You cannot be both local and remote. + // Unncommented by rabuzarus because remote authentication to local + // profiles wasn't possible anymore (2018-04-12). +// if (local_user()) { +// return false; +// } if (x($_SESSION, 'authenticated') && x($_SESSION, 'visitor_id')) { return intval($_SESSION['visitor_id']); }