Skip to content

evoYTLock reference

Where the lock is enforced

The lock is checked on the server, at four points. Anything that goes through none of them is outside it (see the limits).

PointWhat it watches
onContentBeforeSave (context com_content.article)The layout of articles, whether it comes from the builder, the administration form, the REST API or evoMCP. It compares with what is stored, rejects structure changes, corrects or rejects style changes and regenerates the intro text from the final layout.
YOOtheme app.request middleware (priority 5)Writes made by the YOOtheme application. See the route table.
onExtensionBeforeSave (context com_templates.style)Template styles saved through the Joomla form. Always rejected for a locked user.
customizer.initRemoves sections from the customizer. Interface aid only.

If checking a save fails for any reason, a locked user does not save: the plugin prefers an error to bypassing the lock.

Intro text

On a page with a layout, the intro text is a rendered copy of the layout (blog listings display it). After accepting a save, evoYTLock regenerates it from the final layout so that it cannot carry anything the layout does not have. If YOOtheme is not loaded or rendering fails, it keeps the previous intro text.

YOOtheme routes for a locked user

YOOtheme requests come in through option=com_ajax&p=<route>. For a locked user:

Method and routeResult
Reads (GET, HEAD, OPTIONS)Allowed
POST /pageAllowed; the layout is checked when the article is saved
POST /moduleAllowed only if the data carries nothing but content and a valid id; the module layout is checked under the same rules as an article
POST /builder/encode, POST /builder/image, POST /theme/newsletter/listAllowed
Any other write (POST, PUT, PATCH, DELETE): customizer, builder templates, styles, library, import, cache…Denied with 403

Sections removed from the customizer

layout, styler, settings, builder-templates and joomla-menus. With “Allow creating or removing the layout of a page” off, builder-pages is removed too. This protects nothing on its own: the protection is the route rules.

Element properties

PropertyUse
evoytlock_zoneWith the value free, the element’s subtree is left out of the check. The marked element itself stays locked. Set it on the element’s Lock tab or with evoMCP’s yootheme_update_node_props.

Changing evoytlock_zone counts as changing a style: a locked user cannot.

What is checked in the layout

For each node in the tree, comparing the stored layout with the incoming one:

Violation kindWhat changesEffect
structureA node’s type, or the number or order of its childrenAlways rejected
styleA property that is not on the content listThe save is rejected or the property goes back to its saved value, depending on the setting
sourceDynamic content (source)Same as a style
nodeOther keys of the nodeSame as a style

With “Allow adding and removing repeated items” on, children of type item can be added, removed and reordered. New ones only keep content properties and cannot carry children or dynamic content. The version field of the root node is ignored, because it changes with YOOtheme updates.

Messages to the locked user

WhenReasonMessage (en-GB)
A YOOtheme write is deniedrouteLocked mode: your user can only edit the content of the page.
Adding, removing or moving elementsstructureLocked mode: elements cannot be added, removed or moved.
Change to element styles or settingsstyleLocked mode: element styles and settings cannot be changed.
New layout on a page that had nonecreatedLocked mode: a new layout cannot be given to this page.
Layout removed from a page that had oneremovedLocked mode: the layout of this page cannot be removed.
The layout could not be checkedinvalidLocked mode: the page layout could not be checked.
Saving template styles in the Joomla form(styles form)Locked mode: template styles cannot be modified.

For style and structure, the message adds “Changes not allowed: N (properties: a, b)” and ends with “Nothing was saved. Undo those changes and save again: with your user you can only edit text, images and links.” Properties are shown only if they look like a setting name (letters, digits and underscores, up to 40 characters), to a maximum of five. Paths, values and content are never shown.

Plugin parameters

They are stored as Joomla plugin parameters.

ParameterType
lock_groupsList of group ids
Values: Joomla user group ids · Default: Empty
on_violationText
Values: reject, revert · Default: reject
allow_items0 or 1
Default: 0
allow_create_layout0 or 1
Default: 0
content_propsText, one value per line
Values: See settings · Default: Default content list
readonly_typesText, one value per line
Default: html, module, module_position
item_typesText, one value per line
Default: Empty
log0 or 1
Default: 1
log_ip0 or 1
Values: Only applies when log is 1 · Default: 0

MCP tools (evoMCP)

The plugin itself provides them, with no extra plugin, and they only appear if evoMCP is installed. The user needs core.manage on com_plugins in every case, and core.edit to change settings. The evoMCP connection must have permission on the evoytlock component.

evoMCP permissionToolWhat it does
Readevoytlock_get_settingsReturns the settings: locked groups, mode, item and layout permissions, the content lists and the log (log and log_ip).
Readevoytlock_statusWhether the plugin is enabled, the YOOtheme Pro version and whether it meets the minimum, locked groups with their member counts and the protections in place.
Readevoytlock_checkTells you, without saving anything, what locked mode would do if a locked user saved a layout into an article. Parameters: article_id and layout (a JSON object or JSON text). Returns allowed, reverted, reason and violations (paths and kinds only).
Writeevoytlock_set_settingsChanges the settings. Requires human approval, supports dry_run (returns before and after without touching anything) and checks that the groups exist.

evoytlock_set_settings accepts lock_groups, on_violation, allow_items, allow_create_layout, content_props, readonly_types, item_types, log and log_ip. It decides who can change what on the site’s pages; with an empty lock_groups nobody is locked.

Blocked-attempts log

With “Log blocked attempts” on (log), every rejected or reverted change is written to the Joomla log, category evoytlock, level notice, in the evoytlock.log.php file in the log folder.

A line carries the context (article, module, template_style or route <method> <path>), the decision (rechazado for rejected or revertido for reverted; the words are in Spanish in every language), the reason in brackets and, if there are violations, up to ten of them in the form kind:path.property:

article rechazado (style) style:section[0]/row[0]/column[0]/headline[0].title_element

The path is the element’s position in the layout tree. It carries no content.

The line format is evoYTLock’s own: date and time, level, category and message, separated by tabs, with no IP. If you turn on “Also log the client IP” (log_ip, off by default), the IP of whoever attempted the change is added to every line, next to the level. A log file that already existed keeps its previous #Fields header, which does not mention that change; it is cosmetic only, the new lines are correct. More in data it handles.