/**
  * Tries to read the auth code from the GET/POST data array or
  * from the session.
  *
  * @return string
  */
 public function getAuthCode()
 {
     $authCode = '';
     // We need to use the global GET/POST variables because if the form is not submitted $this->gp will be empty
     // because \Tx_Formhandler_Controller_Form::reset() is called.
     $formValuesPrefix = $this->globals->getFormValuesPrefix();
     if (empty($formValuesPrefix)) {
         $authCode = GeneralUtility::_GP('authCode');
     } else {
         $gpArray = GeneralUtility::_GP($formValuesPrefix);
         if (is_array($gpArray) && array_key_exists('authCode', $gpArray)) {
             $authCode = $gpArray['authCode'];
         }
     }
     if (empty($authCode)) {
         $authCode = $this->getAuthCodeFromSession();
     }
     return $authCode;
 }
 public function generateRandomID()
 {
     $randomID = md5($this->globals->getFormValuesPrefix() . \TYPO3\CMS\Core\Utility\GeneralUtility::generateRandomBytes(10));
     return $randomID;
 }
 public static function generateRandomID()
 {
     $randomID = md5(\Typoheads\Formhandler\Utility\Globals::getFormValuesPrefix() . \TYPO3\CMS\Core\Utility\GeneralUtility::generateRandomBytes(10));
     return $randomID;
 }