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:  * Extended User Profile
  4:  *
  5:  * You may not change or alter any portion of this comment or credits
  6:  * of supporting developers from this source code or any supporting source code
  7:  * which is considered copyrighted (c) material of the original comment or credit authors.
  8:  * This program is distributed in the hope that it will be useful,
  9:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 10:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 11:  *
 12:  * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
 13:  * @license             GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
 14:  * @package             profile
 15:  * @since               2.3.0
 16:  * @author              Jan Pedersen
 17:  * @author              Taiwen Jiang <phppp@users.sourceforge.net>
 18:  */
 19: 
 20: // defined('XOOPS_ROOT_PATH') || exit("XOOPS root path not defined");
 21: 
 22: /**
 23:  * @package             kernel
 24:  * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
 25:  */
 26: class ProfileField extends XoopsObject
 27: {
 28:     /**
 29:      *
 30:      */
 31:     public function __construct()
 32:     {
 33:         $this->initVar('field_id', XOBJ_DTYPE_INT, null);
 34:         $this->initVar('cat_id', XOBJ_DTYPE_INT, null, true);
 35:         $this->initVar('field_type', XOBJ_DTYPE_TXTBOX);
 36:         $this->initVar('field_valuetype', XOBJ_DTYPE_INT, null, true);
 37:         $this->initVar('field_name', XOBJ_DTYPE_TXTBOX, null, true);
 38:         $this->initVar('field_title', XOBJ_DTYPE_TXTBOX);
 39:         $this->initVar('field_description', XOBJ_DTYPE_TXTAREA);
 40:         $this->initVar('field_required', XOBJ_DTYPE_INT, 0); //0 = no, 1 = yes
 41:         $this->initVar('field_maxlength', XOBJ_DTYPE_INT, 0);
 42:         $this->initVar('field_weight', XOBJ_DTYPE_INT, 0);
 43:         $this->initVar('field_default', XOBJ_DTYPE_TXTAREA, '');
 44:         $this->initVar('field_notnull', XOBJ_DTYPE_INT, 1);
 45:         $this->initVar('field_edit', XOBJ_DTYPE_INT, 0);
 46:         $this->initVar('field_show', XOBJ_DTYPE_INT, 0);
 47:         $this->initVar('field_config', XOBJ_DTYPE_INT, 0);
 48:         $this->initVar('field_options', XOBJ_DTYPE_ARRAY, array());
 49:         $this->initVar('step_id', XOBJ_DTYPE_INT, 0);
 50:     }
 51: 
 52:     /**
 53:      * Extra treatment dealing with non latin encoding
 54:      * Tricky solution
 55:      * @param string $key
 56:      * @param mixed  $value
 57:      * @param bool   $not_gpc
 58:      */
 59:     public function setVar($key, $value, $not_gpc = false)
 60:     {
 61:         if ($key === 'field_options' && is_array($value)) {
 62:             foreach (array_keys($value) as $idx) {
 63:                 $value[$idx] = base64_encode($value[$idx]);
 64:             }
 65:         }
 66:         parent::setVar($key, $value, $not_gpc);
 67:     }
 68: 
 69:     /**
 70:      * @param string $key
 71:      * @param string $format
 72:      *
 73:      * @return mixed
 74:      */
 75:     public function getVar($key, $format = 's')
 76:     {
 77:         $value = parent::getVar($key, $format);
 78:         if ($key === 'field_options' && !empty($value)) {
 79:             foreach (array_keys($value) as $idx) {
 80:                 $value[$idx] = base64_decode($value[$idx]);
 81:             }
 82:         }
 83: 
 84:         return $value;
 85:     }
 86: 
 87:     /**
 88:      * Returns a {@link XoopsFormElement} for editing the value of this field
 89:      *
 90:      * @param XoopsUser      $user    {@link XoopsUser} object to edit the value of
 91:      * @param ProfileProfile $profile {@link ProfileProfile} object to edit the value of
 92:      *
 93:      * @return XoopsFormElement
 94:      **/
 95:     public function getEditElement($user, $profile)
 96:     {
 97:         $value = in_array($this->getVar('field_name'), $this->getUserVars()) ? $user->getVar($this->getVar('field_name'), 'e') : $profile->getVar($this->getVar('field_name'), 'e');
 98: 
 99:         $caption = $this->getVar('field_title');
100:         $caption = defined($caption) ? constant($caption) : $caption;
101:         $name    = $this->getVar('field_name', 'e');
102:         $options = $this->getVar('field_options');
103:         if (is_array($options)) {
104:             //asort($options);
105: 
106:             foreach (array_keys($options) as $key) {
107:                 $optval = defined($options[$key]) ? constant($options[$key]) : $options[$key];
108:                 $optkey = defined($key) ? constant($key) : $key;
109:                 unset($options[$key]);
110:                 $options[$optkey] = $optval;
111:             }
112:         }
113:         include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
114:         switch ($this->getVar('field_type')) {
115:             default:
116:             case 'autotext':
117:                 //autotext is not for editing
118:                 $element = new XoopsFormLabel($caption, $this->getOutputValue($user, $profile));
119:                 break;
120: 
121:             case 'textbox':
122:                 $element = new XoopsFormText($caption, $name, 35, $this->getVar('field_maxlength'), $value);
123:                 break;
124: 
125:             case 'textarea':
126:                 $element = new XoopsFormTextArea($caption, $name, $value, 4, 30);
127:                 break;
128: 
129:             case 'dhtml':
130:                 $element = new XoopsFormDhtmlTextArea($caption, $name, $value, 10, 30);
131:                 break;
132: 
133:             case 'select':
134:                 $element = new XoopsFormSelect($caption, $name, $value);
135:                 // If options do not include an empty element, then add a blank option to prevent any default selection
136: //                if (!in_array('', array_keys($options))) {
137:                 if (!array_key_exists('', $options)) {
138:                     $element->addOption('', _NONE);
139: 
140:                     $eltmsg                          = empty($caption) ? sprintf(_FORM_ENTER, $name) : sprintf(_FORM_ENTER, $caption);
141:                     $eltmsg                          = str_replace('"', '\"', stripslashes($eltmsg));
142:                     $element->customValidationCode[] = "\nvar hasSelected = false; var selectBox = myform.{$name};" . "for (i = 0; i < selectBox.options.length; i++) { if (selectBox.options[i].selected == true && selectBox.options[i].value != '') { hasSelected = true; break; } }" . "if (!hasSelected) { window.alert(\"{$eltmsg}\"); selectBox.focus(); return false; }";
143:                 }
144:                 $element->addOptionArray($options);
145:                 break;
146: 
147:             case 'select_multi':
148:                 $element = new XoopsFormSelect($caption, $name, $value, 5, true);
149:                 $element->addOptionArray($options);
150:                 break;
151: 
152:             case 'radio':
153:                 $element = new XoopsFormRadio($caption, $name, $value);
154:                 $element->addOptionArray($options);
155:                 break;
156: 
157:             case 'checkbox':
158:                 $element = new XoopsFormCheckBox($caption, $name, $value);
159:                 $element->addOptionArray($options);
160:                 break;
161: 
162:             case 'yesno':
163:                 $element = new XoopsFormRadioYN($caption, $name, $value);
164:                 break;
165: 
166:             case 'group':
167:                 $element = new XoopsFormSelectGroup($caption, $name, true, $value);
168:                 break;
169: 
170:             case 'group_multi':
171:                 $element = new XoopsFormSelectGroup($caption, $name, true, $value, 5, true);
172:                 break;
173: 
174:             case 'language':
175:                 $element = new XoopsFormSelectLang($caption, $name, $value);
176:                 break;
177: 
178:             case 'date':
179:                 $element = new XoopsFormTextDateSelect($caption, $name, 15, $value);
180:                 break;
181: 
182:             case 'longdate':
183:                 $element = new XoopsFormTextDateSelect($caption, $name, 15, str_replace('-', '/', $value));
184:                 break;
185: 
186:             case 'datetime':
187:                 $element = new XoopsFormDatetime($caption, $name, 15, $value);
188:                 break;
189: 
190:             case 'list':
191:                 $element = new XoopsFormSelectList($caption, $name, $value, 1, $options[0]);
192:                 break;
193: 
194:             case 'timezone':
195:                 $element = new XoopsFormSelectTimezone($caption, $name, $value);
196:                 $element->setExtra("style='width: 280px;'");
197:                 break;
198: 
199:             case 'rank':
200:                 $element = new XoopsFormSelect($caption, $name, $value);
201: 
202:                 include_once $GLOBALS['xoops']->path('class/xoopslists.php');
203:                 $ranks = XoopsLists::getUserRankList();
204:                 $element->addOption(0, '--------------');
205:                 $element->addOptionArray($ranks);
206:                 break;
207: 
208:             case 'theme':
209:                 $element = new XoopsFormSelectTheme($caption, $name, $value, 1, true);
210:                 break;
211:         }
212:         if ($this->getVar('field_description') != '') {
213:             $element->setDescription($this->getVar('field_description'));
214:         }
215: 
216:         return $element;
217:     }
218: 
219:     /**
220:      * Returns a value for output of this field
221:      *
222:      * @param XoopsUser      $user    {@link XoopsUser} object to get the value of
223:      * @param profileProfile $profile object to get the value of
224:      *
225:      * @return mixed
226:      **/
227:     public function getOutputValue(&$user, $profile)
228:     {
229:         if (file_exists($file = $GLOBALS['xoops']->path('modules/profile/language/' . $GLOBALS['xoopsConfig']['language'] . '/modinfo.php'))) {
230:             include_once $file;
231:         } else {
232:             include_once $GLOBALS['xoops']->path('modules/profile/language/english/modinfo.php');
233:         }
234: 
235:         $value = in_array($this->getVar('field_name'), $this->getUserVars()) ? $user->getVar($this->getVar('field_name')) : $profile->getVar($this->getVar('field_name'));
236: 
237:         switch ($this->getVar('field_type')) {
238:             default:
239:             case 'textbox':
240:                 $value = is_array($value) ? $value[0] : $value;
241:                 if ($this->getVar('field_name') === 'url' && $value !== '') {
242:                     return '<a href="' . formatURL($value) . '" rel="external">' . $value . '</a>';
243:                 } else {
244:                     return $value;
245:                 }
246:                 break;
247:             case 'textarea':
248:             case 'dhtml':
249:             case 'theme':
250:             case 'language':
251:             case 'list':
252:                 return $value;
253:                 break;
254: 
255:             case 'select':
256:             case 'radio':
257:                 $value = is_array($value) ? $value[0] : $value;
258:                 $options = $this->getVar('field_options');
259:                 if (isset($options[$value])) {
260:                     $value = htmlspecialchars(defined($options[$value]) ? constant($options[$value]) : $options[$value]);
261:                 } else {
262:                     $value = '';
263:                 }
264: 
265:                 return $value;
266:                 break;
267: 
268:             case 'select_multi':
269:             case 'checkbox':
270:                 $options = $this->getVar('field_options');
271:                 $ret     = array();
272:                 if (count($options) > 0) {
273:                     foreach (array_keys($options) as $key) {
274:                         if (in_array($key, $value)) {
275:                             $ret[$key] = htmlspecialchars(defined($options[$key]) ? constant($options[$key]) : $options[$key]);
276:                         }
277:                     }
278:                 }
279: 
280:                 return $ret;
281:                 break;
282: 
283:             case 'group':
284:                 /* @var $member_handler XoopsMemberHandler */
285:                 $member_handler = xoops_getHandler('member');
286:                 $options        = $member_handler->getGroupList();
287:                 $ret            = isset($options[$value]) ? $options[$value] : '';
288: 
289:                 return $ret;
290:                 break;
291: 
292:             case 'group_multi':
293:                 /* @var $member_handler XoopsMemberHandler */
294:                 $member_handler = xoops_getHandler('member');
295:                 $options        = $member_handler->getGroupList();
296:                 $ret            = array();
297:                 foreach (array_keys($options) as $key) {
298:                     if (in_array($key, $value)) {
299:                         $ret[$key] = htmlspecialchars($options[$key]);
300:                     }
301:                 }
302: 
303:                 return $ret;
304:                 break;
305: 
306:             case 'longdate':
307:                 //return YYYY/MM/DD format - not optimal as it is not using local date format, but how do we do that
308:                 //when we cannot convert it to a UNIX timestamp?
309:                 return str_replace('-', '/', $value);
310: 
311:             case 'date':
312:                 return formatTimestamp($value, 's');
313:                 break;
314: 
315:             case 'datetime':
316:                 if (!empty($value)) {
317:                     return formatTimestamp($value, 'm');
318:                 } else {
319:                     return $value = _PROFILE_MI_NEVER_LOGGED_IN;
320:                 }
321:                 break;
322: 
323:             case 'autotext':
324:                 $value = $user->getVar($this->getVar('field_name'), 'n'); //autotext can have HTML in it
325:                 $value = str_replace('{X_UID}', $user->getVar('uid'), $value);
326:                 $value = str_replace('{X_URL}', XOOPS_URL, $value);
327:                 $value = str_replace('{X_UNAME}', $user->getVar('uname'), $value);
328: 
329:                 return $value;
330:                 break;
331: 
332:             case 'rank':
333:                 $userrank       = $user->rank();
334:                 $user_rankimage = '';
335:                 if (isset($userrank['image']) && $userrank['image'] !== '') {
336:                     $user_rankimage = '<img src="' . XOOPS_UPLOAD_URL . '/' . $userrank['image'] . '" alt="' . $userrank['title'] . '" /><br>';
337:                 }
338: 
339:                 return $user_rankimage . $userrank['title'];
340:                 break;
341: 
342:             case 'yesno':
343:                 return $value ? _YES : _NO;
344:                 break;
345: 
346:             case 'timezone':
347:                 include_once $GLOBALS['xoops']->path('class/xoopslists.php');
348:                 $timezones = XoopsLists::getTimeZoneList();
349:                 $value     = empty($value) ? '0' : (string)$value;
350: 
351:                 return $timezones[str_replace('.0', '', $value)];
352:                 break;
353:         }
354:     }
355: 
356:     /**
357:      * Returns a value ready to be saved in the database
358:      *
359:      * @param mixed $value Value to format
360:      *
361:      * @return mixed
362:      */
363:     public function getValueForSave($value)
364:     {
365:         switch ($this->getVar('field_type')) {
366:             default:
367:             case 'textbox':
368:             case 'textarea':
369:             case 'dhtml':
370:             case 'yesno':
371:             case 'timezone':
372:             case 'theme':
373:             case 'language':
374:             case 'list':
375:             case 'select':
376:             case 'radio':
377:             case 'select_multi':
378:             case 'group':
379:             case 'group_multi':
380:             case 'longdate':
381:                 return $value;
382: 
383:             case 'checkbox':
384:                 return (array)$value;
385: 
386:             case 'date':
387:                 if ($value !== '') {
388:                     return strtotime($value);
389:                 }
390: 
391:                 return $value;
392:                 break;
393: 
394:             case 'datetime':
395:                 if (!empty($value)) {
396:                     return strtotime($value['date']) + (int)$value['time'];
397:                 }
398: 
399:                 return $value;
400:                 break;
401:         }
402:     }
403: 
404:     /**
405:      * Get names of user variables
406:      *
407:      * @return array
408:      */
409:     public function getUserVars()
410:     {
411:         /* @var $profile_handler ProfileProfileHandler */
412:         $profile_handler = xoops_getModuleHandler('profile', 'profile');
413: 
414:         return $profile_handler->getUserVars();
415:     }
416: }
417: 
418: /**
419:  * @package             kernel
420:  * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
421:  */
422: class ProfileFieldHandler extends XoopsPersistableObjectHandler
423: {
424:     /**
425:      * @param null|XoopsDatabase $db
426:      */
427:     public function __construct(XoopsDatabase $db)
428:     {
429:         parent::__construct($db, 'profile_field', 'profilefield', 'field_id', 'field_title');
430:     }
431: 
432:     /**
433:      * Read field information from cached storage
434:      *
435:      * @param bool $force_update read fields from database and not cached storage
436:      *
437:      * @return array
438:      */
439:     public function loadFields($force_update = false)
440:     {
441:         static $fields = array();
442:         if (!empty($force_update) || count($fields) == 0) {
443:             $this->table_link = $this->db->prefix('profile_category');
444:             $criteria         = new Criteria('o.field_id', 0, '!=');
445:             $criteria->setSort('l.cat_weight ASC, o.field_weight');
446:             $field_objs =& $this->getByLink($criteria, array('o.*'), true, 'cat_id', 'cat_id');
447:             foreach (array_keys($field_objs) as $i) {
448:                 $fields[$field_objs[$i]->getVar('field_name')] = $field_objs[$i];
449:             }
450:         }
451: 
452:         return $fields;
453:     }
454: 
455:     /**
456:      * save a profile field in the database
457:      *
458:      * @param XoopsObject|ProfileField $obj   reference to the object
459:      * @param bool                     $force whether to force the query execution despite security settings
460:      *
461:      * @internal param bool $checkObject check if the object is dirty and clean the attributes
462:      * @return bool FALSE if failed, TRUE if already present and unchanged or successful
463:      */
464:     public function insert(XoopsObject $obj, $force = false)
465:     {
466:         if (!($obj instanceof $this->className)) {
467:             return false;
468:         }
469:          /* @var $profile_handler ProfileProfileHandler */
470:         $profile_handler = xoops_getModuleHandler('profile', 'profile');
471:         $obj->setVar('field_name', str_replace(' ', '_', $obj->getVar('field_name')));
472:         $obj->cleanVars();
473:         $defaultstring = '';
474:         switch ($obj->getVar('field_type')) {
475:             case 'datetime':
476:             case 'date':
477:                 $obj->setVar('field_valuetype', XOBJ_DTYPE_INT);
478:                 $obj->setVar('field_maxlength', 10);
479:                 break;
480: 
481:             case 'longdate':
482:                 $obj->setVar('field_valuetype', XOBJ_DTYPE_MTIME);
483:                 break;
484: 
485:             case 'yesno':
486:                 $obj->setVar('field_valuetype', XOBJ_DTYPE_INT);
487:                 $obj->setVar('field_maxlength', 1);
488:                 break;
489: 
490:             case 'textbox':
491:                 if ($obj->getVar('field_valuetype') != XOBJ_DTYPE_INT) {
492:                     $obj->setVar('field_valuetype', XOBJ_DTYPE_TXTBOX);
493:                 }
494:                 break;
495: 
496:             case 'autotext':
497:                 if ($obj->getVar('field_valuetype') != XOBJ_DTYPE_INT) {
498:                     $obj->setVar('field_valuetype', XOBJ_DTYPE_TXTAREA);
499:                 }
500:                 break;
501: 
502:             case 'group_multi':
503:             case 'select_multi':
504:             case 'checkbox':
505:                 $obj->setVar('field_valuetype', XOBJ_DTYPE_ARRAY);
506:                 break;
507: 
508:             case 'language':
509:             case 'timezone':
510:             case 'theme':
511:                 $obj->setVar('field_valuetype', XOBJ_DTYPE_TXTBOX);
512:                 break;
513: 
514:             case 'dhtml':
515:             case 'textarea':
516:                 $obj->setVar('field_valuetype', XOBJ_DTYPE_TXTAREA);
517:                 break;
518:         }
519: 
520:         if ($obj->getVar('field_valuetype') === '') {
521:             $obj->setVar('field_valuetype', XOBJ_DTYPE_TXTBOX);
522:         }
523: 
524:         if ((!in_array($obj->getVar('field_name'), $this->getUserVars())) && isset($_REQUEST['field_required'])) {
525:             if ($obj->isNew()) {
526:                 //add column to table
527:                 $changetype = 'ADD';
528:             } else {
529:                 //update column information
530:                 $changetype = 'MODIFY COLUMN';
531:             }
532:             $maxlengthstring = $obj->getVar('field_maxlength') > 0 ? '(' . $obj->getVar('field_maxlength') . ')' : '';
533: 
534:             //set type
535:             switch ($obj->getVar('field_valuetype')) {
536:                 default:
537:                 case XOBJ_DTYPE_ARRAY:
538:                 case XOBJ_DTYPE_UNICODE_ARRAY:
539:                     $type = 'mediumtext';
540:                     $maxlengthstring = '';
541:                     break;
542:                 case XOBJ_DTYPE_UNICODE_EMAIL:
543:                 case XOBJ_DTYPE_UNICODE_TXTBOX:
544:                 case XOBJ_DTYPE_UNICODE_URL:
545:                 case XOBJ_DTYPE_EMAIL:
546:                 case XOBJ_DTYPE_TXTBOX:
547:                 case XOBJ_DTYPE_URL:
548:                     $type = 'varchar';
549:                     // varchars must have a maxlength
550:                     if (!$maxlengthstring) {
551:                         //so set it to max if maxlength is not set - or should it fail?
552:                         $maxlengthstring = '(255)';
553:                         $obj->setVar('field_maxlength', 255);
554:                     }
555:                     break;
556: 
557:                 case XOBJ_DTYPE_INT:
558:                     $type = 'int';
559:                     break;
560: 
561:                 case XOBJ_DTYPE_DECIMAL:
562:                     $type = 'decimal(14,6)';
563:                     break;
564: 
565:                 case XOBJ_DTYPE_FLOAT:
566:                     $type = 'float(15,9)';
567:                     break;
568: 
569:                 case XOBJ_DTYPE_OTHER:
570:                 case XOBJ_DTYPE_UNICODE_TXTAREA:
571:                 case XOBJ_DTYPE_TXTAREA:
572:                     $type            = 'text';
573:                     $maxlengthstring = '';
574:                     break;
575: 
576:                 case XOBJ_DTYPE_MTIME:
577:                     $type            = 'date';
578:                     $maxlengthstring = '';
579:                     break;
580:             }
581: 
582:             $sql = 'ALTER TABLE `' . $profile_handler->table . '` ' . $changetype . ' `' . $obj->cleanVars['field_name'] . '` ' . $type . $maxlengthstring . ' NULL';
583:             $result = $force ? $this->db->queryF($sql) : $this->db->query($sql);
584:             if (!$result) {
585:                 $obj->setErrors($this->db->error());
586:                 return false;
587:             }
588:         }
589: 
590:         //change this to also update the cached field information storage
591:         $obj->setDirty();
592:         if (!parent::insert($obj, $force)) {
593:             return false;
594:         }
595: 
596:         return $obj->getVar('field_id');
597:     }
598: 
599:     /**
600:      * delete a profile field from the database
601:      *
602:      * @param XoopsObject|ProfileField $obj reference to the object to delete
603:      * @param bool   $force
604:      * @return bool FALSE if failed.
605:      **/
606:     public function delete(XoopsObject $obj, $force = false)
607:     {
608:         if (!($obj instanceof $this->className)) {
609:             return false;
610:         }
611:          /* @var $profile_handler ProfileProfileHandler */
612:         $profile_handler = xoops_getModuleHandler('profile', 'profile');
613:         // remove column from table
614:         $sql = 'ALTER TABLE ' . $profile_handler->table . ' DROP `' . $obj->getVar('field_name', 'n') . '`';
615:         if ($this->db->query($sql)) {
616:             //change this to update the cached field information storage
617:             if (!parent::delete($obj, $force)) {
618:                 return false;
619:             }
620: 
621:             if ($obj->getVar('field_show') || $obj->getVar('field_edit')) {
622:                 /* @var $module_handler XoopsModuleHandler */
623:                 $module_handler = xoops_getHandler('module');
624:                 $profile_module = $module_handler->getByDirname('profile');
625:                 if (is_object($profile_module)) {
626:                     // Remove group permissions
627:                     /* @var $groupperm_handler XoopsGroupPermHandler  */
628:                     $groupperm_handler = xoops_getHandler('groupperm');
629:                     $criteria          = new CriteriaCompo(new Criteria('gperm_modid', $profile_module->getVar('mid')));
630:                     $criteria->add(new Criteria('gperm_itemid', $obj->getVar('field_id')));
631: 
632:                     return $groupperm_handler->deleteAll($criteria);
633:                 }
634:             }
635:         }
636: 
637:         return false;
638:     }
639: 
640:     /**
641:      * Get array of standard variable names (user table)
642:      *
643:      * @return array
644:      */
645:     public function getUserVars()
646:     {
647:         return array(
648:             'uid',
649:             'uname',
650:             'name',
651:             'email',
652:             'url',
653:             'user_avatar',
654:             'user_regdate',
655:             'user_icq',
656:             'user_from',
657:             'user_sig',
658:             'user_viewemail',
659:             'actkey',
660:             'user_aim',
661:             'user_yim',
662:             'user_msnm',
663:             'pass',
664:             'posts',
665:             'attachsig',
666:             'rank',
667:             'level',
668:             'theme',
669:             'timezone_offset',
670:             'last_login',
671:             'umode',
672:             'uorder',
673:             'notify_method',
674:             'notify_mode',
675:             'user_occ',
676:             'bio',
677:             'user_intrest',
678:             'user_mailok');
679:     }
680: }
681: 
API documentation generated by ApiGen