| version 1.2, 2012/10/02 12:09:48 |
version 1.3, 2012/11/09 10:46:04 |
| Line 192 class RotateAntispam { |
|
| Line 192 class RotateAntispam { |
|
| * @param string $msg - poznamka |
* @param string $msg - poznamka |
| */ |
*/ |
| protected function addLog($msg) { |
protected function addLog($msg) { |
| |
if ($this->debug) { |
| |
$init_log = '--[ RotateAntispam ]----------------------------------------------------'; |
| |
if (strpos($this->getLog(), $init_log) === false) { |
| |
echo '<script type="text/javascript">console.log("'.$init_log.'");</script>'; |
| |
$this->log .= $init_log.'<br>'; |
| |
} |
| |
echo '<script type="text/javascript">console.log("'.addslashes($msg).'");</script>'; |
| |
} |
| $this->log .= $msg.'<br>'; |
$this->log .= $msg.'<br>'; |
| } |
} |
| |
|
| Line 248 class RotateAntispam { |
|
| Line 256 class RotateAntispam { |
|
| */ |
*/ |
| public function setImage($image) { |
public function setImage($image) { |
| $this->addLog('Spusteny setImage'); |
$this->addLog('Spusteny setImage'); |
| |
$this->addLog('Vypis $_SESSION: '.json_encode($_SESSION)); |
| if (!isset($image) |
if (!isset($image) |
| || !is_string($image) |
|| !is_string($image) |
| || !(strlen($image) > 0)) |
|| !(strlen($image) > 0)) |
| Line 502 class RotateAntispam { |
|
| Line 511 class RotateAntispam { |
|
| $this->addLog('Prvy krat spracuvavam'); |
$this->addLog('Prvy krat spracuvavam'); |
| $answer_user = (is_null($answer_user)) ? $_POST[$this->answer_name] : $answer_user; |
$answer_user = (is_null($answer_user)) ? $_POST[$this->answer_name] : $answer_user; |
| $answer = $_SESSION['RotateAntispam']['answer']; |
$answer = $_SESSION['RotateAntispam']['answer']; |
| |
$this->addLog('Odpoved pouzivatela je "'.$answer_user.'"'); |
| if (!isset($answer) |
if (!isset($answer) |
| || strlen($answer) <= 0) |
|| strlen($answer) <= 0) |
| { |
{ |
| $this->addLog('Odpoved nebola nastavena'); |
$this->addLog('Odpoved nebola nastavena'); |
| $this->correctAnswer_cache = false; |
$this->correctAnswer_cache = false; |
| } else { |
} else { |
| $this->addLog('Spravna odpoved je "'.$answer.'", odpoved pouzivatela je "'.$answer_user.'"'); |
$this->addLog('Spravna odpoved je "'.$answer.'"'); |
| $this->correctAnswer_cache = ($answer == $answer_user); |
$this->correctAnswer_cache = ($answer == $answer_user); |
| } |
} |
| $_SESSION['RotateAntispam'] = null; |
$_SESSION['RotateAntispam'] = null; |
| Line 524 class RotateAntispam { |
|
| Line 534 class RotateAntispam { |
|
| } // class RotateAntispam |
} // class RotateAntispam |
| |
|
| // ak nie je nastartovana $_SESSION |
// ak nie je nastartovana $_SESSION |
| if (!isset($_SESSION)) { |
if (!isset($_SESSION) |
| |
|| strlen(session_id()) == 0) |
| |
{ |
| session_start(); |
session_start(); |
| } |
} |
| |
|