From d226d759cd8e0f3847e3157b8fbf2fe7b3230cab Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 14 Mar 2013 19:34:12 +0000 Subject: [PATCH] Add check for [username] when trying to convert a user to account ID --- .../inc/class.importexport_helper_functions.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/importexport/inc/class.importexport_helper_functions.inc.php b/importexport/inc/class.importexport_helper_functions.inc.php index 615c23996e..fa5bec2fc3 100755 --- a/importexport/inc/class.importexport_helper_functions.inc.php +++ b/importexport/inc/class.importexport_helper_functions.inc.php @@ -135,6 +135,18 @@ class importexport_helper_functions { $account_ids[] = (int)$account_lid; continue; } + // Check for [username] + if(strpos($account_lid,'[') !== false) + { + if(preg_match('/\[(.+)\]/',$account_lid,$matches)) + { + $account_id = $GLOBALS['egw']->accounts->name2id($matches[1]); + unset($account_lids[$key]); + $account_ids[] = $account_id; + } + continue; + } + // Handle users listed as Lastname, Firstname instead of login ID // Do this first, in case their first name matches a username if ( $account_lids[$key+1][0] == ' ' && $account_id = $GLOBALS['egw']->accounts->name2id( trim($account_lids[$key+1]).' ' .$account_lid, 'account_fullname')) {