Пример #1
0
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--
*/
// Vérification de sécurité
if (!defined("WIKINI_VERSION")) {
    die("accès direct interdit");
}
if ($this->HasAccess("write") && $this->HasAccess("read")) {
    if (isset($_POST["submit"]) && $_POST["submit"] != 'Aperçu') {
        define("CAPTCHA_INCLUDE", TRUE);
        include 'tools/captcha/captcha.php';
        $crypt = cryptWord($textes[array_rand($textes)]);
        // afficher les champs de formulaire et de l'image
        $ChampsCaptcha = '
  			<br />
			<h3>V&eacute;rification</h3>
			<div id="captcha">
				<img src="tools/captcha/captcha.php?' . $crypt . '" alt="captcha" />
				<div id="capt_f">
					<p>Veuillez r&eacute;ecrire le mot pr&eacute;sent dans l\'image si vous souhaitez <strong>sauvegarder la page</strong>.</p>
					<input type="hidden" name="captcha_hash" value="' . $crypt . '" />
					<label><input type="text" name="captcha" value="" /> (actualisez la page si le mot est illisible)</label>
				</div>
			</div>
		';
        $plugin_output_new = preg_replace('/\\<input name=\\"submit\\" type=\\"submit\\" value=\\"Sauver\\"/', $ChampsCaptcha . '<input name="submit" type="submit" value="Sauver"', $plugin_output_new);
    }
Пример #2
0
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--
*/
// Vérification de sécurité
if (!defined("WIKINI_VERSION")) {
    die("acc&egrave;s direct interdit");
}
if ($this->HasAccess('comment')) {
    if (!empty($_POST['submit'])) {
        $submit = $_POST['submit'];
    } else {
        $submit = false;
    }
    define("CAPTCHA_INCLUDE", TRUE);
    include 'tools/captcha/captcha.php';
    if (empty($_POST['captcha'])) {
        $this->SetMessage("Ce commentaire n\\'a pas &eacute;t&eacute; enregistr&eacute; car vous n\\'avez pas entr&eacute; le mot de v&eacute;rification.");
        $this->Redirect($this->href());
    } elseif (!empty($_POST['captcha'])) {
        $wdcrypt = cryptWord($_POST['captcha']);
        if ($wdcrypt != $_POST['captcha_hash']) {
            $this->SetMessage("Ce commentaire n\\'a pas &eacute;t&eacute; enregistr&eacute; car le mot entr&eacute; ne correspond pas...");
            $this->Redirect($this->href());
        }
    }
}
Пример #3
0
 function findWord($hash = NULL)
 {
     global $textes;
     if ($hash) {
         foreach ($textes as $text) {
             if ($hash == cryptWord($text)) {
                 return $text;
             }
         }
     }
     return $textes[array_rand($textes)];
 }