Overview

Namespaces

  • Composer
    • Autoload
  • Geekwright
    • RegDom
  • League
    • OAuth2
      • Client
        • Provider
  • None
  • Xmf
    • Database
    • Jwt
    • Key
    • Module
      • Helper

Classes

  • ArtObject
  • ArtObjectHandler
  • BloggerApi
  • CGIF
  • CGIFCOLORTABLE
  • CGIFFILEHEADER
  • CGIFIMAGE
  • CGIFIMAGEHEADER
  • CGIFLZW
  • Composer\Autoload\ClassLoader
  • Composer\Autoload\ComposerStaticInit274e5fff219a4f27a346e611b0580d6a
  • ComposerAutoloaderInit274e5fff219a4f27a346e611b0580d6a
  • Config_File
  • Cookie
  • Criteria
  • CriteriaCompo
  • CriteriaElement
  • Database
  • Db_manager
  • ErrorHandler
  • FormDhtmlTextArea
  • FormTextArea
  • Geekwright\RegDom\PublicSuffixList
  • Geekwright\RegDom\RegisteredDomain
  • HTMLPurifier
  • League\OAuth2\Client\Provider\Google
  • MetaWeblogApi
  • ModuleAdmin
  • MovableTypeApi
  • MyTextSanitizer
  • MyTextSanitizerExtended
  • MyTextSanitizerExtension
  • MytsCensor
  • MytsFlash
  • MytsIframe
  • MytsImage
  • MytsLi
  • MytsMms
  • MytsMp3
  • MytsRtsp
  • MytsSoundcloud
  • MytsSyntaxhighlight
  • MytsTextfilter
  • MytsUl
  • MytsWiki
  • MytsWmp
  • MytsYoutube
  • PathStuffController
  • PHPMailer
  • PHPMailerOAuth
  • PHPMailerOAuthGoogle
  • phpthumb
  • phpthumb_bmp
  • phpthumb_filters
  • phpthumb_functions
  • phpthumb_ico
  • phpUnsharpMask
  • PmCorePreload
  • PmMessage
  • PmMessageHandler
  • PmSystemPreload
  • POP3
  • ProfileCategory
  • ProfileCategoryHandler
  • ProfileCorePreload
  • ProfileField
  • ProfileFieldHandler
  • ProfileProfile
  • ProfileProfileHandler
  • ProfileRegstep
  • ProfileRegstepHandler
  • ProfileVisibility
  • ProfileVisibilityHandler
  • Protector
  • Protector_bruteforce_overrun_message
  • Protector_crawler_overrun_message
  • Protector_f5attack_overrun_message
  • Protector_postcommon_post_deny_by_httpbl
  • Protector_postcommon_post_deny_by_rbl
  • Protector_postcommon_post_htmlpurify4everyone
  • Protector_postcommon_post_htmlpurify4guest
  • Protector_postcommon_post_language_match
  • Protector_postcommon_post_need_multibyte
  • Protector_postcommon_post_register_moratorium
  • Protector_postcommon_post_stopforumspam
  • Protector_postcommon_register_insert_js_check
  • Protector_postcommon_register_stopforumspam
  • Protector_precommon_badip_errorlog
  • Protector_precommon_badip_message
  • Protector_precommon_badip_redirection
  • Protector_precommon_bwlimit_errorlog
  • Protector_precommon_bwlimit_message
  • Protector_prepurge_exit_message
  • Protector_spamcheck_overrun_message
  • ProtectorCorePreload
  • ProtectorFilterAbstract
  • ProtectorFilterHandler
  • ProtectorMySQLDatabase
  • ProtectorRegistry
  • ReCaptchaResponse
  • RpcArrayHandler
  • RpcBase64Handler
  • RpcBooleanHandler
  • RpcDateTimeHandler
  • RpcDoubleHandler
  • RpcIntHandler
  • RpcMemberHandler
  • RpcMethodNameHandler
  • RpcNameHandler
  • RpcStringHandler
  • RpcStructHandler
  • RpcValueHandler
  • RssAuthorHandler
  • RssCategoryHandler
  • RssChannelHandler
  • RssCommentsHandler
  • RssCopyrightHandler
  • RssDescriptionHandler
  • RssDocsHandler
  • RssGeneratorHandler
  • RssGuidHandler
  • RssHeightHandler
  • RssImageHandler
  • RssItemHandler
  • RssLanguageHandler
  • RssLastBuildDateHandler
  • RssLinkHandler
  • RssManagingEditorHandler
  • RssNameHandler
  • RssPubDateHandler
  • RssSourceHandler
  • RssTextInputHandler
  • RssTitleHandler
  • RssTtlHandler
  • RssUrlHandler
  • RssWebMasterHandler
  • RssWidthHandler
  • SaxParser
  • Smarty
  • Smarty_Compiler
  • SMTP
  • Snoopy
  • SqlUtility
  • SystemAvatar
  • SystemAvatarHandler
  • SystemBanner
  • SystemBannerclient
  • SystemBannerclientHandler
  • SystemBannerFinish
  • SystemBannerfinishHandler
  • SystemBannerHandler
  • SystemBlock
  • SystemBlockHandler
  • SystemBlockLinkModule
  • SystemBlockLinkModuleHandler
  • SystemBreadcrumb
  • SystemCorePreload
  • SystemFineAvatarUploadHandler
  • SystemFineImUploadHandler
  • SystemFineUploadHandler
  • SystemGroup
  • SystemGroupHandler
  • SystemMaintenance
  • SystemMenuHandler
  • SystemSmilies
  • SystemsmiliesHandler
  • SystemUserrank
  • SystemuserrankHandler
  • SystemUsers
  • SystemUsersHandler
  • Tar
  • ThemeSetAuthorHandler
  • ThemeSetDateCreatedHandler
  • ThemeSetDescriptionHandler
  • ThemeSetEmailHandler
  • ThemeSetFileTypeHandler
  • ThemeSetGeneratorHandler
  • ThemeSetImageHandler
  • ThemeSetLinkHandler
  • ThemeSetModuleHandler
  • ThemeSetNameHandler
  • ThemeSetTagHandler
  • ThemeSetTemplateHandler
  • TinyMCE
  • Xmf\Assert
  • Xmf\Database\Migrate
  • Xmf\Database\TableLoad
  • Xmf\Database\Tables
  • Xmf\Debug
  • Xmf\FilterInput
  • Xmf\Highlighter
  • Xmf\IPAddress
  • Xmf\Jwt\JsonWebToken
  • Xmf\Jwt\KeyFactory
  • Xmf\Jwt\TokenFactory
  • Xmf\Jwt\TokenReader
  • Xmf\Key\ArrayStorage
  • Xmf\Key\Basic
  • Xmf\Key\FileStorage
  • Xmf\Key\KeyAbstract
  • Xmf\Language
  • Xmf\Metagen
  • Xmf\Module\Admin
  • Xmf\Module\Helper
  • Xmf\Module\Helper\AbstractHelper
  • Xmf\Module\Helper\Cache
  • Xmf\Module\Helper\GenericHelper
  • Xmf\Module\Helper\Permission
  • Xmf\Module\Helper\Session
  • Xmf\Random
  • Xmf\Request
  • Xmf\StopWords
  • Xmf\Yaml
  • XmlTagHandler
  • XoopsApi
  • xoopsart
  • XoopsAuth
  • XoopsAuthAds
  • XoopsAuthFactory
  • XoopsAuthLdap
  • XoopsAuthProvisionning
  • XoopsAuthXoops
  • XoopsAvatar
  • XoopsAvatarHandler
  • XoopsBlock
  • XoopsBlockHandler
  • XoopsBlockInstance
  • XoopsBlockInstanceHandler
  • XoopsCache
  • XoopsCacheApc
  • XoopsCacheEngine
  • XoopsCacheFile
  • XoopsCacheMemcache
  • XoopsCacheModel
  • XoopsCacheModelHandler
  • XoopsCacheModelObject
  • XoopsCacheXcache
  • XoopsCaptcha
  • XoopsCaptchaImage
  • XoopsCaptchaImageHandler
  • XoopsCaptchaMethod
  • XoopsCaptchaRecaptcha
  • XoopsCaptchaRecaptcha2
  • XoopsCaptchaText
  • XoopsComment
  • XoopsCommentHandler
  • XoopsCommentRenderer
  • XoopsComments
  • XoopsConfigCategory
  • XoopsConfigCategoryHandler
  • XoopsConfigHandler
  • XoopsConfigItem
  • XoopsConfigItemHandler
  • XoopsConfigOption
  • XoopsConfigOptionHandler
  • XoopsDatabase
  • XoopsDatabaseFactory
  • XoopsDownloader
  • XoopsEditor
  • XoopsEditorHandler
  • XoopsErrorHandler
  • XoopsFile
  • XoopsFileHandler
  • XoopsFilterInput
  • XoopsFolderHandler
  • XoopsForm
  • XoopsFormButton
  • XoopsFormButtonTray
  • XoopsFormCaptcha
  • XoopsFormCheckBox
  • XoopsFormColorPicker
  • XoopsFormDateTime
  • XoopsFormDhtmlTextArea
  • XoopsFormEditor
  • XoopsFormElement
  • XoopsFormElementTray
  • XoopsFormFile
  • XoopsFormHidden
  • XoopsFormHiddenToken
  • XoopsFormLabel
  • XoopsFormPassword
  • XoopsFormRadio
  • XoopsFormRadioYN
  • XoopsFormRenderer
  • XoopsFormRendererBootstrap3
  • XoopsFormRendererLegacy
  • XoopsFormSelect
  • XoopsFormSelectCheckGroup
  • XoopsFormSelectCountry
  • XoopsFormSelectEditor
  • XoopsFormSelectGroup
  • XoopsFormSelectLang
  • XoopsFormSelectMatchOption
  • XoopsFormSelectTheme
  • XoopsFormSelectTimezone
  • XoopsFormSelectUser
  • XoopsFormText
  • XoopsFormTextArea
  • XoopsFormTextDateSelect
  • XoopsFormTinymce
  • XoopsGroup
  • XoopsGroupFormCheckBox
  • XoopsGroupHandler
  • XoopsGroupPerm
  • XoopsGroupPermForm
  • XoopsGroupPermHandler
  • XoopsGTicket
  • XoopsGuestUser
  • XoopsGuiDefault
  • XoopsGuiThadmin
  • XoopsGuiTransition
  • XoopsGuiZetadigme
  • XoopsHandlerRegistry
  • XoopsImage
  • XoopsImagecategory
  • XoopsImagecategoryHandler
  • XoopsImageHandler
  • XoopsImageSet
  • XoopsImagesetHandler
  • XoopsImagesetimg
  • XoopsImagesetimgHandler
  • XoopsInstallWizard
  • XoopsLists
  • XoopsLoad
  • XoopsLocal
  • XoopsLocalAbstract
  • XoopsLocalWrapper
  • XoopsLogger
  • XoopsMailer
  • XoopsMailerLocal
  • XoopsMediaUploader
  • XoopsMemberHandler
  • XoopsMembership
  • XoopsMembershipHandler
  • XoopsModelAbstract
  • XoopsModelFactory
  • XoopsModelJoint
  • XoopsModelRead
  • XoopsModelStats
  • XoopsModelSync
  • XoopsModelWrite
  • XoopsModule
  • XoopsModuleHandler
  • XoopsMultiMailer
  • XoopsMySQLDatabase
  • XoopsMySQLDatabaseProxy
  • XoopsMySQLDatabaseSafe
  • XoopsNotification
  • XoopsNotificationHandler
  • XoopsObject
  • XoopsObjectHandler
  • XoopsObjectTree
  • XoopsOnlineHandler
  • XoopsPageNav
  • XoopsPersistableObjectHandler
  • XoopsPreload
  • XoopsPreloadItem
  • XoopsPrivmessage
  • XoopsPrivmessageHandler
  • XoopsRank
  • XoopsRankHandler
  • XoopsRequest
  • XoopsSecurity
  • XoopsSessionHandler
  • XoopsSimpleForm
  • XoopsStory
  • XoopsSystemCpanel
  • XoopsSystemGui
  • XoopsTableForm
  • XoopsTarDownloader
  • XoopsThemeForm
  • XoopsThemeSetParser
  • XoopsTopic
  • XoopsTpl
  • XoopsTplfile
  • XoopsTplfileHandler
  • XoopsTplset
  • XoopsTplsetHandler
  • XoopsTree
  • XoopsUser
  • XoopsUserHandler
  • XoopsUserUtility
  • XoopsUtility
  • XoopsXmlRpcApi
  • XoopsXmlRpcArray
  • XoopsXmlRpcBase64
  • XoopsXmlRpcBoolean
  • XoopsXmlRpcDatetime
  • XoopsXmlRpcDocument
  • XoopsXmlRpcDouble
  • XoopsXmlRpcFault
  • XoopsXmlRpcInt
  • XoopsXmlRpcParser
  • XoopsXmlRpcRequest
  • XoopsXmlRpcResponse
  • XoopsXmlRpcString
  • XoopsXmlRpcStruct
  • XoopsXmlRpcTag
  • XoopsXmlRss2Parser
  • XoopsZipDownloader
  • xos_kernel_Xoops2
  • xos_logos_PageBuilder
  • xos_opal_AdminThemeFactory
  • xos_opal_Theme
  • xos_opal_ThemeFactory
  • XoUser
  • XoUserHandler
  • Zipfile

