60 |
jpm |
1 |
<html>
|
|
|
2 |
<head>
|
|
|
3 |
<title>Documentation</title>
|
|
|
4 |
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
|
|
|
5 |
<link rel='stylesheet' href='style.css' />
|
|
|
6 |
</head>
|
|
|
7 |
|
|
|
8 |
<body>
|
|
|
9 |
<div align='center'>
|
|
|
10 |
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
|
|
|
11 |
<tr>
|
|
|
12 |
<td class='borderhg'> </td>
|
|
|
13 |
<td class='borderh'> </td>
|
|
|
14 |
<td class='cornerhd'></td>
|
|
|
15 |
</tr>
|
|
|
16 |
<tr>
|
|
|
17 |
<td class='borderg'> </td>
|
|
|
18 |
<td><a id="top"></a><h2> Class AntiSpam</h2><div class="extends"><ul>
|
|
|
19 |
<li><a href="Image.html">Image</a></li>
|
|
|
20 |
<ul><li>AntiSpam</li></ul>
|
|
|
21 |
</ul></div><div class="description">
|
|
|
22 |
<p>
|
|
|
23 |
La classe <a href="AntiSpam.html">AntiSpam</a> permet de créer des images pour interdire des requêtes automatisées sur certaines pages.
|
|
|
24 |
</p>
|
|
|
25 |
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
|
|
|
26 |
<li>
|
|
|
27 |
<span class="access">protected</span> <span class="type">string</span> <a href="AntiSpam.html#property.string"><span class="argument">$string</span></a>
|
|
|
28 |
</li>
|
|
|
29 |
<li>
|
|
|
30 |
<span class="access">protected</span> <span class="type">int</span> <a href="AntiSpam.html#property.noise"><span class="argument">$noise</span></a> := <span class="default">0</span>
|
|
|
31 |
</li>
|
|
|
32 |
</ul><ul class="methods">
|
|
|
33 |
<li>
|
|
|
34 |
<span class="access">public</span> <a href="AntiSpam.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$string</span> := <span class="default">''</span>)
|
|
|
35 |
</li>
|
|
|
36 |
<li>
|
|
|
37 |
<span class="access">public</span> <span class="type">string</span> <a href="AntiSpam.html#method.setRand">setRand</a>(<span class="type">int</span> <span class="argument">$length</span>)
|
|
|
38 |
</li>
|
|
|
39 |
<li>
|
|
|
40 |
<span class="access">public</span> <a href="AntiSpam.html#method.setNoise">setNoise</a>(<span class="type">int</span> <span class="argument">$noise</span>)
|
|
|
41 |
</li>
|
|
|
42 |
<li>
|
|
|
43 |
<span class="access">public</span> <a href="AntiSpam.html#method.save">save</a>(<span class="type">string</span> <span class="argument">$qName</span>)
|
|
|
44 |
</li>
|
|
|
45 |
<li>
|
|
|
46 |
<span class="access">public</span> <a href="AntiSpam.html#method.check">check</a>(<span class="type">string</span> <span class="argument">$qName</span>, <span class="type">string</span> <span class="argument">$value</span>, <span class="type">bool</span> <span class="argument">$case</span> := <span class="default">TRUE</span>)
|
|
|
47 |
</li>
|
|
|
48 |
<li>
|
|
|
49 |
<span class="access">public</span> <a href="AntiSpam.html#method.draw">draw</a>()
|
|
|
50 |
</li>
|
|
|
51 |
</ul><h2>Documentation</h2><ul class="doc">
|
|
|
52 |
<li class="property">
|
|
|
53 |
<a id="property.string"></a><span class="access">protected</span> <span class="type">string</span> <a href="AntiSpam.html#property.string"><span class="argument">$string</span></a><div class="description">
|
|
|
54 |
La chaîne de caractère que devra retaper l'utilisateur.
|
|
|
55 |
</div>
|
|
|
56 |
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
|
|
|
57 |
</li>
|
|
|
58 |
<li class="property">
|
|
|
59 |
<a id="property.noise"></a><span class="access">protected</span> <span class="type">int</span> <a href="AntiSpam.html#property.noise"><span class="argument">$noise</span></a> := <span class="default">0</span><div class="description">
|
|
|
60 |
Degré de bruit à afficher sur l'image (entre 0 et 10).
|
|
|
61 |
</div>
|
|
|
62 |
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
|
|
|
63 |
</li>
|
|
|
64 |
<li class="method">
|
|
|
65 |
<a id="method.__construct"></a><span class="access">public</span> <a href="AntiSpam.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$string</span> := <span class="default">''</span>)
|
|
|
66 |
<div class="description">
|
|
|
67 |
Construit une image anti-spam. Vous pouvez définir la chaîne de caractères à afficher sur l'image avec $string.
|
|
|
68 |
Si vous ne donnez aucune chaîne de caractères, voyez <a href="AntiSpam.html#method.setRand">AntiSpam::setRand()</a> pour générer une valeur aléatoire.
|
|
|
69 |
</div>
|
|
|
70 |
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
|
|
|
71 |
</li>
|
|
|
72 |
<li class="method">
|
|
|
73 |
<a id="method.setRand"></a><span class="access">public</span> <span class="type">string</span> <a href="AntiSpam.html#method.setRand">setRand</a>(<span class="type">int</span> <span class="argument">$length</span>)
|
|
|
74 |
<div class="description">
|
|
|
75 |
Génère une chaîne de caractère aléatoire de taille $length pour l'image anti-spam.
|
|
|
76 |
La chaîne de caractère ainsi créée est ensuite retournée.
|
|
|
77 |
</div>
|
|
|
78 |
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
|
|
|
79 |
</li>
|
|
|
80 |
<li class="method">
|
|
|
81 |
<a id="method.setNoise"></a><span class="access">public</span> <a href="AntiSpam.html#method.setNoise">setNoise</a>(<span class="type">int</span> <span class="argument">$noise</span>)
|
|
|
82 |
<div class="description">
|
|
|
83 |
Ajoute du bruit sur l'image.
|
|
|
84 |
Les valeurs possibles sont de 0 à 10, avec 0 pour ne pas afficher de bruit et 10 pour afficher un bruit maximal.
|
|
|
85 |
</div>
|
|
|
86 |
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
|
|
|
87 |
</li>
|
|
|
88 |
<li class="method">
|
|
|
89 |
<a id="method.save"></a><span class="access">public</span> <a href="AntiSpam.html#method.save">save</a>(<span class="type">string</span> <span class="argument">$qName</span>)
|
|
|
90 |
<div class="description">
|
|
|
91 |
Enregistre la valeur de l'image anti-spam dans la session de l'utilisateur sous le nom $qName.
|
|
|
92 |
Cette méthode doit être utilisée en combinaison avec <a href="AntiSpam.html#method.check">AntiSpam::check()</a>.
|
|
|
93 |
</div>
|
|
|
94 |
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
|
|
|
95 |
</li>
|
|
|
96 |
<li class="method">
|
|
|
97 |
<a id="method.check"></a><span class="access">public</span> <a href="AntiSpam.html#method.check">check</a>(<span class="type">string</span> <span class="argument">$qName</span>, <span class="type">string</span> <span class="argument">$value</span>, <span class="type">bool</span> <span class="argument">$case</span> := <span class="default">TRUE</span>)
|
|
|
98 |
<div class="description">
|
|
|
99 |
Vérifie que la valeur $value correspond à la valeur enregistrée sous le nom $qName avec <a href="AntiSpam.html#method.save">AntiSpam::save()</a>.
|
|
|
100 |
Si $case est mis à TRUE, alors la vérification NE sera PAS sensible à la casse, elle le sera à FALSE.
|
|
|
101 |
Cette méthode doit être utilisée en combinaison avec <a href="AntiSpam.html#method.save">AntiSpam::save()</a>.
|
|
|
102 |
</div>
|
|
|
103 |
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
|
|
|
104 |
</li>
|
|
|
105 |
<li class="method">
|
|
|
106 |
<a id="method.draw"></a><span class="access">public</span> <a href="AntiSpam.html#method.draw">draw</a>()
|
|
|
107 |
<div class="description">
|
|
|
108 |
Affiche l'image anti-spam à l'écran.
|
|
|
109 |
<pre>
|
|
|
110 |
|
|
|
111 |
<?php
|
|
|
112 |
|
|
|
113 |
require_once "AntiSpam.class.php";
|
|
|
114 |
|
|
|
115 |
$object = new <a href="AntiSpam.html">AntiSpam</a>();
|
|
|
116 |
$object-><a href="AntiSpam.html#method.setRand">setRand</a>(5);
|
|
|
117 |
$object-><a href="AntiSpam.html#method.draw">draw</a>();
|
|
|
118 |
|
|
|
119 |
?>
|
|
|
120 |
|
|
|
121 |
</pre>
|
|
|
122 |
</div>
|
|
|
123 |
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
|
|
|
124 |
</li>
|
|
|
125 |
</ul>
|
|
|
126 |
</td>
|
|
|
127 |
<td class='borderd'> </td>
|
|
|
128 |
</tr>
|
|
|
129 |
<tr>
|
|
|
130 |
<td class='cornerbg'></td>
|
|
|
131 |
<td class='borderb'> </td>
|
|
|
132 |
<td class='cornerbd'></td>
|
|
|
133 |
</tr>
|
|
|
134 |
</table>
|
|
|
135 |
</div>
|
|
|
136 |
</body>
|
|
|
137 |
</html>
|