
---------- FINDE -----------
 $confirm_chars = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9');
------------ ERSETZE MIT ---------
 $confirm_chars = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9');

#
#----------[ OPEN ]-------------------------------------
#
contact_form.php
#
#----------[ FIND ]-------------------------------------
#
$hidden_form_fields = '';
// 
// Visual confirmation for guests 
// 
$confirm_image = ''; 
if( !$userdata['session_logged_in'] && (!empty($board_config['enable_confirm'])) ) 
{ 
   $sql = 'SELECT session_id 
      FROM ' . SESSIONS_TABLE; 
   if (!($result = $db->sql_query($sql))) 
   { 
      message_die(GENERAL_ERROR, 'Could not select session data', '', __LINE__, __FILE__, $sql); 
   } 
    
   if ($row = $db->sql_fetchrow($result)) 
   { 
      $confirm_sql = ''; 
      do 
      { 
         $confirm_sql .= (($confirm_sql != '') ? ', ' : '') . "'" . $row['session_id'] . "'"; 
      } 
      while ($row = $db->sql_fetchrow($result)); 
    
      $sql = 'DELETE FROM ' .  CONFIRM_TABLE . " 
         WHERE session_id NOT IN ($confirm_sql)"; 
      if (!$db->sql_query($sql)) 
      { 
         message_die(GENERAL_ERROR, 'Could not delete stale confirm data', '', __LINE__, __FILE__, $sql); 
      } 
   } 
   $db->sql_freeresult($result); 
    
   $confirm_chars = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9'); 
    
   list($usec, $sec) = explode(' ', microtime()); 
   mt_srand($sec * $usec); 
    
   $max_chars = count($confirm_chars) - 1; 
   $code = ''; 
   for ($i = 0; $i < 6; $i++) 
   { 
      $code .= $confirm_chars[mt_rand(0, $max_chars)]; 
   } 
    
   $confirm_id = md5(uniqid($user_ip)); 
    
   $sql = 'INSERT INTO ' . CONFIRM_TABLE . " (confirm_id, session_id, code) 
      VALUES ('$confirm_id', '". $userdata['session_id'] . "', '$code')"; 
   if (!$db->sql_query($sql)) 
   { 
      message_die(GENERAL_ERROR, 'Could not insert new confirm code information', '', __LINE__, __FILE__, $sql); 
   } 
    
   unset($code); 
    
   $confirm_image = '<img src="' . append_sid("profile.$phpEx?mode=confirm&id=$confirm_id") . '" alt="" title="" />';
   $hidden_form_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />'; 
    
   $template->assign_block_vars('switch_confirm', array()); 
} 
$hidden_form_fields .= '<input type="hidden" name="mode" value="send" /> ';
#
#----------[ REPLACE WITH ]-------------------------------
#
$hidden_form_fields = '';
// 
// Visual confirmation for guests 
// 
$confirm_image = ''; 
if( !$userdata['session_logged_in'] && (!empty($board_config['enable_confirm'])) ) 
{ 
      $sql = 'SELECT session_id 
         FROM ' . SESSIONS_TABLE; 
      if (!($result = $db->sql_query($sql)))
      {
         message_die(GENERAL_ERROR, 'Could not select session data', '', __LINE__, __FILE__, $sql);
      }
      if ($row = $db->sql_fetchrow($result))
      {
         $confirm_sql = '';
         do
         {
            $confirm_sql .= (($confirm_sql != '') ? ', ' : '') . "'" . $row['session_id'] . "'";
         }
         while ($row = $db->sql_fetchrow($result));
      
         $sql = 'DELETE FROM ' .  CONFIRM_TABLE . " 
            WHERE session_id NOT IN ($confirm_sql)";
         if (!$db->sql_query($sql))
         {
            message_die(GENERAL_ERROR, 'Could not delete stale confirm data', '', __LINE__, __FILE__, $sql);
         }
      }
      $db->sql_freeresult($result);
      $sql = 'SELECT COUNT(session_id) AS attempts 
         FROM ' . CONFIRM_TABLE . " 
         WHERE session_id = '" . $userdata['session_id'] . "'";
      if (!($result = $db->sql_query($sql)))
      {
         message_die(GENERAL_ERROR, 'Could not obtain confirm code count', '', __LINE__, __FILE__, $sql);
      }
      if ($row = $db->sql_fetchrow($result))
      {
         if ($row['attempts'] > 3)
         {
            message_die(GENERAL_MESSAGE, $lang['Too_many_registers']);
         }
      }
      $db->sql_freeresult($result);
      
      // Generate the required confirmation code
      $code_length = mt_rand(4, 6);
      $code = dss_rand();
      $code = strtoupper(base_convert($code, 16, 35));
      $code = str_replace('I', '', $code); // The letter I could get confused with the letter J and the number 1 (one) so we remove it
      $code = str_replace('0', '', $code); // NB 0 (zero) could get confused with O (the letter) so we remove it
      $code = substr($code, 2, $code_length);
      $confirm_id = md5(uniqid($user_ip));
      $sql = 'INSERT INTO ' . CONFIRM_TABLE . " (confirm_id, session_id, code) 
         VALUES ('$confirm_id', '". $userdata['session_id'] . "', '$code')";
      if (!$db->sql_query($sql))
      {
         message_die(GENERAL_ERROR, 'Could not insert new confirm code information', '', __LINE__, __FILE__, $sql);
      }
      unset($code);
      
      $confirm_image = '<img src="' . append_sid("profile.$phpEx?mode=confirm&id=$confirm_id") . '" alt="" title="" />';
        $hidden_form_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />'; 
    
   $template->assign_block_vars('switch_confirm', array()); 
} 
$hidden_form_fields .= '<input type="hidden" name="mode" value="send" /> ';
#
#----------[ SAVE AND CLOSE ALL FILES ]-----------------
#
# EoM 


 
 






Zurück zu Advanced Visual Confirmation
Mitglieder in diesem Forum: 0 Mitglieder und 5 Gäste