I've written two new pages...
Firstly, admin_pc_add_1.php:
[code]<?php
$page = "add_pc";
include "include.php";
echo "<td valign=\"top\">\n";
echo "<div class=\"main_each\">";
echo "<p class=\"contenthead\">".__("Add a PC")."</p>\n";
?>
<form action="exec.php" method="post">
<p>
<table>
<tr>
<td></td>
<td></td>
<td>Serveur :</td>
<td><input type="text" name="hostname" size="15"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>Domaine :</td>
<td><input name="domain" type="text" size="15"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>Login :</td>
<td><input type="text" name="login" size="15"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>Password :</td>
<td><input type="password" name="pwd" size="15"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td><input type="submit" value="Envoyer" name="Envoyer"></td>
</tr>
</table>
</form>
<?php
echo "</td>\n";
include "include_right_column.php";
echo "</body>\n";
echo "</html>\n";
?>
[/code]
Secondly, exec.php :
[code]<?php
set_time_limit(75);
//Recuperation of values which are sending by admin_pc_add_1.php
$host = $_POST['hostname'];
$domain = $_POST['domain'];
$log = $_POST['login'];
$mdp = $_POST['pwd'];
echo "PC Added : $host with user $domain\\$log .<br />";
//Execution of audit.vbs
exec("cscript c:\wamp\www\OpenAudit\scripts\audit.vbs $host $domain\\$log $mdp");
//Return automatically to index.php
echo "<script type=\"text/javascript\">
window.location.href='http://IP_address/OpenAudit/index.php';
</script>";
exit;
?>[/code]
As far i am concerned, i have two Open Audit servers, 1 Linux (for production) , 1 Windows 2000 (for test).
Since my scripts need to execute a vb script, I can't use them on my Debian, but i hope it will able to use by someone.
I've found a solution for Linux:
admin_pc_add_1.php:
[code]<?php
echo "<script type=\"text/javascript\">
window.location.href='http://172.30.1.161/OpenAudit/launch_local_audit.php';
</script>";
exit;
?>[/code]
and uncomment line 199 to 209 in audit.vbs.
Now, when you go on ADD PC, it asks you name, login and password of remote server.
I'm sorry for my english, I try to improve it