If some domains are not added, then this happened because they are duplicates. Highlight this in the success message.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-08-29 16:53:00 +02:00
parent fcc49e3928
commit 50e5349ee4

View File

@@ -135,11 +135,23 @@ function add_to_table($db, $table, $domains, $wildcardstyle=false, $returnnum=fa
{
$finalcount = intval($db->querySingle("SELECT COUNT(*) FROM ".$table.";"));
$modified = $finalcount - $initialcount;
// If we add less domains than the user specified, then they wanted to add duplicates
if($modified !== $num)
{
$delta = $num - $modified;
$extra = " (".$delta." already existing)";
}
else
{
$extra = "";
}
if($num === 1)
$plural = "";
else
$plural = "s";
return "Success, added ".$modified." of ".$num." domain".$plural;
return "Success, added ".$modified." of ".$num." domain".$plural.$extra;
}
}