Seite 1 von 1

[gelöst]Nach CrackerTrackerInstallation: Login nicht möglich

Verfasst: 25.07.2006 18:45
von mattheXTC
Hallo!

Ich habe CrackerTracker installiert und wenn sich jetzt jemand einloggen will, kommt folgende Fehlermeldung:

Parse error: syntax error, unexpected T_STRING in /var/www/virtual/thepage.freeprojekt.de/forum/htdocs/login.php on line 81

Ich lade hier meine login.php hoch:
http://forum.thepage.freeprojekt.de/login.txt

Ich bitte um Hilfe, da ich selbst nicht mehr ins Forum komme und ehrlich gesagt nicht die ganze Mod nochmal deinstallieren will.

Vielen Dank im Voraus!

MfG

Verfasst: 25.07.2006 18:49
von SoLo1905
Zeile81: normal login without any Confirmation ???

gehört den das auch rein

Code: Alles auswählen

let's do it ;-)
woher hast du den mod leg mal ein download link rein

danke

Verfasst: 26.07.2006 15:08
von mattheXTC
Hier der Download-link der MOD:

http://www.phpbb.de/moddb/crack_track

Ich hoffe jemand kann mir helfen!

Danke!

MfG

Verfasst: 26.07.2006 15:26
von kazwo
Such mal

Code: Alles auswählen

//
			// CBACK CrackerTracker Visual Login Confirmation
			// visual confirmation code Generator taken from phpBB (c) phpBB Group
			//
			if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
			{
				$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] 

: $HTTP_POST_VARS['mode'];
				$mode = htmlspecialchars($mode);

				if ( $mode == 'confirm' )
				{
					if ( $userdata['session_logged_in'] )
					{
						exit;
					}
					include($phpbb_root_path . 'ctracker/ct_confirm.'.$phpEx);
					exit;
			    }
			}

			//
			// Now we check if the User is trying to Log in if he already has used one 

attempt or not
			// if not we disable the Visual Confirmation Code and with this we allow a 

normal login without any Confirmation
			// if the User tried to log in once we just continue with the normal 

Script and then we show the Visible Code every time the user
			// tries to log in before checking Password or anything.
			// Well OK its more DB gaming but many users want comfort AND security so 

