Changeset 224


Ignore:
Timestamp:
Jan 9, 2007 12:47:08 AM (17 years ago)
Author:
quinn
Message:

fixed bug: PHP Notice: Undefined index: authenticated.

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Auth_SQL.inc.php

    r203 r224  
    529529
    530530        // Test login with information stored in session. Skip IP matching for users from trusted networks.
    531         if (isset($_SESSION['_auth_sql'][$this->_ns])
     531        if (isset($_SESSION['_auth_sql'][$this->_ns]['authenticated'])
    532532            && true === $_SESSION['_auth_sql'][$this->_ns]['authenticated']
    533533            && !empty($_SESSION['_auth_sql'][$this->_ns]['username'])
     
    552552                $app->logMsg(sprintf('User update failed. Record not found for user %s (%s).', $this->get('user_id'), $this->get('username')), LOG_NOTICE, __FILE__, __LINE__);
    553553            }
    554         } else if (isset($_SESSION['_auth_sql'][$this->_ns]) && true === $_SESSION['_auth_sql'][$this->_ns]['authenticated']) {
     554        } else if (isset($_SESSION['_auth_sql'][$this->_ns]['authenticated']) && true === $_SESSION['_auth_sql'][$this->_ns]['authenticated']) {
    555555            // User is authenticated, but login has expired.
    556556            if (strtotime($_SESSION['_auth_sql'][$this->_ns]['last_access_datetime']) > time() - 43200) {
  • trunk/lib/ImageThumb.inc.php

    r204 r224  
    521521        // Create source image data in memory.
    522522        switch ($source_image_type) {
    523         case IMAGETYPE_JPEG :
     523        case IMAGETYPE_JPEG : // = 2
    524524            $source_image_resource = imagecreatefromjpeg($source_file);
    525525            break;
    526         case IMAGETYPE_PNG :
     526        case IMAGETYPE_PNG : // = 3
    527527            $source_image_resource = imagecreatefrompng($source_file);
    528528            break;
    529         case IMAGETYPE_GIF :
     529        case IMAGETYPE_GIF : // = 1
    530530            $source_image_resource = imagecreatefromgif($source_file);
    531531            break;
    532         case IMAGETYPE_WBMP :
     532        case IMAGETYPE_WBMP : // = 15
    533533            $source_image_resource = imagecreatefromwbmp($source_file);
     534        case IMAGETYPE_SWF : // = 4
     535        case IMAGETYPE_PSD : // = 5
     536        case IMAGETYPE_BMP : // = 6
     537        case IMAGETYPE_TIFF_II : // = 7
     538        case IMAGETYPE_TIFF_MM : // = 8
     539        case IMAGETYPE_JPC : // = 9
     540        case IMAGETYPE_JP2 : // = 10
     541        case IMAGETYPE_JPX : // = 11
     542        case IMAGETYPE_JB2 : // = 12
     543        case IMAGETYPE_SWC : // = 13
     544        case IMAGETYPE_IFF : // = 14
     545        case IMAGETYPE_XBM : // = 16
    534546        default :
    535547            $app->logMsg(sprintf('Source image type %s not supported.', $source_image_type), LOG_WARNING, __FILE__, __LINE__);
  • trunk/lib/Utilities.inc.php

    r219 r224  
    524524 * @return string         Comma list of array values.
    525525 */
    526 function escapedList($in)
     526function escapedList($in, $separator="', '")
    527527{
    528528    $db =& DB::getInstance();
    529529   
    530530    if (is_array($in) && !empty($in)) {
    531         return "'" . join("', '", array_map(array($db, 'escapeString'), $in)) . "'";
     531        return join($separator, array_map(array($db, 'escapeString'), $in));
    532532    } else {
    533533        return $db->escapeString($in);
     
    549549    // Translate the human string date into SQL-safe date format.
    550550    if (empty($date) || strpos($date, '0000-00-00') !== false || strtotime($date) === -1 || strtotime($date) === false) {
    551         return '0000-00-00';
     551        // Return a string of zero time, formatted the same as $format.
     552        return strtr($format, array(
     553            'Y' => '0000',
     554            'm' => '00',
     555            'd' => '00',
     556            'H' => '00',
     557            'i' => '00',
     558            's' => '00',
     559        ));
    552560    } else {
    553561        return date($format, strtotime($date));
Note: See TracChangeset for help on using the changeset viewer.