* Copyright 1999-2004 Charles J. Hagenbuch * Copyright 1999-2004 Jon Parise * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. */ /* We want to be as verbose as possible here. */ error_reporting(E_ALL); /* Set character encoding. */ header('Content-type: text/html; charset=utf-8'); header('Vary: Accept-Language'); function status($foo) { if ($foo) { echo 'Yes'; } else { echo 'No'; } } /* IMP version. */ require_once './lib/version.php'; $version = IMP_VERSION; /* Parse PHP version. */ function split_php_version($version) { // First pick off major version, and lower-case the rest. if (strlen($version) >= 3 && $version[1] == '.') { $phpver['major'] = substr($version, 0, 3); $version = substr(strtolower($version), 3); } else { $phpver['major'] = $version; $phpver['class'] = 'unknown'; return $phpver; } if ($version[0] == '.') { $version = substr($version, 1); } // Next, determine if this is 4.0b or 4.0rc; if so, there is no minor, // the rest is the subminor, and class is set to beta. $s = strspn($version, '0123456789'); if ($s == 0) { $phpver['subminor'] = $version; $phpver['class'] = 'beta'; return $phpver; } // Otherwise, this is non-beta; the numeric part is the minor, // the rest is either a classification (dev, cvs) or a subminor // version (rc, pl). $phpver['minor'] = substr($version, 0, $s); if ((strlen($version) > $s) && ($version[$s] == '.' || $version[$s] == '-')) { $s++; } $phpver['subminor'] = substr($version, $s); if ($phpver['subminor'] == 'cvs' || $phpver['subminor'] == 'dev' || substr($phpver['subminor'], 0, 2) == 'rc') { unset($phpver['subminor']); $phpver['class'] = 'dev'; } else { if (!$phpver['subminor']) { unset($phpver['subminor']); } $phpver['class'] = 'release'; } return $phpver; } /* Display PHP version bullets. */ function show_php_version($phpver) { echo '
  • PHP Major Version: ' . $phpver['major'] . "
  • \n"; if (isset($phpver['minor'])) { echo '
  • PHP Minor Version: ' . $phpver['minor'] . "
  • \n"; } if (isset($phpver['subminor'])) { echo '
  • PHP Subminor Version: ' . $phpver['subminor'] . "
  • \n"; } echo '
  • PHP Version Classification: ' . $phpver['class'] . "
  • \n"; } /* PHP Version. */ $phpver = split_php_version(phpversion()); /* Handle special modes. */ if (array_key_exists('mode', $_GET) && $_GET['mode'] == 'phpinfo') { echo '<< Back to test.php'; phpinfo(); exit; break; } /* See if we have the imap module installed */ $imap = extension_loaded('imap'); ?> IMP: System Capabilities Test

    IMP Version

    • IMP:

    PHP Version

    • View phpinfo() screen
    • PHP Version:
    • You need to upgrade to PHP4. PHP3 will not work.'; $requires = 1; } elseif ($phpver['class'] == 'beta' || $phpver['class'] == 'unknown') { echo '
    • This is a beta/prerelease version of PHP4. You need to upgrade to a release version.
    • '; $requires = 1; } elseif ($phpver['major'] == '4.0') { echo '
    • This version of PHP is not supported. You need to upgrade to a more recent version.
    • '; $requires = 1; } elseif ($phpver['major'] == '4.1' || $phpver['major'] == '4.2' || $phpver['major'] == '4.3' || $phpver['major'] == '4.4') { if ($phpver['major'] == '4.1' && $phpver['minor'] < '2') { $insecure = 1; } echo '
    • You are running a supported version of PHP.
    • '; } else { echo '
    • Wow, a mystical version of PHP from the future. Let dev@lists.horde.org know what version you have so we can fix this script.
    • '; } if (!empty($requires)) { echo '
    • IMP requires PHP 4.1.0 or later.
    • '; } if (!empty($insecure)) { echo '
    • This version of PHP contains a serious security vulnerability in its upload code. You should apply the patch or upgrade to 4.1.2 or later as soon as possible.
    • '; } echo '
    '; ?>

    PHP Module Capabilities

    • IMAP Support:
    • IMP will not function without the IMAP extension. IMAP support is required even if you only use POP3.

    PHP IMAP Support Test

    '; $mbox = @imap_open($mbname, $user, $passwd); if ($mbox) { $minfo = @imap_mailboxmsginfo($mbox); if ($minfo) { echo 'INBOX has ', $minfo->Nmsgs, ' messages (' . $minfo->Unread, ' new ', $minfo->Recent, ' recent)'; } else { echo '
    '; var_dump(imap_errors()); echo '
    '; } @imap_close($mbox); } else { echo '
    '; var_dump(imap_errors()); echo '
    '; } } else { ?>
    Server
    Protocol(e.g. "imap" or "imap/notls")
    Port(defaults to "143")
    User
    Password

    Valid XHTML 1.0!