define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'Dalmatian Bellflower');
-define('FRIENDICA_VERSION', '2019.09-dev');
+define('FRIENDICA_VERSION', '2019.09-rc');
define('DFRN_PROTOCOL_VERSION', '2.23');
define('NEW_UPDATE_ROUTINE_VERSION', 1170);
*
* @return int|bool visitor_id or false
*/
-function remote_user()
+function remote_user($uid = null)
{
// You cannot be both local and remote.
// Unncommented by rabuzarus because remote authentication to local
// return false;
// }
- if (empty($_SESSION)) {
+ if (empty($_SESSION['authenticated'])) {
return false;
}
- if (!empty($_SESSION['authenticated']) && !empty($_SESSION['visitor_id'])) {
+ if (!is_null($uid) && !empty($_SESSION['remote'])) {
+ /// @todo replace it with this:
+ // if (!empty($_SESSION['remote'][$uid])) ...
+ foreach ($_SESSION['remote'] as $visitor) {
+ if ($visitor['uid'] == $uid) {
+ return $visitor['cid'];
+ }
+ }
+ } elseif (is_null($uid) && !empty($_SESSION['visitor_id'])) {
return intval($_SESSION['visitor_id']);
}
+
return false;
}