| @@ 157-168 (lines=12) @@ | ||
| 154 | } else { |
|
| 155 | // Creating the array that contains all the users who will receive the file |
|
| 156 | $newWorkRecipients = array(); |
|
| 157 | foreach ($_POST['recipients'] as $rec) { |
|
| 158 | if (strpos($rec, 'user_') === 0) { |
|
| 159 | $newWorkRecipients[] = substr($rec, strlen('user_')); |
|
| 160 | } elseif (strpos($rec, 'group_') === 0) { |
|
| 161 | $userList = GroupManager::get_subscribed_users(substr($rec, strlen('group_'))); |
|
| 162 | foreach ($userList as $usr) { |
|
| 163 | if (!in_array($usr['user_id'], $newWorkRecipients) && $usr['user_id'] != $_user['user_id']) { |
|
| 164 | $newWorkRecipients[] = $usr['user_id']; |
|
| 165 | } |
|
| 166 | } |
|
| 167 | } |
|
| 168 | } |
|
| 169 | } |
|
| 170 | ||
| 171 | // After uploading the file, create the db entries |
|
| @@ 1042-1053 (lines=12) @@ | ||
| 1039 | ||
| 1040 | // creating the array that contains all the users who will receive the file |
|
| 1041 | $new_work_recipients = array(); |
|
| 1042 | foreach ($_POST['recipients'] as $rec) { |
|
| 1043 | if (strpos($rec, 'user_') === 0) { |
|
| 1044 | $new_work_recipients[] = substr($rec, strlen('user_')); |
|
| 1045 | } elseif (strpos($rec, 'group_') === 0) { |
|
| 1046 | $userList = GroupManager::get_subscribed_users(substr($rec, strlen('group_'))); |
|
| 1047 | foreach ($userList as $usr) { |
|
| 1048 | if (!in_array($usr['user_id'], $new_work_recipients) && $usr['user_id'] != $_user['user_id']) { |
|
| 1049 | $new_work_recipients[] = $usr['user_id']; |
|
| 1050 | } |
|
| 1051 | } |
|
| 1052 | } |
|
| 1053 | } |
|
| 1054 | ||
| 1055 | @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath') . '/' . $dropbox_filename); |
|
| 1056 | ||