Changeset 6604 for trunk/include/dblayer


Ignore:
Timestamp:
Jun 25, 2010, 9:43:44 PM (14 years ago)
Author:
nikrou
Message:

Bug 1744 fixed : Incorrect use of timezone with SQLite
Fixed anti-flood system.

Need refactoring between each interval functions

Location:
trunk/include/dblayer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/dblayer/functions_mysql.inc.php

    r6578 r6604  
    561561 */
    562562
    563 
    564563function pwg_db_get_recent_period_expression($period, $date='CURRENT_DATE')
    565564{
     
    581580}
    582581
     582function pwg_db_get_flood_period_expression($seconds)
     583{
     584  return 'SUBDATE(now(), INTERVAL '.$seconds.' SECOND)';
     585}
     586
    583587function pwg_db_get_hour($date)
    584588{
  • trunk/include/dblayer/functions_pdo-sqlite.inc.php

    r6580 r6604  
    500500}
    501501
     502function pwg_db_get_flood_period_expression($seconds)
     503{
     504  return 'datetime(\'now\', \'localtime\', \''.-$seconds.' seconds\')';
     505}
     506
    502507function pwg_db_get_hour($date)
    503508{
  • trunk/include/dblayer/functions_pgsql.inc.php

    r6591 r6604  
    547547}
    548548
     549function pwg_db_get_flood_period_expression($seconds)
     550{
     551  return 'now() - \''.$seconds.' SECOND\'::interval';
     552}
     553
    549554function pwg_db_get_hour($date)
    550555{
  • trunk/include/dblayer/functions_sqlite.inc.php

    r6580 r6604  
    512512}
    513513
     514function pwg_db_get_flood_period_expression($seconds)
     515{
     516  return 'datetime(\'now\', \'localtime\', \''.-$seconds.' seconds\')';
     517}
     518
    514519function pwg_db_get_hour($date)
    515520{
Note: See TracChangeset for help on using the changeset viewer.