Ignore:
Timestamp:
Sep 12, 2008, 4:17:35 AM (16 years ago)
Author:
rvelices
Message:
  • images.file categories.permalink old_permalinks.permalink - become binary
  • session security improvement: now the sessions are valid only for originating ip addr (with mask 255.255.0.0 to allow users behind load balancing proxies) -> stealing the session cookie is almost a non issue (with the exception of the 65536 machines in range)
  • metadata sync from the sync button does not overwrite valid data with empty metadata
  • other small fixes/enhancements:
    • added event get_category_image_orders
    • fix display issue with redirect.tpl (h1/h2 within h1)
    • fix known_script smarty function registration
    • query search form not submitted if q is empty
    • better admin css rules
    • some other minor changes (ws_core, rest_handler, functions_search...)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_session.inc.php

    r2299 r2521  
    9191}
    9292
     93function get_remote_addr_session_hash()
     94{
     95        return vsprintf( "%02X%02X", explode('.',$_SERVER['REMOTE_ADDR']) );
     96}
     97
    9398/**
    9499 * this function returns
     
    103108SELECT data
    104109  FROM '.SESSIONS_TABLE.'
    105   WHERE id = \''.$session_id.'\'
     110  WHERE id = \''.get_remote_addr_session_hash().$session_id.'\'
    106111;';
    107112  $result = pwg_query($query);
     
    129134  SET expiration = now(),
    130135  data = \''.$data.'\'
    131   WHERE id = \''.$session_id.'\'
     136  WHERE id = \''.get_remote_addr_session_hash().$session_id.'\'
    132137;';
    133138  pwg_query($query);
     
    139144INSERT INTO '.SESSIONS_TABLE.'
    140145  (id,data,expiration)
    141   VALUES(\''.$session_id.'\',\''.$data.'\',now())
     146  VALUES(\''.get_remote_addr_session_hash().$session_id.'\',\''.$data.'\',now())
    142147;';
    143148  mysql_query($query);
     
    155160DELETE
    156161  FROM '.SESSIONS_TABLE.'
    157   WHERE id = \''.$session_id.'\'
     162  WHERE id = \''.get_remote_addr_session_hash().$session_id.'\'
    158163;';
    159164  pwg_query($query);
Note: See TracChangeset for help on using the changeset viewer.