1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| <?php
if (isset($_POST['code'])) {
$tab_mdp = array("user1", "user2", "user3");
if (in_array($_POST['code'], $tab_mdp)) {
?>
<?php
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["language"] = "fr_FR";
$params["max_privmsg"] = 1; // limit the number of private message tab to 1
$params["max_channels"] = 1; // limit the number of joined channels tab to 3
$params["shownotice"] = 0; // 0 = nothing, 1 = just nickname changes, 2 = connect/quit, 3 = nick + connect/quit
$params["theme"] = "msn";
$params["title"] = "Tchat général";
$params["channels"] = array("Débat Général");
$params["timeout"] = 990000;
$params["admins"] = array("admin" => "admin");
$params["max_displayed_lines"] = 500;
$params["max_msg"] = 900;
$params["height"] = "700px";
$params["shownotice"] = 1;
$chat = new phpFreeChat( $params );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<?php $chat->printJavascript(); ?>
<?php $chat->printStyle(); ?>
<title>
Chat
</title>
</head>
<body>
<?php $chat->printChat(); ?>
</body>
</html>
<?php
} else {
?>
<p><font color="#000000" size="4"><font color="red"><p> Mauvais mot de passe </p></font></font></p>
<form action="#" method="post">
<font color="#000000"
size="4">Taper un bon mot de passe:</font>
<input type="text" name="code" value="" id="idInput" />
<script language="javascript">
document.getElementById('idInput').focus();
</script>
<input type="submit" />
</form> </center>
<?php
}
} else {
?>
<p><font color="#000000" size="4">Taper votre mot de passe avant de rentrer sur le chat</font></p>
<br/>
</font>
<form action="#" method="post">
<font color="#000000" size="4">Tapez votre mot de passe ici:
<input type="text" name="code" value="" id="idInput" />
<script language="javascript">
document.getElementById('idInput').focus();
</script>
<input type="submit"> </font>
</form>
<?php
}
?> |
Partager