roundcubemail/program/lib/Roundcube/rcube_utils.php
public static function remote_ip()
    {
        $address = $_SERVER['REMOTE_ADDR'];

        // append the NGINX X-Real-IP header, if set
        if (!empty($_SERVER['HTTP_X_REAL_IP'])) {
            $remote_ip[] = 'X-Real-IP: ' . $_SERVER['HTTP_X_REAL_IP'];
        }

        // append the X-Forwarded-For header, if set
        if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $remote_ip[] = 'X-Forwarded-For: ' . $_SERVER['HTTP_X_FORWARDED_FOR'];
        }

        if (!empty($remote_ip)) {
            $address .= '(' . implode(',', $remote_ip) . ')';
        }

        return $address;
    }
public static function remote_ip()
    {
        $address = $_SERVER['REMOTE_ADDR'];

        // append the NGINX X-Real-IP header, if set
        if (!empty($_SERVER['HTTP_X_REAL_IP'])) {
            $remote_ip[] = 'X-Real-IP: ' . $_SERVER['HTTP_X_REAL_IP'];
        }

        // append the X-Forwarded-For header, if set
        if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $remote_ip[] = 'X-Forwarded-For: ' . $_SERVER['HTTP_X_FORWARDED_FOR'];
        }

        if (!empty($remote_ip)) {
            $address .= '(' . implode(',', $remote_ip) . ')';
        }

        return $address;
    }
public static function remote_ip ( ) { $ address = $ _SERVER [ 'REMOTE_ADDR' ] ; // append the NGINX X-Real-IP header, if set if ( ! empty ( $ _SERVER [ 'HTTP_X_REAL_IP' ] ) ) { $ remote_ip [ ] = 'X-Real-IP: ' . $ _SERVER [ 'HTTP_X_REAL_IP' ] ; } // append the X-Forwarded-For header, if set if ( ! empty ( $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ) ) { $ remote_ip [ ] = 'X-Forwarded-For: ' . $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ; } if ( ! empty ( $ remote_ip ) ) { $ address .= '(' . implode ( ',' , $ remote_ip ) . ')' ; } return $ address ; }
Returns remote IP address and forwarded addresses if found

@return string Remote IP address(es)
Returns remote IP address and forwarded addresses if found