Ignore:
Timestamp:
Jan 23, 2007, 2:22:52 AM (17 years ago)
Author:
rvelices
Message:
  • revert feature 564: log the login of each user; but add the possibility to be

done by a plugin

  • create a "standard" way to define PHP functions that we use but might not be

available in the current php version

  • when a comment is rejected (spam, anti-flood etc), put the content back to the

browser in case there is a real user behind it

  • now a comment can be entered only if the page was retrieved between 2 seconds

ago and 1 hour ago

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/identification.php

    r1727 r1744  
    4646{
    4747  $redirect_to = isset($_POST['redirect']) ? $_POST['redirect'] : '';
    48   $username = mysql_escape_string($_POST['username']);
    49   // retrieving the encrypted password of the login submitted
    50   $query = '
    51 SELECT '.$conf['user_fields']['id'].' AS id,
    52        '.$conf['user_fields']['password'].' AS password
    53   FROM '.USERS_TABLE.'
    54   WHERE '.$conf['user_fields']['username'].' = \''.$username.'\'
    55 ;';
    56   $row = mysql_fetch_array(pwg_query($query));
    57   if ($row['password'] == $conf['pass_convert']($_POST['password']))
     48  $remember_me = isset($_POST['remember_me']) and $_POST['remember_me']==1;
     49  if ( try_log_user($_POST['username'], $_POST['password'], $remember_me) )
    5850  {
    59     $remember_me = false;
    60     if (isset($_POST['remember_me'])
    61         and $_POST['remember_me'] == 1)
    62     {
    63       $remember_me = true;
    64     }
    65     log_user($row['id'], $remember_me);
    6651    redirect(empty($redirect_to) ? make_index_url() : $redirect_to);
    6752  }
Note: See TracChangeset for help on using the changeset viewer.