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).
| Point | What 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.init | Removes 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 route | Result |
|---|---|
Reads (GET, HEAD, OPTIONS) | Allowed |
POST /page | Allowed; the layout is checked when the article is saved |
POST /module | Allowed 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/list | Allowed |
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
| Property | Use |
|---|---|
evoytlock_zone | With 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 kind | What changes | Effect |
|---|---|---|
structure | A node’s type, or the number or order of its children | Always rejected |
style | A property that is not on the content list | The save is rejected or the property goes back to its saved value, depending on the setting |
source | Dynamic content (source) | Same as a style |
node | Other keys of the node | Same 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
| When | Reason | Message (en-GB) |
|---|---|---|
| A YOOtheme write is denied | route | Locked mode: your user can only edit the content of the page. |
| Adding, removing or moving elements | structure | Locked mode: elements cannot be added, removed or moved. |
| Change to element styles or settings | style | Locked mode: element styles and settings cannot be changed. |
| New layout on a page that had none | created | Locked mode: a new layout cannot be given to this page. |
| Layout removed from a page that had one | removed | Locked mode: the layout of this page cannot be removed. |
| The layout could not be checked | invalid | Locked 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.
| Parameter | Type |
|---|---|
lock_groups | List of group ids Values: Joomla user group ids · Default: Empty |
on_violation | Text Values: reject, revert · Default: reject |
allow_items | 0 or 1 Default: 0 |
allow_create_layout | 0 or 1 Default: 0 |
content_props | Text, one value per line Values: See settings · Default: Default content list |
readonly_types | Text, one value per line Default: html, module, module_position |
item_types | Text, one value per line Default: Empty |
log | 0 or 1 Default: 1 |
log_ip | 0 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 permission | Tool | What it does |
|---|---|---|
| Read | evoytlock_get_settings | Returns the settings: locked groups, mode, item and layout permissions, the content lists and the log (log and log_ip). |
| Read | evoytlock_status | Whether 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. |
| Read | evoytlock_check | Tells 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). |
| Write | evoytlock_set_settings | Changes 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.