31 require_once dirname(dirname(__DIR__)) .
"/agent-add.php";
32 require_once dirname(dirname(dirname(dirname(__DIR__)))) .
"/lib/php/common-folders.php";
93 foreach ($uploadsAccessible as $singleUpload) {
94 if ($singleUpload[
'upload_pk'] == $uploadId) {
99 if ($found ===
false) {
100 return new Info(404,
"Folder id $folderId does not have upload id ".
101 "$uploadId or you do not have write access to the folder.", InfoType::ERROR);
104 $paramAgentRequest =
new Request();
108 $returnStatus = (new \AgentAdder())->
scheduleAgents($uploadId, $agentsToAdd, $paramAgentRequest);
109 if (is_numeric($returnStatus)) {
110 return new Info(201, $returnStatus, InfoType::INFO);
112 return new Info(403, $returnStatus, InfoType::ERROR);
123 foreach ($this->analysis->getArray() as $agent => $set) {
125 if ($agent ==
"copyright_email_author") {
126 $agentsToAdd[] =
"agent_copyright";
128 $agentsToAdd[] =
"agent_$agent";
141 if ($this->reuse->getReuseUpload() == 0) {
146 if ($this->reuse->getReuseMain() ===
true) {
147 $reuserRules[] =
'reuseMain';
149 if ($this->reuse->getReuseEnhanced() ===
true) {
150 $reuserRules[] =
'reuseEnhanced';
152 $reuserSelector = $this->reuse->getReuseUpload() .
"," . $this->reuse->getReuseGroup();
156 $request->request->set(
'reuseMode', $reuserRules);
166 if ($this->decider->getNomosMonk() ===
true) {
167 $deciderRules[] =
'nomosInMonk';
169 if ($this->decider->getBulkReused() ===
true) {
170 $deciderRules[] =
'reuseBulk';
172 if ($this->decider->getNewScanner() ===
true) {
173 $deciderRules[] =
'wipScannerUpdates';
175 if ($this->decider->getOjoDecider() ===
true) {
176 $deciderRules[] =
'ojoNoContradiction';
178 $request->request->set(
'deciderRules', $deciderRules);
179 if ($this->analysis->getNomos()) {
180 $request->request->set(
'Check_agent_nomos', 1);
scheduleAgents($folderId, $uploadId)
Model to hold add settings for new scan.
FolderListUploads_perm($ParentFolder, $perm)
Returns an array of uploads in a folder.
__construct($analysis, $reuse, $decider)
prepareDecider(Request &$request)
const UPLOAD_TO_REUSE_SELECTOR_NAME
Form element name for main license to reuse.
Info model to contain general error and return values.
prepareReuser(Request &$request)