Example #1
0
 /**
  * Checks if CAPTCHA is valid or not. Caches the status so no matter how many times in one instance of application
  * it is checked, it returns true.
  * @param unknown_type $Data
  * @return NULL
  */
 function Validate($Data)
 {
     if ($this->isValid === null) {
         $this->isValid = strtolower($Data) == strtolower(jf::LoadSessionSetting(jFormCaptcha::SettingNamePrefix . $this->Name()));
         jf::DeleteSessionSetting(jFormCaptcha::SettingNamePrefix . $this->Name());
     }
     return $this->isValid;
 }
Example #2
0
 /**
  * Function to remove the stored session data
  *
  * @param string|int $key The key associated with the value
  *
  * @throws ArgumentMissingException If $key is missing
  */
 protected function deleteSessionData($key = null)
 {
     if ($key == null) {
         throw new ArgumentMissingException('Missing key to get session data');
     }
     \jf::DeleteSessionSetting($key);
 }
Example #3
0
 /**
  * @depends testSaveSession
  */
 function testDeleteSession()
 {
     jf::SaveSessionSetting("some_name", "some_value");
     $this->assertTrue(jf::DeleteSessionSetting("some_name"));
 }