Esempio n. 1
0
 $mailingID = $mailingID[0];
 $mailingMgr = new MailingMgr();
 $mailing = $mailingMgr->getMailing($mailingID);
 $mailingInfo = $mailing->get();
 // Get assigned groups
 $usergroups = $mailing->getUsergroups();
 foreach ($usergroups as $usergroup_idx => $usergroup) {
     $usergroups[$usergroup_idx]['RDELETE'] = true;
     $usergroups[$usergroup_idx]['SHOW_DELETE'] = true;
 }
 $object_permissions['RWRITE'] = $mailing->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $mailingID, "RWRITE");
 $object_permissions['RSTAGE'] = $mailing->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $mailingID, "RSTAGE");
 $object_permissions['READONLY'] = !$object_permissions['RWRITE'];
 // Get current locks for this token (and unlock them)
 $lockToken = sGuiUS() . '_' . $this->request->parameters['win_no'];
 $lockedObjects = $mailingMgr->getLocksByToken($lockToken);
 foreach ($lockedObjects as $lockedObject) {
     $currentObject = $mailingMgr->getMailing($lockedObject['OBJECTID']);
     $currentObject->releaseLock($lockedObject['TOKEN']);
 }
 // Check for lock, and lock if not locked
 $lockStatus = $mailing->getLock();
 if ($lockStatus['LOCKED'] == 0) {
     $lockedFailed = !$mailing->acquireLock($lockToken);
 } else {
     $lockedFailed = true;
 }
 if ($lockedFailed) {
     // Get user who locked this object
     $userWithLock = new User($lockStatus['LOCKUID']);
     $lockedByUser = $userWithLock->get($lockStatus['LOCKUID']);