Ignore:
Timestamp:
Mar 23, 2013, 11:50:57 AM (11 years ago)
Author:
rvelices
Message:

feature 2557 recent photos/albums should never be empty

File:
1 edited

Legend:

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

    r21801 r21802  
    827827    {
    828828      $cache['default_user'] = pwg_db_fetch_assoc($result);
    829      
     829
    830830      unset($cache['default_user']['user_id']);
    831831      unset($cache['default_user']['status']);
     
    11261126  {
    11271127    require_once(PHPWG_ROOT_PATH.'include/passwordhash.class.php');
    1128    
     1128
    11291129    // We use the portable hash feature from phpass because we can't be sure
    11301130    // Piwigo runs on PHP 5.3+ (and won't run on an older version in the
     
    11321132    $pwg_hasher = new PasswordHash(13, true);
    11331133  }
    1134  
     1134
    11351135  return $pwg_hasher->HashPassword($password);
    11361136}
     
    11611161      $check = ($hash == md5($password));
    11621162    }
    1163    
     1163
    11641164    if ($check and isset($user_id) and !$conf['external_authentification'])
    11651165    {
     
    11801180  {
    11811181    require_once(PHPWG_ROOT_PATH.'include/passwordhash.class.php');
    1182    
     1182
    11831183    // We use the portable hash feature
    11841184    $pwg_hasher = new PasswordHash(13, true);
     
    12011201function pwg_login($success, $username, $password, $remember_me)
    12021202{
    1203   if ($success===true) 
     1203  if ($success===true)
    12041204  {
    12051205    return true;
    12061206  }
    1207  
     1207
    12081208  // we force the session table to be clean
    12091209  pwg_session_gc();
     
    12321232{
    12331233  global $conf;
    1234  
     1234
    12351235  trigger_action('user_logout', @$_SESSION['pwg_uid']);
    1236  
     1236
    12371237  $_SESSION = array();
    12381238  session_unset();
     
    15551555}
    15561556
     1557/** @return the sql condition to show recent photos/albums based on user preferences and latest available photo.*/
     1558function get_recent_photos_sql($db_field)
     1559{
     1560  global $user;
     1561  if (!isset($user['last_photo_date']))
     1562  {
     1563    return '0=1';
     1564  }
     1565  return $db_field.'>=LEAST('
     1566    .pwg_db_get_recent_period_expression($user['recent_period'])
     1567    .','.pwg_db_get_recent_period_expression(1,$user['last_photo_date']).')';
     1568}
     1569
    15571570/**
    15581571 * search an available activation_key
Note: See TracChangeset for help on using the changeset viewer.