From 87f1554fdf10c1fc0ca03787c9e83afaaf9e23e6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 13 Apr 2021 18:15:10 +0200 Subject: [PATCH] allow "email" GET parameter and some docu --- calendar/freebusy.php | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/calendar/freebusy.php b/calendar/freebusy.php index 08a15a7e11..65f8f1533f 100644 --- a/calendar/freebusy.php +++ b/calendar/freebusy.php @@ -1,13 +1,21 @@ :" of an EGroupware user * * @link http://www.egroupware.org * @author Ralf Becker * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @package calendar * @subpackage export - * @version $Id$ */ use EGroupware\Api; @@ -54,17 +62,24 @@ if (!$logged_in) // fix for SOGo connector, which does not decode the = in our f/b url if (strpos($_SERVER['QUERY_STRING'],'=3D') !== false && substr($_GET['user'],0,2) == '3D') { - $_GET['user'] = substr($_GET['user'],2); - if (isset($_GET['password'])) $_GET['password'] = substr($_GET['password'],2); - if (isset($_GET['cred'])) $_GET['cred'] = substr($_GET['cred'],2); + foreach(['user', 'email', 'password', 'cred'] as $name) + { + if (isset($_GET[$name])) $_GET[$name] = substr($_GET[$name],2); + } } -if (!is_numeric($user = $_GET['user'])) +if (isset($_GET['user']) && !is_numeric($user = $_GET['user'])) { // check if user contains the current domain --> remove it - list(,$domain) = explode('@',$user); + list(, $domain) = explode('@', $user); if ($domain === $GLOBALS['egw_info']['user']['domain']) - list($user) = explode('@',$user); - $user = $GLOBALS['egw']->accounts->name2id($user,'account_lid','u'); + { + list($user) = explode('@', $user); + } + $user = $GLOBALS['egw']->accounts->name2id($user, 'account_lid', 'u'); +} +elseif (isset($_GET['email'])) +{ + $user = $GLOBALS['egw']->accounts->name2id($_GET['email'], 'account_email', 'u'); } if ($user === false || !($username = $GLOBALS['egw']->accounts->id2name($user))) {