let's do it ;-)
			//
			if(!empty($HTTP_POST_VARS['username']) && $ctracker_config['loginfeature'] 

== 1)
			{
			  $secure_username = '';
			  $secure_username = isset($HTTP_POST_VARS['username']) ? 

phpbb_clean_username($HTTP_POST_VARS['username']) : '';
			  $sql = "SELECT ct_logintry FROM " . USERS_TABLE . " WHERE username = '" 

. str_replace("\\'", "''", $secure_username) . "'";
			  if ( !($result = $db->sql_query($sql)) )
			  {
			    message_die(GENERAL_ERROR, 'Error in obtaining userdata', '', 

__LINE__, __FILE__, $sql);
			  }
			  if( $row = $db->sql_fetchrow($result) )
		      {
			    if($row['ct_logintry'] == 0)
				{
				  $ctracker_config['loginfeature'] = 0;
				}
		      } 
			}
			else
			{
			  $ctracker_config['loginfeature'] = 0;
			}

            if ( $ctracker_config['loginfeature'] == 1 && !$userdata['session_logged_in'] && 

!empty($HTTP_POST_VARS['confirm_id']) && !empty($HTTP_POST_VARS['confirm_code']))
			{
                    $confirm_id = htmlspecialchars($HTTP_POST_VARS['confirm_id']);			

		if (!preg_match('/^[A-Za-z0-9]+$/', $confirm_id))
					{
						$confirm_id = '';
					}

					$sql = 'SELECT code
						FROM ' . CTVISKEY . "
						WHERE confirm_id = '$confirm_id'
							AND session_id = '" . 

$userdata['session_id'] . "'";
					if (!($result = $db->sql_query($sql)))
					{
						message_die(GENERAL_ERROR, 'Could not obtain 

confirmation code', __LINE__, __FILE__, $sql);
					}

					if ($row = $db->sql_fetchrow($result))
					{
						if ($row['code'] != 

$HTTP_POST_VARS['confirm_code'])
						{
                            message_die(GENERAL_MESSAGE, $lang['ct_forum_sl1']);
						}
						else
						{
							$sql = 'DELETE FROM ' . CTVISKEY . "
								WHERE confirm_id = '$confirm_id'
									AND session_id = '" . 

$userdata['session_id'] . "'";
							if (!$db->sql_query($sql))
							{
								message_die(GENERAL_ERROR, 'Could 

not delete confirmation code', __LINE__, __FILE__, $sql);
							}
						}
					}
					else
					{
                            message_die(GENERAL_MESSAGE, $lang['ct_forum_sl1']);
					}
					$db->sql_freeresult($result);
			}

            $vcheck_need  = FALSE;
            $vcheck_login = TRUE;
            if($ctracker_config['loginfeature'] == 1 )
            {
              $vcheck_need = TRUE;
              $vcheck_login = FALSE;
            }

            if (($vcheck_need = FALSE || $userdata['session_logged_in']) or 

(isset($HTTP_GET_VARS['logout']) || !empty($HTTP_POST_VARS['confirm_id']) && 

!empty($HTTP_POST_VARS['confirm_code'])))
		  	{
			  $vcheck_login = TRUE;
		  	}
und ersetze mit

Code: Alles auswählen

//
			// CBACK CrackerTracker Visual Login Confirmation
			// visual confirmation code Generator taken from phpBB (c) phpBB Group
			//
			if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
			{
				$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
				$mode = htmlspecialchars($mode);

				if ( $mode == 'confirm' )
				{
					if ( $userdata['session_logged_in'] )
					{
						exit;
					}
					include($phpbb_root_path . 'ctracker/ct_confirm.'.$phpEx);
					exit;
			    }
			}

			//
			// Now we check if the User is trying to Log in if he already has used one attempt or not
			// if not we disable the Visual Confirmation Code and with this we allow a normal login without any Confirmation
			// if the User tried to log in once we just continue with the normal Script and then we show the Visible Code every time the user
			// tries to log in before checking Password or anything.
			// Well OK its more DB gaming but many users want comfort AND security so let's do it ;-)
			//
			if(!empty($HTTP_POST_VARS['username']) && $ctracker_config['loginfeature'] == 1)
			{
			  $secure_username = '';
			  $secure_username = isset($HTTP_POST_VARS['username']) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
			  $sql = "SELECT ct_logintry FROM " . USERS_TABLE . " WHERE username = '" . str_replace("\\'", "''", $secure_username) . "'";
			  if ( !($result = $db->sql_query($sql)) )
			  {
			    message_die(GENERAL_ERROR, 'Error in obtaining userdata', '', __LINE__, __FILE__, $sql);
			  }
			  if( $row = $db->sql_fetchrow($result) )
		      {
			    if($row['ct_logintry'] == 0)
				{
				  $ctracker_config['loginfeature'] = 0;
				}
		      } 
			}
			else
			{
			  $ctracker_config['loginfeature'] = 0;
			}

            if ( $ctracker_config['loginfeature'] == 1 && !$userdata['session_logged_in'] && !empty($HTTP_POST_VARS['confirm_id']) && !empty($HTTP_POST_VARS['confirm_code']))
			{
                    $confirm_id = htmlspecialchars($HTTP_POST_VARS['confirm_id']);					if (!preg_match('/^[A-Za-z0-9]+$/', $confirm_id))
					{
						$confirm_id = '';
					}

					$sql = 'SELECT code
						FROM ' . CTVISKEY . "
						WHERE confirm_id = '$confirm_id'
							AND session_id = '" . $userdata['session_id'] . "'";
					if (!($result = $db->sql_query($sql)))
					{
						message_die(GENERAL_ERROR, 'Could not obtain confirmation code', __LINE__, __FILE__, $sql);
					}

					if ($row = $db->sql_fetchrow($result))
					{
						if ($row['code'] != $HTTP_POST_VARS['confirm_code'])
						{
                            message_die(GENERAL_MESSAGE, $lang['ct_forum_sl1']);
						}
						else
						{
							$sql = 'DELETE FROM ' . CTVISKEY . "
								WHERE confirm_id = '$confirm_id'
									AND session_id = '" . $userdata['session_id'] . "'";
							if (!$db->sql_query($sql))
							{
								message_die(GENERAL_ERROR, 'Could not delete confirmation code', __LINE__, __FILE__, $sql);
							}
						}
					}
					else
					{
                            message_die(GENERAL_MESSAGE, $lang['ct_forum_sl1']);
					}
					$db->sql_freeresult($result);
			}

            $vcheck_need  = FALSE;
            $vcheck_login = TRUE;
            if($ctracker_config['loginfeature'] == 1 )
            {
              $vcheck_need = TRUE;
              $vcheck_login = FALSE;
            }

            if (($vcheck_need = FALSE || $userdata['session_logged_in']) or (isset($HTTP_GET_VARS['logout']) || !empty($HTTP_POST_VARS['confirm_id']) && !empty($HTTP_POST_VARS['confirm_code'])))
		  	{
			  $vcheck_login = TRUE;
		  	}

Verfasst: 26.07.2006 15:41
von mattheXTC
Jetzt bekomme ich die gleiche Fehlermeldung, nur mit einer anderen Zeilenangabe:

Parse error: syntax error, unexpected T_STRING in /var/www/virtual/thepage.freeprojekt.de/forum/htdocs/login.php on line 104/u]

Ich habe die neue login.php wieder hochgeladen:

http://forum.thepage.freeprojekt.de/login2.txt

Ich bitte weiterhin um Hilfe!

MfG

Verfasst: 26.07.2006 18:06
von kazwo
Suche

Code: Alles auswählen

if ($row['user_id'] != ANONYMOUS)
					{
						$sql = 'UPDATE ' . USERS_TABLE . '
							SET ct_logintry = 1
							WHERE user_id = ' . $row['user_id'];
  	    					
						if( !$db->sql_query($sql))
  	    					{
	    					  message_die(CRITICAL_ERROR, "Could not perform 

Database operation", "", __LINE__, __FILE__, $sql);
          					}
					}
ersetze mit

Code: Alles auswählen

if ($row['user_id'] != ANONYMOUS)
					{
						$sql = 'UPDATE ' . USERS_TABLE . '
							SET ct_logintry = 1
							WHERE user_id = ' . $row['user_id'];
  	    					
						if( !$db->sql_query($sql))
  	    					{
	    					  message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
          					}
					}
irgendwie sind da Absätze reingekommen, die da nicht reingehören.
Abgesehen davon, sieht das richtig aus....Probier das nochmal, wenns nich hilft, sag bescheid

Verfasst: 26.07.2006 19:02
von mattheXTC
Ich habe die Änderung durchgeführt, aber der Fehler ist der gleiche! :(

Ich hoffe, dass du mir weiterhin hilfst; und wenn du noch andere Dateien brauchst, sag bescheid!

Danke!

MfG

Verfasst: 26.07.2006 19:22
von kazwo
Probiers mal hiermit

*nichtmehrvorhanden*

Verfasst: 27.07.2006 10:56
von mattheXTC
Vielen herzlichen Dank, der Login funktioniert mit der neuen login.php wieder einwandfrei!

Vielen Dank für die tolle Hilfe!

MfG