Interfaces

  • Xmf\Key\StorageInterface
  • XoopsFormRendererInterface

Exceptions

  • phpmailerException

Functions

  • __autoload
  • _recaptcha_aes_encrypt
  • _recaptcha_aes_pad
  • _recaptcha_http_post
  • _recaptcha_mailhide_email_parts
  • _recaptcha_mailhide_urlbase64
  • _recaptcha_qsencode
  • _smarty_regex_replace_check
  • _smarty_sort_length
  • admin_refcheck
  • b_system_comments_edit
  • b_system_comments_show
  • b_system_info_edit
  • b_system_info_show
  • b_system_login_show
  • b_system_main_show
  • b_system_newmembers_edit
  • b_system_newmembers_show
  • b_system_notification_show
  • b_system_online_show
  • b_system_search_show
  • b_system_themes_edit
  • b_system_themes_show
  • b_system_topposters_edit
  • b_system_topposters_show
  • b_system_user_show
  • b_system_waiting_show
  • bannerstats
  • change_banner_url_by_client
  • checkEmail
  • clickbanner
  • clientlogin
  • closeTable
  • closeThread
  • CloseWaitBox
  • Composer\Autoload\includeFile
  • composerRequire274e5fff219a4f27a346e611b0580d6a
  • createConfigform
  • createThemeform
  • doConditionalGet
  • emailStats
  • exit404BadReq
  • fatalPhpErrorHandler
  • file_get_contents
  • file_put_contents
  • findSharp
  • form_user
  • formatTimestamp
  • formatURL
  • gd_info
  • genPathCheckHtml
  • get_request_method
  • get_writeoks_from_protector
  • getcss
  • getDbCharsets
  • getDbCollations
  • getDirList
  • getMailer
  • getTheme
  • gif_getSize
  • gif_loadFile
  • gif_loadFileToGDimageResource
  • gif_outputAsBmp
  • gif_outputAsJpeg
  • gif_outputAsPng
  • HTMLPurifier
  • imagealphablending
  • imageBrowser
  • imageCreateCorners
  • imageFilenameCheck
  • imagesavealpha
  • install_acceptUser
  • install_finalize
  • is_executable
  • kses
  • langDropdown
  • load_functions
  • load_object
  • load_objectHandler
  • loadModuleAdminMenu
  • make_cblock
  • make_data
  • make_groups
  • make_sidebar
  • mod_clearCacheFile
  • mod_clearConfg
  • mod_clearConfig
  • mod_clearFile
  • mod_clearSmartyCache
  • mod_constant
  • mod_createCacheFile
  • mod_createCacheFile_byGroup
  • mod_createFile
  • mod_DB_prefix
  • mod_fetchConfg
  • mod_fetchConfig
  • mod_generateCacheId
  • mod_generateCacheId_byGroup
  • mod_getDirname
  • mod_getIP
  • mod_getMysqlVersion
  • mod_getUnameFromId
  • mod_getUnameFromIds
  • mod_isModuleAction
  • mod_loadCacheFile
  • mod_loadCacheFile_byGroup
  • mod_loadConfg
  • mod_loadConfig
  • mod_loadFile
  • mod_loadFunctions
  • mod_loadRenderer
  • mod_message
  • modify_chmod
  • myTextForm
  • notificationCategoryInfo
  • notificationCommentCategoryInfo
  • notificationEnabled
  • notificationEventEnabled
  • notificationEventInfo
  • notificationEvents
  • notificationGenerateConfig
  • notificationSubscribableCategoryInfo
  • openTable
  • openThread
  • OpenWaitBox
  • PHPMailerAutoload
  • phpThumbURL
  • preg_quote
  • profile_getFieldForm
  • profile_getRegisterForm
  • profile_getStepForm
  • profile_getUserForm
  • profile_install_addCategory
  • profile_install_addField
  • profile_install_addStep
  • profile_install_initializeProfiles
  • profile_install_setPermissions
  • protector_message_append_oninstall
  • protector_message_append_onuninstall
  • protector_message_append_onupdate
  • protector_notify_base
  • protector_oninstall_base
  • protector_onuninstall_base
  • protector_onupdate_base
  • protector_postcommon
  • protector_prepare
  • recaptcha_check_answer
  • recaptcha_get_html
  • recaptcha_get_signup_url
  • recaptcha_mailhide_html
  • recaptcha_mailhide_url
  • redirect_header
  • RedirectToCachedFile
  • SendSaveAsFileHeaderIfNeeded
  • showbanner
  • showThread
  • smarty_block_textformat
  • smarty_compiler_assign
  • smarty_compiler_foreachq
  • smarty_compiler_includeq
  • smarty_compiler_xoAdminIcons
  • smarty_compiler_xoAdminNav
  • smarty_compiler_xoAppUrl
  • smarty_compiler_xoImgUrl
  • smarty_compiler_xoModuleIcons16
  • smarty_compiler_xoModuleIcons32
  • smarty_compiler_xoModuleIconsBookmarks
  • smarty_core_assemble_plugin_filepath
  • smarty_core_assign_smarty_interface
  • smarty_core_create_dir_structure
  • smarty_core_display_debug_console
  • smarty_core_get_include_path
  • smarty_core_get_microtime
  • smarty_core_get_php_resource
  • smarty_core_is_secure
  • smarty_core_is_trusted
  • smarty_core_load_plugins
  • smarty_core_load_resource_plugin
  • smarty_core_process_cached_inserts
  • smarty_core_process_compiled_include
  • smarty_core_read_cache_file
  • smarty_core_rm_auto
  • smarty_core_rmdir
  • smarty_core_run_insert_handler
  • smarty_core_smarty_include_php
  • smarty_core_write_cache_file
  • smarty_core_write_compiled_include
  • smarty_core_write_compiled_resource
  • smarty_core_write_file
  • smarty_function_assign_debug_info
  • smarty_function_block
  • smarty_function_config_load
  • smarty_function_counter
  • smarty_function_cycle
  • smarty_function_debug
  • smarty_function_escape_special_chars
  • smarty_function_eval
  • smarty_function_fetch
  • smarty_function_html_checkboxes
  • smarty_function_html_checkboxes_output
  • smarty_function_html_image
  • smarty_function_html_options
  • smarty_function_html_options_optgroup
  • smarty_function_html_options_optoutput
  • smarty_function_html_radios
  • smarty_function_html_radios_output
  • smarty_function_html_select_date
  • smarty_function_html_select_time
  • smarty_function_html_table
  • smarty_function_html_table_cycle
  • smarty_function_mailto
  • smarty_function_math
  • smarty_function_popup
  • smarty_function_popup_init
  • smarty_function_securityToken
  • smarty_function_xoInboxCount
  • smarty_function_xoMemberInfo
  • smarty_function_xoops_link
  • smarty_function_xoPageNav
  • smarty_make_timestamp
  • smarty_modifier_capitalize
  • smarty_modifier_capitalize_ucfirst
  • smarty_modifier_cat
  • smarty_modifier_count_characters
  • smarty_modifier_count_paragraphs
  • smarty_modifier_count_sentences
  • smarty_modifier_count_words
  • smarty_modifier_date_format
  • smarty_modifier_debug_print_var
  • smarty_modifier_default
  • smarty_modifier_escape
  • smarty_modifier_indent
  • smarty_modifier_lower
  • smarty_modifier_nl2br
  • smarty_modifier_regex_replace
  • smarty_modifier_replace
  • smarty_modifier_spacify
  • smarty_modifier_string_format
  • smarty_modifier_strip
  • smarty_modifier_strip_tags
  • smarty_modifier_truncate
  • smarty_modifier_upper
  • smarty_modifier_wordwrap
  • smarty_outputfilter_trimwhitespace
  • smarty_outputfilter_trimwhitespace_replace
  • smarty_resource_db_secure
  • smarty_resource_db_source
  • smarty_resource_db_timestamp
  • smarty_resource_db_tplinfo
  • smarty_resource_db_trusted
  • synchronize
  • system_AdminIcons
  • system_adminVersion
  • system_CleanVars
  • system_loadLanguage
  • system_loadTemplate
  • themecenterposts
  • update_system_v211
  • userCheck
  • userTimeToServerTime
  • validateDbCharset
  • writeLicenseKey
  • xoBuildLicenceKey
  • xoDiag
  • xoDiagBoolSetting
  • xoDiagIfWritable
  • xoFormBlockCollation
  • xoFormField
  • xoFormFieldCharset
  • xoFormFieldCollation
  • xoFormSelect
  • xoops_aw_decode
  • xoops_aw_encode
  • xoops_bin2hex
  • xoops_comment_count
  • xoops_comment_delete
  • xoops_confirm
  • xoops_convert_decode
  • xoops_convert_encode
  • xoops_convert_encoding
  • xoops_cp_footer
  • xoops_cp_header
  • xoops_error
  • xoops_footer
  • xoops_getActiveModules
  • xoops_getbanner
  • xoops_getBaseDomain
  • xoops_getConfigOption
  • xoops_getcss
  • xoops_getenv
  • xoops_getHandler
  • xoops_getLinkedUnameFromId
  • xoops_getMailer
  • xoops_getModuleHandler
  • xoops_getModuleOption
  • xoops_getOption
  • xoops_getrank
  • xoops_getUrlDomain
  • xoops_getUserTimestamp
  • xoops_groupperm_deletebymoditem
  • xoops_header
  • xoops_hex2bin
  • xoops_isActiveModule
  • xoops_ishexstr
  • xoops_load
  • xoops_load_lang_file
  • xoops_loadLanguage
  • xoops_local
  • xoops_makepass
  • xoops_message
  • xoops_module_activate
  • xoops_module_change
  • xoops_module_deactivate
  • xoops_module_delayed_clean_cache
  • xoops_module_get_admin_menu
  • xoops_module_gettemplate
  • xoops_module_install
  • xoops_module_install_pm
  • xoops_module_install_profile
  • xoops_module_log_header
  • xoops_module_uninstall
  • xoops_module_update
  • xoops_module_update_pm
  • xoops_module_update_profile
  • xoops_module_update_system
  • xoops_module_write_admin_menu
  • xoops_notification_deletebyitem
  • xoops_notification_deletebymodule
  • xoops_notification_deletebyuser
  • xoops_refcheck
  • xoops_result
  • xoops_setActiveModules
  • xoops_setConfigOption
  • xoops_substr
  • xoops_template_clear_module_cache
  • xoops_template_touch
  • xoops_trim
  • xoops_utf8_encode
  • xoops_write_index_file
  • xoopsCodeTarea
  • xoopseditor_get_rootpath
  • XoopsErrorHandler_HandleError
  • xoopsfwrite
  • xoopsSmilies
  • xoPassField
  • xoPhpVersion
  • xoPutLicenseKey
  • xoStripeKey
  • Overview
  • Namespace
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * PHPMailer POP-Before-SMTP Authentication Class.
  4:  * PHP Version 5
  5:  * @package PHPMailer
  6:  * @link https://github.com/PHPMailer/PHPMailer/
  7:  * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
  8:  * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
  9:  * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
 10:  * @author Brent R. Matzelle (original founder)
 11:  * @copyright 2012 - 2014 Marcus Bointon
 12:  * @copyright 2010 - 2012 Jim Jagielski
 13:  * @copyright 2004 - 2009 Andy Prevost
 14:  * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
 15:  * @note This program is distributed in the hope that it will be useful - WITHOUT
 16:  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 17:  * FITNESS FOR A PARTICULAR PURPOSE.
 18:  */
 19: 
 20: /**
 21:  * PHPMailer POP-Before-SMTP Authentication Class.
 22:  * Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
 23:  * Does not support APOP.
 24:  * @package PHPMailer
 25:  * @author Richard Davey (original author) <rich@corephp.co.uk>
 26:  * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
 27:  * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
 28:  * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
 29:  */
 30: class POP3
 31: {
 32:     /**
 33:      * The POP3 PHPMailer Version number.
 34:      * @var string
 35:      * @access public
 36:      */
 37:     public $Version = '5.2.21';
 38: 
 39:     /**
 40:      * Default POP3 port number.
 41:      * @var integer
 42:      * @access public
 43:      */
 44:     public $POP3_PORT = 110;
 45: 
 46:     /**
 47:      * Default timeout in seconds.
 48:      * @var integer
 49:      * @access public
 50:      */
 51:     public $POP3_TIMEOUT = 30;
 52: 
 53:     /**
 54:      * POP3 Carriage Return + Line Feed.
 55:      * @var string
 56:      * @access public
 57:      * @deprecated Use the constant instead
 58:      */
 59:     public $CRLF = "\r\n";
 60: 
 61:     /**
 62:      * Debug display level.
 63:      * Options: 0 = no, 1+ = yes
 64:      * @var integer
 65:      * @access public
 66:      */
 67:     public $do_debug = 0;
 68: 
 69:     /**
 70:      * POP3 mail server hostname.
 71:      * @var string
 72:      * @access public
 73:      */
 74:     public $host;
 75: 
 76:     /**
 77:      * POP3 port number.
 78:      * @var integer
 79:      * @access public
 80:      */
 81:     public $port;
 82: 
 83:     /**
 84:      * POP3 Timeout Value in seconds.
 85:      * @var integer
 86:      * @access public
 87:      */
 88:     public $tval;
 89: 
 90:     /**
 91:      * POP3 username
 92:      * @var string
 93:      * @access public
 94:      */
 95:     public $username;
 96: 
 97:     /**
 98:      * POP3 password.
 99:      * @var string
100:      * @access public
101:      */
102:     public $password;
103: 
104:     /**
105:      * Resource handle for the POP3 connection socket.
106:      * @var resource
107:      * @access protected
108:      */
109:     protected $pop_conn;
110: 
111:     /**
112:      * Are we connected?
113:      * @var boolean
114:      * @access protected
115:      */
116:     protected $connected = false;
117: 
118:     /**
119:      * Error container.
120:      * @var array
121:      * @access protected
122:      */
123:     protected $errors = array();
124: 
125:     /**
126:      * Line break constant
127:      */
128:     const CRLF = "\r\n";
129: 
130:     /**
131:      * Simple static wrapper for all-in-one POP before SMTP
132:      * @param $host
133:      * @param integer|boolean $port The port number to connect to
134:      * @param integer|boolean $timeout The timeout value
135:      * @param string $username
136:      * @param string $password
137:      * @param integer $debug_level
138:      * @return boolean
139:      */
140:     public static function popBeforeSmtp(
141:         $host,
142:         $port = false,
143:         $timeout = false,
144:         $username = '',
145:         $password = '',
146:         $debug_level = 0
147:     ) {
148:         $pop = new POP3;
149:         return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
150:     }
151: 
152:     /**
153:      * Authenticate with a POP3 server.
154:      * A connect, login, disconnect sequence
155:      * appropriate for POP-before SMTP authorisation.
156:      * @access public
157:      * @param string $host The hostname to connect to
158:      * @param integer|boolean $port The port number to connect to
159:      * @param integer|boolean $timeout The timeout value
160:      * @param string $username
161:      * @param string $password
162:      * @param integer $debug_level
163:      * @return boolean
164:      */
165:     public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
166:     {
167:         $this->host = $host;
168:         // If no port value provided, use default
169:         if (false === $port) {
170:             $this->port = $this->POP3_PORT;
171:         } else {
172:             $this->port = (integer)$port;
173:         }
174:         // If no timeout value provided, use default
175:         if (false === $timeout) {
176:             $this->tval = $this->POP3_TIMEOUT;
177:         } else {
178:             $this->tval = (integer)$timeout;
179:         }
180:         $this->do_debug = $debug_level;
181:         $this->username = $username;
182:         $this->password = $password;
183:         //  Reset the error log
184:         $this->errors = array();
185:         //  connect
186:         $result = $this->connect($this->host, $this->port, $this->tval);
187:         if ($result) {
188:             $login_result = $this->login($this->username, $this->password);
189:             if ($login_result) {
190:                 $this->disconnect();
191:                 return true;
192:             }
193:         }
194:         // We need to disconnect regardless of whether the login succeeded
195:         $this->disconnect();
196:         return false;
197:     }
198: 
199:     /**
200:      * Connect to a POP3 server.
201:      * @access public
202:      * @param string $host
203:      * @param integer|boolean $port
204:      * @param integer $tval
205:      * @return boolean
206:      */
207:     public function connect($host, $port = false, $tval = 30)
208:     {
209:         //  Are we already connected?
210:         if ($this->connected) {
211:             return true;
212:         }
213: 
214:         //On Windows this will raise a PHP Warning error if the hostname doesn't exist.
215:         //Rather than suppress it with @fsockopen, capture it cleanly instead
216:         set_error_handler(array($this, 'catchWarning'));
217: 
218:         if (false === $port) {
219:             $port = $this->POP3_PORT;
220:         }
221: 
222:         //  connect to the POP3 server
223:         $this->pop_conn = fsockopen(
224:             $host, //  POP3 Host
225:             $port, //  Port #
226:             $errno, //  Error Number
227:             $errstr, //  Error Message
228:             $tval
229:         ); //  Timeout (seconds)
230:         //  Restore the error handler
231:         restore_error_handler();
232: 
233:         //  Did we connect?
234:         if (false === $this->pop_conn) {
235:             //  It would appear not...
236:             $this->setError(array(
237:                 'error' => "Failed to connect to server $host on port $port",
238:                 'errno' => $errno,
239:                 'errstr' => $errstr
240:             ));
241:             return false;
242:         }
243: 
244:         //  Increase the stream time-out
245:         stream_set_timeout($this->pop_conn, $tval, 0);
246: 
247:         //  Get the POP3 server response
248:         $pop3_response = $this->getResponse();
249:         //  Check for the +OK
250:         if ($this->checkResponse($pop3_response)) {
251:             //  The connection is established and the POP3 server is talking
252:             $this->connected = true;
253:             return true;
254:         }
255:         return false;
256:     }
257: 
258:     /**
259:      * Log in to the POP3 server.
260:      * Does not support APOP (RFC 2828, 4949).
261:      * @access public
262:      * @param string $username
263:      * @param string $password
264:      * @return boolean
265:      */
266:     public function login($username = '', $password = '')
267:     {
268:         if (!$this->connected) {
269:             $this->setError('Not connected to POP3 server');
270:         }
271:         if (empty($username)) {
272:             $username = $this->username;
273:         }
274:         if (empty($password)) {
275:             $password = $this->password;
276:         }
277: 
278:         // Send the Username
279:         $this->sendString("USER $username" . self::CRLF);
280:         $pop3_response = $this->getResponse();
281:         if ($this->checkResponse($pop3_response)) {
282:             // Send the Password
283:             $this->sendString("PASS $password" . self::CRLF);
284:             $pop3_response = $this->getResponse();
285:             if ($this->checkResponse($pop3_response)) {
286:                 return true;
287:             }
288:         }
289:         return false;
290:     }
291: 
292:     /**
293:      * Disconnect from the POP3 server.
294:      * @access public
295:      */
296:     public function disconnect()
297:     {
298:         $this->sendString('QUIT');
299:         //The QUIT command may cause the daemon to exit, which will kill our connection
300:         //So ignore errors here
301:         try {
302:             @fclose($this->pop_conn);
303:         } catch (Exception $e) {
304:             //Do nothing
305:         };
306:     }
307: 
308:     /**
309:      * Get a response from the POP3 server.
310:      * $size is the maximum number of bytes to retrieve
311:      * @param integer $size
312:      * @return string
313:      * @access protected
314:      */
315:     protected function getResponse($size = 128)
316:     {
317:         $response = fgets($this->pop_conn, $size);
318:         if ($this->do_debug >= 1) {
319:             echo "Server -> Client: $response";
320:         }
321:         return $response;
322:     }
323: 
324:     /**
325:      * Send raw data to the POP3 server.
326:      * @param string $string
327:      * @return integer
328:      * @access protected
329:      */
330:     protected function sendString($string)
331:     {
332:         if ($this->pop_conn) {
333:             if ($this->do_debug >= 2) { //Show client messages when debug >= 2
334:                 echo "Client -> Server: $string";
335:             }
336:             return fwrite($this->pop_conn, $string, strlen($string));
337:         }
338:         return 0;
339:     }
340: 
341:     /**
342:      * Checks the POP3 server response.
343:      * Looks for for +OK or -ERR.
344:      * @param string $string
345:      * @return boolean
346:      * @access protected
347:      */
348:     protected function checkResponse($string)
349:     {
350:         if (substr($string, 0, 3) !== '+OK') {
351:             $this->setError(array(
352:                 'error' => "Server reported an error: $string",
353:                 'errno' => 0,
354:                 'errstr' => ''
355:             ));
356:             return false;
357:         } else {
358:             return true;
359:         }
360:     }
361: 
362:     /**
363:      * Add an error to the internal error store.
364:      * Also display debug output if it's enabled.
365:      * @param $error
366:      * @access protected
367:      */
368:     protected function setError($error)
369:     {
370:         $this->errors[] = $error;
371:         if ($this->do_debug >= 1) {
372:             echo '<pre>';
373:             foreach ($this->errors as $error) {
374:                 print_r($error);
375:             }
376:             echo '</pre>';
377:         }
378:     }
379: 
380:     /**
381:      * Get an array of error messages, if any.
382:      * @return array
383:      */
384:     public function getErrors()
385:     {
386:         return $this->errors;
387:     }
388: 
389:     /**
390:      * POP3 connection error handler.
391:      * @param integer $errno
392:      * @param string $errstr
393:      * @param string $errfile
394:      * @param integer $errline
395:      * @access protected
396:      */
397:     protected function catchWarning($errno, $errstr, $errfile, $errline)
398:     {
399:         $this->setError(array(
400:             'error' => "Connecting to the POP3 server raised a PHP warning: ",
401:             'errno' => $errno,
402:             'errstr' => $errstr,
403:             'errfile' => $errfile,
404:             'errline' => $errline
405:         ));
406:     }
407: }
408: 
API documentation generated by ApiGen