Changeset 21802 for trunk/include/functions_user.inc.php
- Timestamp:
- Mar 23, 2013, 11:50:57 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_user.inc.php
r21801 r21802 827 827 { 828 828 $cache['default_user'] = pwg_db_fetch_assoc($result); 829 829 830 830 unset($cache['default_user']['user_id']); 831 831 unset($cache['default_user']['status']); … … 1126 1126 { 1127 1127 require_once(PHPWG_ROOT_PATH.'include/passwordhash.class.php'); 1128 1128 1129 1129 // We use the portable hash feature from phpass because we can't be sure 1130 1130 // Piwigo runs on PHP 5.3+ (and won't run on an older version in the … … 1132 1132 $pwg_hasher = new PasswordHash(13, true); 1133 1133 } 1134 1134 1135 1135 return $pwg_hasher->HashPassword($password); 1136 1136 } … … 1161 1161 $check = ($hash == md5($password)); 1162 1162 } 1163 1163 1164 1164 if ($check and isset($user_id) and !$conf['external_authentification']) 1165 1165 { … … 1180 1180 { 1181 1181 require_once(PHPWG_ROOT_PATH.'include/passwordhash.class.php'); 1182 1182 1183 1183 // We use the portable hash feature 1184 1184 $pwg_hasher = new PasswordHash(13, true); … … 1201 1201 function pwg_login($success, $username, $password, $remember_me) 1202 1202 { 1203 if ($success===true) 1203 if ($success===true) 1204 1204 { 1205 1205 return true; 1206 1206 } 1207 1207 1208 1208 // we force the session table to be clean 1209 1209 pwg_session_gc(); … … 1232 1232 { 1233 1233 global $conf; 1234 1234 1235 1235 trigger_action('user_logout', @$_SESSION['pwg_uid']); 1236 1236 1237 1237 $_SESSION = array(); 1238 1238 session_unset(); … … 1555 1555 } 1556 1556 1557 /** @return the sql condition to show recent photos/albums based on user preferences and latest available photo.*/ 1558 function 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 1557 1570 /** 1558 1571 * search an available activation_key
Note: See TracChangeset
for help on using the changeset viewer.