easyUCP mit AVC MOD

Forum_easyUCP_Desc

easyUCP mit AVC MOD

Beitragvon Christian_N » 31. Aug 2006 14:04

Hallo Amigalink,
hab gerade den AVC eingebaut auf ne testseite wo der easyUCP MOD installiert ist, da fiel mir allerdings auf das die änderrung in der usercp_register.php
Code: Alles auswählen
#
#----------[ FIND ]-------------------------------------
#

      // Generate the required confirmation code
      // NB 0 (zero) could get confused with O (the letter) so we make change it
      $code = dss_rand();
      $code = substr(str_replace('0', 'Z', strtoupper(base_convert($code, 16, 35))), 2, 6);

#
#----------[ REPLACE WITH ]-----------------------------
#

      // 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);
nichts bringen, da dieser teil vom VC kompett vom easyUCP /* auskommentiert */ wurde und etwas oben der easyUCP MOD diese einsetzt
Code: Alles auswählen
   if ( $ucp_mode == 'ucp_require' || $ucp_mode == '' )
   {
      $template->assign_block_vars('switch_ucp_require', array() );
      if ( $mode == 'editprofile' )
      {
         $template->assign_block_vars('switch_ucp_require.switch_edit_profile', array());
      }
      if ( ($mode == 'register') || ($board_config['allow_namechange']) )
      {
         $template->assign_block_vars('switch_ucp_require.switch_namechange_allowed', array());
      }
      else
      {
         $template->assign_block_vars('switch_ucp_require.switch_namechange_disallowed', array());
      }
         // Visual Confirmation
         $confirm_image = '';
         if (!empty($board_config['enable_confirm']) && $mode == 'register')
         {
            $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);
             
            $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 = (@extension_loaded('zlib')) ? '<img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id") . '" alt="" title="" />' : '<img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=1") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=2") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=3") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=4") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=5") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=6") . '" alt="" title="" />';
            $s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />';

            $template->assign_block_vars('switch_ucp_require.switch_confirm', array());
         }
   }
Nur da ist die Zeile die gefunden werden soll nicht dabei, um diese zu ersetzen, somit zeigt er auch des I weiter an und es variiert nicht der Code. Daher die frage was kann man genau bei dem im easyUCP alles ändern damit der AVC auch 100% läuft?
Chantals - Fanpage :: http://www.chantals-fanpage.de
Benutzeravatar
Christian_N
User
 
Beiträge: 524
Registriert: 31. Mai 2005 00:17
Wohnort: Deutschland

Beitragvon AmigaLink » 31. Aug 2006 14:36

Ich muss die Installationsanleitung des easyUCP mal ans aktuelle 2.0.21 anpassen. :roll: (Leider fehlt die Zeit für sowas.)

Der vom easyUCP Auskommentierte VC Teil wird an anderer stelle wieder eingesetzt (das ist der von die gepostete Teil). Der wieder eingesetzt Code ist aber noch der des phpBB 2.0.18 und muss somit erstmal auf den aktuellen upgedatet werden. ;)

Code: Alles auswählen
#
#----------[ OPEN ]-------------------------------------
#

includes/usercp_register.php

#
#----------[ FIND ]-------------------------------------
#

         // Visual Confirmation
         $confirm_image = '';
         if (!empty($board_config['enable_confirm']) && $mode == 'register')
         {
            $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);
             
            $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);

#
#----------[ REPLACE WITH ]-----------------------------
#

         // Visual Confirmation
         $confirm_image = '';
         if (!empty($board_config['enable_confirm']) && $mode == 'register')
         {
            $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
            // NB 0 (zero) could get confused with O (the letter) so we make change it
            $code = dss_rand();
            $code = substr(str_replace('0', 'Z', strtoupper(base_convert($code, 16, 35))), 2, 6);
            $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);

#
#----------[ SAVE AND CLOSE ALL FILES ]-----------------
#
# EoM


Wer den easyUCP bereits drin hatte, als er sein Board upgedatet hat. Müsste das Automatisch richtig gemacht haben.
Aber wer, so wie du, den easyUCP erst später eingebaut hat. Hat da evtl. ein kleines Problem. Es sei denn derjenige hat soviel Erfahrung das ihm der Unterschied auffällt.
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon Christian_N » 31. Aug 2006 15:09

Danke, das wollt ich nur wissen, so dumm bin ich auch nicht und hab etwas erfahrung, hab auch deshalb schonmal vorweg den teil aus dem auskommentiertes kopiert und in den teil vom easyUCP eingesetzt, so 1:1 also, und dann dort die änderrung vom AVC MOD gemacht. sieht jetzt so aus
Code: Alles auswählen
   if ( $ucp_mode == 'ucp_require' || $ucp_mode == '' )
   {
      $template->assign_block_vars('switch_ucp_require', array() );
      if ( $mode == 'editprofile' )
      {
         $template->assign_block_vars('switch_ucp_require.switch_edit_profile', array());
      }
      if ( ($mode == 'register') || ($board_config['allow_namechange']) )
      {
         $template->assign_block_vars('switch_ucp_require.switch_namechange_allowed', array());
      }
      else
      {
         $template->assign_block_vars('switch_ucp_require.switch_namechange_disallowed', array());
      }
      // Visual Confirmation
   $confirm_image = '';
   if (!empty($board_config['enable_confirm']) && $mode == 'register')
   {
      $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&amp;id=$confirm_id") . '" alt="" title="" />';
      $s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />';

   $template->assign_block_vars('switch_ucp_require.switch_confirm', array());
         }
   }
Wenn ich jetzt dein Code anschaun dürfte es sogar so richtig sein, wollt allerdings nur auf ne nummer sicher gehn :)

Wobei ich im gesatz zu dein code auch noch die reihe
Code: Alles auswählen
            $confirm_image = (@extension_loaded('zlib')) ? '<img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id") . '" alt="" title="" />' : '<img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=1") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=2") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=3") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=4") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=5") . '" alt="" title="" /><img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id&amp;c=6") . '" alt="" title="" />';
in
Code: Alles auswählen
      $confirm_image = '<img src="' . append_sid("profile.$phpEx?mode=confirm&amp;id=$confirm_id") . '" alt="" title="" />';
habe da so es auch im normale VC ist und wenn man so Add-ONs anschaun hier wo immermal gefragt wird falls diese ein VC nutzt wie login .php durch CT v. =< 4 oder bei Guest posting etc. das dann immer auch diese änderrung mir auffiel dort :D

Zugefügt nach 1 Minute(n):

Naja das mit dem anpasse, ist schon so eine sache wenn man die Zeit nicht zu hat, irgendwoher kenn ich es nur allzu gut :D Aba in der neue version ist es sicher angepasst falls dann nicht phpBB sich irgendwelche änderrung wieder einfallen lassen :o
Chantals - Fanpage :: http://www.chantals-fanpage.de
Benutzeravatar
Christian_N
User
 
Beiträge: 524
Registriert: 31. Mai 2005 00:17
Wohnort: Deutschland

Beitragvon AmigaLink » 31. Aug 2006 20:26

Ja, das ist vollkommen richtig so. :)

Der Code den ich gepostet habe, war generell noch ohne AVC Änderung. Schließlich ist es ein easyUCP update. ;)
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW


Zurück zu easy UCP



Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 11 Gäste

cron