$obsUid = 0; } if ($target && !preg_match('/^[a-z]+$/', $target)) { $target = ''; } if ($mode && !preg_match('/^[a-z]+$/', $mode)) { $mode = ''; } if ($action && !preg_match('/^[a-zA-Z\\s]+$/', $action)) { $action = ''; } $cleanManager = new OccurrenceCleaner(); if ($collid) { $cleanManager->setCollId($collid); } $collMap = $cleanManager->getCollMap(); $statusStr = ''; $isEditor = 0; if ($isAdmin || array_key_exists("CollAdmin", $userRights) && in_array($collid, $userRights["CollAdmin"]) || $collMap['colltype'] == 'General Observations') { $isEditor = 1; } //If collection is a general observation project, limit to User if ($collMap['colltype'] == 'General Observations' && $obsUid !== 0) { $obsUid = $symbUid; $cleanManager->setObsUid($obsUid); } if ($action && $isEditor) { if ($action == 'Replace Country') { if (!$cleanManager->updateCountry($_POST['badcountry'], $_POST['newcountry'])) { $statusStr = $cleanManager->getErrorStr(); }