Documentation
A validator to check whether a password conforms to the password secutiry requirements.
Check if an input value evaluates to true.
Access control is about defining who is allowed to access certain resources. It takes two steps:
Modify the list of collaboration groups of a user. Called internally by the ACL modules when fetching the list of…
Set the context to a typical authenticated user. Used by m_acl.erl
Check if a user is authorized to perform an operation on a an object (some resource or module). Observe this…
Check if a user is authorizded to perform an action on a property. Defaults to true .
Check if a user is the owner of a resource. id is the resource id.
Clear the associated access policy for the context.
Initialize context with the access policy for the user.
MQTT acl check, called via the normal acl notifications. Actions for these checks: subscribe, publish
acl_context_authenticated acl_is_allowed acl_is_allowed_prop acl_is_owner acl_logoff acl_logon acl_mqtt acl_user_groups…
Authorization checks to perform, in addition to the acl_action dispatch option, can be given in the acl dispatch option
Return the groups for the current user.
Modify the list of user groups of a user. Called internally by the ACL modules when fetching the list of user groups a…
Render the javascript for a custom action event type. The custom event type must be a tuple, for example: {% wire…
with_args
Rescuing a dysfunctional site from the Zotonic shell.
An activity in Zotonic. When this is handled as a notification then return a list of patterns matching this activity.
Push a list of activities via a ‘channel’ (eg ‘email’) to a recipient. The activities are a list of #activity{} records.
Add a css class to an html element.
Adds a day to a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Adds an hour to a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Adds a month to a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Adds a week to a date. The value must be of the form {{Y,M,D},{H,I,S}} .
Adds a year to a date. The value must be of the form {{Y,M,D},{H,I,S}} .
admin_tasks redirect_incat
Creating a custom widget on the edit page Customizing the layout of the admin edit page Customizing the style of an…
Dispatch rules Name Path Resource Args admin_user [“admin”,”users”] controller_admin [{template,”admin_users.tpl”}
Used in the admin to fetch the possible blocks for display
Used for fetching the menu in the admin.
Used in the admin to process a submitted resource form
Action module which provides postback handlers for the “status” view of the admin:
Admin template specific things
Common markup in admin templates.
Return the first element after another element in a list. For example:
Show an alert dialog.
Include a template for all a resource’s categories from all modules.
All the dispatch rules from all modules. For a background on dispatch rules, see The URL dispatch system.
Call all modules to include a certain template.
Add a $(..).animate jQuery call to the target element.
Appends the argument to the value.
Convert a value to an Erlang atom.
Notify after logon of user with username, communicates valid or invalid password
Send a request to the client to login a user. The zotonic.auth.worker.js will send a request to…
Send a request to the client to switch users. The zotonic.auth.worker.js will send a request to…
Confirm a user id.
A user id has been confirmed.
auth_checked auth_confirm auth_confirm_done auth_client_logon_user auth_client_switch_user auth_identity_types…
Return the list of identity types that allow somebody to logon and become an active user of the system. Defaults to […
User is about to log off. Modify (if needed) the logoff request context.
User logs on. Add user-related properties to the logon request context.
Update the given (accumulator) authentication options with the request options. Note that the request options are from…
First for logon of user with username, called after successful password check.
First for logon of user with username, check for ratelimit, blocks etc.
First to check for password reset forms, return undefined, ok, or {error, Reason}.
First to validate a password. Return {ok, RscId} or {error, Reason}.
Authentication against some (external or internal) service was validated
Automatically apply HTML escaping to values.
Automatically add new users to a user group
Why When you create a person, you usually need to add it to a user group as well. You may want to automate this, in…
Automatic startup on system boot
Once you have Zotonic running, you want to make sure that it automatically starts up when the server reboots, so that…
Dispatch rules Name Path Resource Args admin_backup [“admin”,”backup”] controller_admin_backup [seo_noindex]…
backup_start
Action which starts a manual backup.
Return the first element before another element in a list. For example:
Creating sites Media Best Practices Template Best Practices and Pitfalls
first last length to_binary
yesno
Translate HTML <br/> elements into ASCII newlines ( \n ).
There are multiple ways to set up interaction between server-side Zotonic code and client-side JavaScript.
Makes a button with an action attached.
Cache frequently used rendered template output for later reuse.
Call an Erlang function.
Converts the first character of the value to uppercase.
Save (and update) the complete category hierarchy
Include another template based on the category of a resource. The include tag is replaced with the contents of the…
Centers the value in a field of a certain width using spaces.
brlinebreaks escape escape_check escape_ical escape_link escapejs escapejson escapexml fix_ampersands force_escape…
Show a pie chart.
Show a pie chart with 3D effect.
This filter splits a list in shorter lists. It splits an array in sub-arrays of at most a given length. This is useful…
Zotonic is a Content Management System (CMS).
The zotonic command runs a number of utility commands which all operate on a Zotonic instance.
The Zotonic shell gives you access to a running Zotonic instance with its code and data.
Ignore part of a template.
Notification to signal an inserted comment. ‘comment_id’ is the id of the inserted comment, ‘id’ is the id of the…
config_delete config_toggle dialog_config_delete dialog_config_edit dialog_config_new
Trigger the deletion of a configuration value. Used in the admin.
Toggle a configuration value. Used in the admin, for instance when displaying a “live” checkbox the state of which…
Global configuration Site configuration Port configurations
Show a JavaScript confirm message and on confirmation triggers one or more actions and/or sends a postback to the…
Check if two inputs are the same.
Check and possibly modify the http response security headers All headers are in lowercase.
Get available content types and their dispatch rules Example: {{<<”text”>>, <<”html”>>, []}, page} A special dispatch…
We encourage contributions to Zotonic from the community! This chapter describes how you can help improve Zotonic.
The admin controller is the main controller behind which admin pages are served. Its main purpose is that it does an…