function popup_connected_add() { $ocs = new ocs(); $ocs->INJECT_COMPUTER_TOLDAP($_GET["connected-mac"]); }
function AutomaticInjectionAdd($MAC) { echo "add {$MAC}\n"; $cs = new ocs(); if ($cs->INJECT_COMPUTER_TOLDAP($MAC)) { unset($GLOBALS["INJECT_COMPUTER_TOLDAP"]); $f = new computers(); $uid = $f->ComputerIDFromMAC($ligne["MACADDR"]); $f = new computers($uid); $text[] = "uid\t:{$uid}"; $text[] = "Computer\t:{$f->ComputerRealName}"; $text[] = "IP\t:{$f->ComputerIP}"; $text[] = "MAC\t:{$MAC}"; send_email_events("New computer {$f->ComputerRealName} added into Database", @implode("\n", $text), "system"); } else { $infos = @implode("\n", $GLOBALS["INJECT_COMPUTER_TOLDAP"]) . "\n\n" . @implode("\n", $text); send_email_events("Failed to inject computer {$f->ComputerRealName} ({$MAC})", $infos, "system"); } }