====== Locking Settings in myCNC ======
To prevent unauthorized changes to machine configurations, myCNC allows administrators to lock access to the main Settings (Config) tab.
:!: **Note for newer myCNC versions:** The SYS tab method described below has been reworked and this legacy locking method may no longer be available on your current myCNC version. For current software versions, the recommended method is to hide the configuration button behind a password widget within your screen configuration XML files.
----
===== Method 1: XML Password Widget (Current Software Versions) =====
This method involves editing your profile's screen configuration file (usually ''x-menu.xml'' or similar, depending on your active profile) to hide the Settings button and require a password to reveal it.
When configured correctly, the standard "Machine Settings" icon is completely hidden from the user interface.
- The user must click a designated toggle button (e.g., a Lock icon - see label 1 in the image below).
- This reveals a hidden Password Field (label 2).
- Upon entering the correct password and pressing ''ENTER'', the Settings button (label 3) becomes visible, granting access to the Config screen.
{{:mycnc:mycnc_setup:settings-lock-sample-001.png|Sample interface menu}}
You will need to add or modify the following XML blocks in your screen configuration file. For more information on editing the XML files, see [[..:mycnc_screen_configuration|Screen Editing and Configuration]]
**1. Create the Hidden Settings Button**\\
First, create a container (''myitems'') that is hidden by default (''hidden="1"'') and assign it a specific ''id''. Inside this container, place your standard settings button.
**2. Create the Password Field**\\
Next, create a hidden frame for the password input and the actual ''kdisplay'' input field. The ''action'' command here links the password field to the hidden settings button container.
**3. Create the Toggle Button (Lock Icon)**\\
Finally, create the button that the user presses to make the password field appear.
==== Understanding the Password Formula ====
For obfuscation and security purposes, the actual password the user types is NOT written in plain text in the XML file. Instead, the value in the ''action'' field uses the following formula:
//[Desired Password] + 123456 = [XML Action Value]//
In the code snippet above, the action line reads: ''action="cnc-password-widget-77/123579/%v"''.
* The ''77'' refers to the ''id'' of the hidden container we want to reveal.
* The ''123579'' is our calculated password value.
* If we subtract **123456** from **123579**, we get **123**.
Therefore, in this example, the password the end-user types into the field is simply **123**. If you wanted the password to be **12345**, you would do the math (**12345 + 123456 = 135801**) and write ''action="cnc-password-widget-77/135801/%v"''.
----
===== Method 2: Using the SYS Tab (Older Software Versions) =====
//(:!: Note: This method is deprecated in newer versions of myCNC and only applies to older legacy software builds.)//
Video tutorial (recorded with v1.88.4222):
{{youtube>jKLho1ohi2A?large}}
In order to lock the main settings menu behind a password, follow the instructions below:
1. Open **Settings** by clicking the Settings button on the main screen
{{:mycnc:mycnc_setup:settings-lock-001.jpg}}
2. Select the **Lock Menu** on the screen that appears
{{:mycnc:mycnc_setup:settings-lock-002.jpg}}
3. Select **Change Password, the Lock settings**
{{:mycnc:mycnc_setup:settings-lock-003.jpg}}
4. Leave the **Current Password** field blank if you do not yet have a password, then enter your new password. Press OK.
{{:mycnc:mycnc_setup:settings-lock-004.jpg}}
5. The password prompt should now appear when trying to enter the main Settings menu,
{{:mycnc:mycnc_setup:settings-lock-005.jpg}}
In order to disable the password, go back to the **Lock Menu**, enter your current password and leave the new password fields blank.
{{:mycnc:mycnc_setup:settings-lock-006.jpg}}