Skip to content

Commit 849c40d

Browse files
committed
Scan subnet and add host as normal User phpipam#546
1 parent 0e3134b commit 849c40d

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

app/subnets/scan/subnet-scan-icmp-result.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# initialize user object
1010
$Database = new Database_PDO;
1111
$User = new User ($Database);
12-
$Admin = new Admin ($Database);
12+
$Admin = new Admin ($Database, false);
1313
$Subnets = new Subnets ($Database);
1414
$Addresses = new Addresses ($Database);
1515
$Tools = new Tools ($Database);

app/subnets/scan/subnet-scan-telnet.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
}
1717
$_POST['port'] = str_replace(";",",",$_POST['port']);
1818

19+
# create csrf token
20+
$csrf = $User->csrf_cookie ("create", "scan");
1921

2022
# invoke CLI with threading support
2123
$cmd = $Scan->php_exec." ".dirname(__FILE__) . "/../../../functions/scan/subnet-scan-telnet-execute.php $_POST[subnetId] '$_POST[port]'";
@@ -73,6 +75,7 @@
7375
//hostname
7476
print "<td>";
7577
print " <input type='text' class='form-control input-sm' name='dns_name$m' value='".@$hostname['name']."'>";
78+
print " <input type='hidden' name='csrf_cookie' value='$csrf'>";
7679
print "</td>";
7780
//remove button
7881
print "<td><a href='' class='btn btn-xs btn-danger resultRemove' data-target='result$m'><i class='fa fa-times'></i></a></td>";

app/subnets/scan/subnet-scan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# initialize user object
1111
$Database = new Database_PDO;
1212
$User = new User ($Database);
13-
$Admin = new Admin ($Database);
13+
$Admin = new Admin ($Database, false);
1414
$Subnets = new Subnets ($Database);
1515
$Result = new Result ();
1616

0 commit comments

Comments
 (0)