}
}
// senders
SmsSenderManager senderManager = new SmsSenderManager(locale,session);
long[] sourceSenderIds = f.getSourceSenderIds();
if (sourceSenderIds != null){ // at least one mapping
long[] selectedSenderIds = f.getSelectedSenderIds();
for (int i = 0; i < sourceSenderIds.length; i++){
long sourceSenderId = sourceSenderIds[i];
Sender sourceSender = senderManager.getSmsSenderById(sourceSenderId);
if (sourceSender == null){
throw new InputException(getResources(req).getMessage(locale, "smssvc.SourceSenderNotAvailableAnymore"),"sender #" + sourceSenderId + " not found",null,null);
}
if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && !senderManager.isValidForGroup(sourceSender,webUser.getGroup())) {
throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
}
long selectedSenderId = selectedSenderIds[i];
if (selectedSenderId >= 1){ // mapping entry => assign; no entry => add to group
Sender selectedSender = senderManager.getSmsSenderById(selectedSenderId);
if (selectedSender == null){
throw new InputException(getResources(req).getMessage(locale, "smssvc.SelectedSenderNotAvaliableAnymore"),"sender #" + selectedSenderId + " not found",null,null);
}
if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && !senderManager.isValidForGroup(selectedSender,webUser.getGroup())) {
throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
}
mappingSet.add(new Entry(sourceSender), new Entry(selectedSender));
}
}