m_identity

The m_identity model manages usernames and other user identities. mod_authentication uses it to store and check salted passwords, but also provides a safe storage for user tokens of any kind, as used by mod_facebook.

Note that a user does not have to be of the person category per se, in Zotonic anything can have identities attached to it.

The following m_identity model properties are available in templates:

Property Description Example value
is_user Check if a page id is an user. Return a bool. Usage: m.identity[page_id].is_user true
username Fetch the username, if any, of a user. Returns a binary or undefined. Usage: m.identity[page_id].username <<”admin”>>

Edit on GitHub

m_media Models m_rsc_gone

Referred by

username_unique

Check if an entered username is unique, by looking in the m_identity table for the given username:

email_unique

Check if an entered e-mail address is unique, by looking in the m_identity table for the email key: