From 9d68f9f8b4553b667e4a7bf17acddba8ac8826be Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 11 Feb 2015 21:52:29 +0000 Subject: [PATCH] fixed share links were reused, event if attributes were different (password, expires, writable) --- phpgwapi/inc/class.egw_sharing.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.egw_sharing.inc.php b/phpgwapi/inc/class.egw_sharing.inc.php index 9f6b7badbe..e07a236637 100644 --- a/phpgwapi/inc/class.egw_sharing.inc.php +++ b/phpgwapi/inc/class.egw_sharing.inc.php @@ -371,12 +371,15 @@ class egw_sharing { throw new egw_exception_not_found("'$path' NOT found!"); } - // check if file has been shared before + // check if file has been shared before, with identical attributes if (($mode != self::LINK || isset($path2tmp[$path])) && - ($share = self::$db->select(self::TABLE, '*', array( + ($share = self::$db->select(self::TABLE, '*', $extra+array( 'share_path' => $mode == 'link' ? $path2tmp[$path] : $vfs_path, 'share_owner' => $GLOBALS['egw_info']['user']['account_id'], - )+$extra, __LINE__, __FILE__)->fetch())) + 'share_expires' => null, + 'share_passwd' => null, + 'share_writable'=> false, + ), __LINE__, __FILE__)->fetch())) { // if yes, just add additional recipients $share['share_with'] = $share['share_with'] ? explode(',', $share['share_with']) : array();