[HILFE][HELP]Problem mit einer Brücke / problem with a bridge !!!

Started by Sefiroth, November 03, 2011, 12:28:28 PM

Previous topic - Next topic

Sefiroth

Hallo zusammen,

ich habe hier ein Problem, und zwar betreibe ich ein Homepage Projekt mit einer Accountverwaltung, und nutze dazu Simple Portal. Da ich damals noch eine alte Version genutzt habe, ist mein Code derzeitig nicht mehr Aktuell, meine Frage ist, ob mir jemand den Code anpassen kann bitte...


BRIDGE.PHP

Quote<?php
die();
global $config, $context;
session_start();
include_once('accountcenter/global.php');
mysql_init();

if(empty($_SESSION['ACCOUNT']) && $_REQUEST['process'] == "create")
{
  $_SESSION['ACCOUNT'] = GetAccountByCreator($context['user']['username']);
  if(!empty($_POST['username']) && !empty($_POST['password'])
     && !$_SESSION['ACCOUNT'])
  {
          if(IsIPRangeBanned($_SERVER['REMOTE_ADDR']))
          {
            echo '<center><font color=red>'.$lngErrorTxt[IP_BANNED].
                 '</font></center>';
          }
          else if(!GetAccountByName($_POST['username'])
              && $_POST['password'] == $_POST['password2']
            )
          {
              $Name = ChangeToValidString($_POST['username']);
             
              CreateAccount($Name, $_POST['password'],
                            $context['user']['username']);
             
              $_SESSION['ACCOUNT'] =
              GetAccountByCreator($context['user']['username']);
          }
          else
            echo '<center><font color=red>'.$lngErrorTxt[CREATION_FAILED].
                 '</font></center>';
  }
}
else if(empty($_SESSION['ACCOUNT']))
{
  $_SESSION['ACCOUNT'] = GetAccountByCreator($context['user']['username']);
  if(!empty($_POST['username']) && !empty($_POST['password'])
     && !$_SESSION['ACCOUNT'])
  {
       
      if(IsAccountWithRightPasswd($_POST['username'],$_POST['password']))
      {
         $account = GetAccountByName($_POST['username']);
         if(empty($account['CREATED_BY']))
         {
            SetCreatedBy($account['ID'], $context['user']['username']);
           
            $_SESSION['ACCOUNT'] =
            GetAccountByCreator($context['user']['username']);
         }
         else
         {
            require('accountcenter/login.php');
            echo '<center><font color=red>'.$lngErrorTxt[ACC_ASSIGNED].
                 '</font></center>';
         }
      }
      else
      {
         require('accountcenter/login.php');
         echo '<center><font color=red>'.$lngErrorTxt[WRONG_USER_OR_PASS].
              '</font></center>';
      }
  }
  else if(!$_SESSION['ACCOUNT'])
    require('accountcenter/login.php');

  if(!empty($_SESSION['ACCOUNT']))
        Init();
}

if(!empty($_SESSION['ACCOUNT']))
{
       require('accountcenter/main.php');
}
mysql_final();

?>



b]MYSQL.PHP[/b]

Quote<?php

function mysql_init()
{
  global $db, $config;
  $db = @mysql_connect($config['mysql_host'], $config['mysql_user'], $config['mysql_pass']);
  if(!$db)
    die("Could not connect to Database Server!");
  mysql_query("SET NAMES 'utf8'");
  mysql_query("SET CHARACTER SET 'utf8'");

}

function mysql_final()
{
  global $db;
  mysql_close($db);
}

function execute_query_logon($Query, $Once = TRUE)
{
  global $db, $config, $debug, $msg, $error;
  mysql_select_db($config['logon_dbname'], $db);
  $get = mysql_query($Query, $db);
  if($debug)
  {
     $msg[] = 'EXECUTING LOGON QUERY: '.$Query.'';
       $m_error = mysql_error();
   if(!empty($m_error))
      $error[] = $m_error.'<br/>';
  }
  if(!$get)
    return FALSE;
  if($Once == FALSE)
    return $get;

  return @mysql_fetch_array($get, MYSQL_ASSOC);
}

function execute_query_world($Query, $RealmID, $Once = TRUE)
{
  global $db, $config, $debug, $msg, $error;
  mysql_select_db($config['realms'][$RealmID]['world'], $db);
  $get = mysql_query($Query, $db);
  if($debug)
  {
     $msg[] = 'EXECUTING QUERY ON '.$config['realms'][$RealmID]['world'].': '.$Query.'';
       $m_error = mysql_error();
   if(!empty($m_error))
      $error[] = $m_error.'<br/>';
  }
  if(!$get)
    return FALSE;
  if($Once == FALSE)
    return $get;
 
  return mysql_fetch_array($get, MYSQL_ASSOC);
}

function execute_query_chars($Query, $RealmID, $Once = TRUE)
{
  global $db, $config, $debug, $msg, $error;
  mysql_select_db($config['realms'][$RealmID]['chars'], $db);
  $get = mysql_query($Query, $db);
  if($debug)
  {
     $msg[] = 'EXECUTING QUERY ON '.$config['realms'][$RealmID]['chars'].': '.$Query.'';
       $m_error = mysql_error();
   if(!empty($m_error))
      $error[] = $m_error.'<br/>';
  }
  if(!$get)
    return FALSE;
    if($Once == FALSE)
    return $get;
 
  return mysql_fetch_array($get, MYSQL_ASSOC);
}








?>


Kann das wer anpassen ?

Vielen Dank.


Advertisement: