Overview

Namespaces

  • None
  • PHP

Classes

  • Breadcrumb
  • Breadcrumbs
  • CacheFile
  • Comment
  • CommentArray
  • CommentFilter
  • CommentForm
  • CommentList
  • Config
  • Database
  • DatabaseQuery
  • DatabaseQuerySelect
  • DatabaseQuerySelectFulltext
  • DatabaseStopwords
  • Debug
  • Field
  • Fieldgroup
  • Fieldgroups
  • FieldgroupsArray
  • Fields
  • FieldsArray
  • Fieldtype
  • FieldtypeMulti
  • Fieldtypes
  • FileLog
  • FilenameArray
  • Fuel
  • HookEvent
  • ImageSizer
  • Inputfield
  • InputfieldsArray
  • InputfieldWrapper
  • Language
  • LanguageParser
  • Languages
  • LanguagesPageFieldValue
  • LanguageSupportInstall
  • LanguageTranslator
  • Markdown_Parser
  • MarkdownExtra_Parser
  • ModuleJS
  • ModulePlaceholder
  • Modules
  • Notice
  • NoticeError
  • NoticeMessage
  • Notices
  • NullPage
  • Page
  • PageArray
  • Pagefile
  • Pagefiles
  • PagefilesManager
  • PageFinder
  • Pageimage
  • Pageimages
  • PagerNav
  • PagerNavItem
  • Pages
  • PagesAccess
  • PagesSortfields
  • PagesType
  • Paths
  • Permission
  • Permissions
  • Process
  • ProcessController
  • ProcessWire
  • Role
  • Roles
  • Sanitizer
  • Selector
  • SelectorBitwiseAnd
  • SelectorContains
  • SelectorContainsLike
  • SelectorContainsWords
  • SelectorEnds
  • SelectorEqual
  • SelectorGreaterThan
  • SelectorGreaterThanEqual
  • SelectorLessThan
  • SelectorLessThanEqual
  • SelectorNotEqual
  • Selectors
  • SelectorStarts
  • Session
  • SessionCSRF
  • SmartyPants_Parser
  • SmartyPantsTypographer_Parser
  • SystemUpdate1
  • Template
  • TemplateFile
  • Templates
  • TemplatesArray
  • Textformatter
  • Textile
  • User
  • Users
  • Wire
  • WireArray
  • WireData
  • WireInput
  • WireInputData
  • WireSaveableItems
  • WireSaveableItemsLookup
  • WireUpload

Interfaces

  • CommentFormInterface
  • CommentListInterface
  • ConfigurableModule
  • FieldtypeLanguageInterface
  • FieldtypePageTitleCompatible
  • HasLookupItems
  • HasRoles
  • InputfieldHasArrayValue
  • Module
  • Saveable
  • TrackChanges

Exceptions

  • ProcessController404Exception
  • ProcessControllerPermissionException
  • Wire404Exception
  • WireDatabaseException
  • WireException
  • WirePermissionException

Functions

  • __
  • _n
  • _x
  • fuel
  • identify_modifier_markdown
  • Markdown
  • mdwp_add_p
  • mdwp_hide_tags
  • mdwp_show_tags
  • mdwp_strip_p
  • ProcessWireClassLoader
  • ProcessWireHostSiteConfig
  • ProcessWireShutdown
  • removeNewlines
  • SmartDashes
  • SmartEllipsis
  • SmartQuotes
  • smarty_modifier_markdown
  • smarty_modifier_smartypants
  • SmartyPants
  • tabIndent
  • unregisterGLOBALS
  • wire
  • wireDecodeJSON
  • wireEncodeJSON
  • wireMkdir
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class User

ProcessWire UserPage

A type of Page used for storing an individual User

ProcessWire 2.x Copyright (C) 2011 by Ryan Cramer Licensed under GNU/GPL v2, see LICENSE.TXT

http://www.processwire.com http://www.ryancramer.com

Wire implements TrackChanges
Extended by WireData implements IteratorAggregate
Extended by Page
Extended by User
Located at core/User.php
Methods summary
public
# __construct( Template $tpl = null )

Create a new User page in memory.

Create a new User page in memory.

Parameters

$tpl
Template
Template object this page should use.
public boolean
# hasRole( string|Role|integer $role )

Does this user have the given role? (object, name or id)

Does this user have the given role? (object, name or id)

Parameters

$role
string|Role|integer

Returns

boolean
public boolean
# addRole( string|integer|Role $role )

Add the given role string, id or object

Add the given role string, id or object

This is the same as $user->roles->add($role) except this one will accept ID or name.

Parameters

$role
string|integer|Role

Returns

boolean
false if role not recognized, true otherwise
public boolean
# removeRole( string|integer|Role $role )

Remove the given role string, id or object

Remove the given role string, id or object

This is the same as $user->roles->remove($role) except this one will accept ID or name.

Parameters

$role
string|integer|Role

Returns

boolean
false if role not recognized, true otherwise
public boolean
# hasPermission( string|Permission $name, Page|Template $context = null )

Does the user have the given permission, OR the given permission in the given context?

Does the user have the given permission, OR the given permission in the given context?

Context may be a Page or a Template. This method serves as the public interface to the hasPagePermission and hasTemplatePermission methods.

Parameters

$name
string|Permission
Permission name
$context
Page|Template
Page or Template

Returns

boolean
protected boolean
# hasPagePermission( string|Permission $name, Page $page = null )

Does this user have the given permission name?

Does this user have the given permission name?

This is a basic permission check and it is recommended that you use those from the PagePermissions module instead. You use the PagePermissions module by calling the editable(), addable(), etc., functions on a page object. The PagePermissions does use this function for some of it's checking.

Parameters

$name
string|Permission
$page
Page
Optional page to check against

Returns

boolean
protected boolean
# hasTemplatePermission( string $name, Template|integer|string $template )

Does this user have the given permission on the given template?

Does this user have the given permission on the given template?

Parameters

$name
string
Permission name
$template
Template|integer|string
Template object, name or ID

Returns

boolean
public boolean
# getPermissions( Page $page = null )

Get this user's permissions, optionally within the context of a Page

Get this user's permissions, optionally within the context of a Page

Does not currently include page-add or page-create permissions.

Parameters

$page
Page
Optional page to check against

Returns

boolean
public boolean
# isSuperuser( )

Does this user have the superuser role?

Does this user have the superuser role?

Same as $user->roles->has('name=superuser');

Returns

boolean
public boolean
# isGuest( )

Is this the non-logged in guest user?

Is this the non-logged in guest user?

Returns

boolean
public boolean
# isLoggedin( )

Is the current user logged in?

Is the current user logged in?

Returns

boolean
Methods inherited from Page
___loaded(), ___path(), __clone(), __destruct(), __get(), __isset(), __set(), __toString(), addStatus(), child(), children(), delete(), filesManager(), find(), get(), getAccessParent(), getAccessRoles(), getAccessTemplate(), getFieldFirstValue(), getFieldValue(), getInputfields(), getIterator(), getTemplateFile(), getUnformatted(), hasAccessRole(), httpUrl(), is(), isChanged(), isHidden(), isLoaded(), isNew(), isTrash(), matches(), next(), of(), outputFormatting(), parent(), parents(), path(), prev(), processFieldDataQueue(), removeStatus(), rootParent(), save(), set(), setFieldValue(), setIsLoaded(), setIsNew(), setOutputFormatting(), setParent(), setStatus(), setTemplate(), setUser(), siblings(), trash(), uncache(), url()
Methods inherited from WireData
__unset(), getArray(), has(), isEqual(), remove(), setArray()
Methods inherited from Wire
_(), ___changed(), __call(), _n(), _x(), addHook(), addHookAfter(), addHookBefore(), addHookProperty(), className(), error(), fuel(), getAllFuel(), getChanges(), getFuel(), getHooks(), isHooked(), message(), removeHook(), resetTrackChanges(), runHooks(), setFuel(), setTrackChanges(), trackChange(), trackChanges(), untrackChange(), useFuel()
Constants inherited from Page
statusCorrupted, statusDeleted, statusHidden, statusLocked, statusMax, statusOn, statusSystem, statusSystemID, statusSystemOverride, statusTrash, statusUnpublished
Properties inherited from Page
$config, $fieldDataQueue, $instanceID, $instanceIDs, $isLoaded, $isNew, $loadingStack, $outputFormatting, $pageNum, $parent, $settings, $template
Properties inherited from WireData
$data
Properties inherited from Wire
$changes, $defaultHookOptions, $fuel, $hookMethodCache, $localHooks, $staticHooks, $trackChanges, $useFuel
ProcessWire API documentation generated by ApiGen 2.6.0