nlaruelle
Verified User
- Joined
- Nov 12, 2023
- Messages
- 22
Hello,
I have already reported in this thread (https://forum.directadmin.com/threads/how-to-update-existing-reseller-and-user-skins.67475/) the big difficulties in forcing all users and resellers on a specific "Default Layout", but I haven't received any response from the DirectAdmin team, so I'm taking my chance by opening my own thread.
My need is quite simple:
I want all my users and resellers to be forced on the same interface to avoid for example having 25% of users choosing a "List Layout"… 25% a "Refreshed Layout"… and the rest split between "Standard", "Sidebar", "Hybrid", and "Refreshed".
It's a pretty basic need to want the same interface for all users, right?
This avoids confusion when we publish screenshots in the knowledge base.
Additionally, the technical support staff is less confused if they always work with the same interface.
Personally, I admit I prefer the "Icons Grid" layout because it reminds me of my habits with cPanel. I would also like to enforce the option "Forbid users changing the skin layout on user level" for all my resellers.
The "Dashboard Mode" of Refreshed should be "Menu" by default instead of "Widgets," etc.
By the way… ALL options in "/customize-skin/options" should be easily enforceable "globally"
To accomplish this (more or less), I had removed access to "Customize Evolution Skin" for my users (in /usr/local/directadmin/data/users/$USER/skin_customizations/evolution/files/menu-v3.json, by bash+cron) and created a second bash script that changed the value of "da: options/skin/layout" to "grid" for all my users and resellers:
Unfortunately, as often happens with DirectAdmin (which I regret), the changes were not persistent (due to a lack of backward compatibility) and did not survive DirectAdmin updates for long.
Since the latest DirectAdmin update, all my resellers' skin settings were overwritten (lost), and all my resellers found themselves with a very different interface overnight from the one they were familiar to.
Even my logo and favicon disappeared, as they were configured only for "Icons Grid" and not for "Refreshed."
To be honest, I was informed of this sudden interface change through few customer complaint tickets. They think about a bug since they were familiar with the previous minimalist "Icons Grid" interface.
The issue is that the structure of the user config file has changed significantly for /usr/local/directadmin/data/users/$USER/skin_customizations/evolution/user_options.json.
Now, we have a numerical value for /reseller/customize-skin that is different for each reseller.
For example :
It is therefore impossible for me to adapt my bash to force the default layout to "Icons Grid," as I don’t know how to guess the value to assign to each /reseller/customize-skin.
Overall, I would prefer to stop randomly tinkering with bash scripts and cron jobs that modify .conf and .json files.
Also, I can't manually navigate through hundreds of user sub-accounts to change the setting by hand every time I want to globally modify an option under "Customize Evolution Skin."
So, what is the proper way to set a unique "Default Layout" globally for all my users/resllers (as well as the other options available in "Customize Evolution Skin" (Layout Options, etc.)), for both old and new users?
A command line?
A feature to enhance in the DirectAdmin interface?
Thank you in advance for your help with this issue, which is very important for my DirectAdmin projects, as it greatly affects my users' experience.
I have already reported in this thread (https://forum.directadmin.com/threads/how-to-update-existing-reseller-and-user-skins.67475/) the big difficulties in forcing all users and resellers on a specific "Default Layout", but I haven't received any response from the DirectAdmin team, so I'm taking my chance by opening my own thread.
My need is quite simple:
I want all my users and resellers to be forced on the same interface to avoid for example having 25% of users choosing a "List Layout"… 25% a "Refreshed Layout"… and the rest split between "Standard", "Sidebar", "Hybrid", and "Refreshed".
It's a pretty basic need to want the same interface for all users, right?
This avoids confusion when we publish screenshots in the knowledge base.
Additionally, the technical support staff is less confused if they always work with the same interface.
Personally, I admit I prefer the "Icons Grid" layout because it reminds me of my habits with cPanel. I would also like to enforce the option "Forbid users changing the skin layout on user level" for all my resellers.
The "Dashboard Mode" of Refreshed should be "Menu" by default instead of "Widgets," etc.
By the way… ALL options in "/customize-skin/options" should be easily enforceable "globally"
To accomplish this (more or less), I had removed access to "Customize Evolution Skin" for my users (in /usr/local/directadmin/data/users/$USER/skin_customizations/evolution/files/menu-v3.json, by bash+cron) and created a second bash script that changed the value of "da: options/skin/layout" to "grid" for all my users and resellers:
Code:
#!/bin/bash
for USER in $(ls /usr/local/directadmin/data/users/); do
USER_OPTIONS_JSON="/usr/local/directadmin/data/users/$USER/skin_customizations/evolution/user_options.json"
OPTIONS_V4_JSON="/usr/local/directadmin/data/users/$USER/skin_customizations/evolution/files/options-v4.json"
if [ -f "$USER_OPTIONS_JSON" ]; then
SKIN_LAYOUT_VALUE=$(grep -oP '(?<="da:options/skin/layout":")\\?"[^"]*' "$USER_OPTIONS_JSON")
if [ -z "$SKIN_LAYOUT_VALUE" ] || [ "$SKIN_LAYOUT_VALUE" != "\\\"grid\\\"" ]; then
sed -i 's/\("da:options\/skin\/layout":"\)[^"]*\("\)/\1\\"grid\\"\2/' "$USER_OPTIONS_JSON"
fi
fi
if [ -f "$OPTIONS_V4_JSON" ]; then
SKIN_LAYOUT_V4_VALUE=$(grep -oP '(?<="skin/layout": ")[^"]*' "$OPTIONS_V4_JSON")
if [ -z "$SKIN_LAYOUT_V4_VALUE" ] || [ "$SKIN_LAYOUT_V4_VALUE" != "grid" ]; then
sed -i 's/\("skin\/layout": "\)[^"]*\("\)/\1grid\2/' "$OPTIONS_V4_JSON"
fi
fi
if [ -f "$OPTIONS_V4_JSON" ]; then
SIMPLE_LAYOUT_VALUE=$(grep -oP '(?<="simple-layout/navigation/display-type": ")[^"]*' "$OPTIONS_V4_JSON")
if [ -z "$SIMPLE_LAYOUT_VALUE" ] || [ "$SIMPLE_LAYOUT_VALUE" != "grid" ]; then
sed -i 's/\("simple-layout\/navigation\/display-type": "\)[^"]*\("\)/\1grid\2/' "$OPTIONS_V4_JSON"
fi
fi
done
Unfortunately, as often happens with DirectAdmin (which I regret), the changes were not persistent (due to a lack of backward compatibility) and did not survive DirectAdmin updates for long.
Since the latest DirectAdmin update, all my resellers' skin settings were overwritten (lost), and all my resellers found themselves with a very different interface overnight from the one they were familiar to.
Even my logo and favicon disappeared, as they were configured only for "Icons Grid" and not for "Refreshed."
To be honest, I was informed of this sudden interface change through few customer complaint tickets. They think about a bug since they were familiar with the previous minimalist "Icons Grid" interface.
The issue is that the structure of the user config file has changed significantly for /usr/local/directadmin/data/users/$USER/skin_customizations/evolution/user_options.json.
Now, we have a numerical value for /reseller/customize-skin that is different for each reseller.
For example :
JSON:
{"da:options/search/settings":"[\"domains\",\"email\",\"ftp\",\"db\",\"plugin\",\"route\",\"admins\",\"resellers\",\"users\"]","da:options/skin/date-formats/date":"\"dd'/'MM'/'yyyy\"","da:options/skin/date-formats/datetime":"\"dd'/'MM'/'yyyy HH':'mm\"","da:options/skin/date-formats/weekStart":"\"monday\"","da:options/skin/fixed-color-mode":"\"none\"","da:options/skin/language":"\"en\"","da:options/standard-2021-layout/frequent-routes":"[[\"/user/domains\",242],[\"/reseller/customize-skin\",XXXXXXXXXXXXXXXXXXX]]","da:options/standard-2021-layout/user-dashboard-type":"\"widgets\"","da:options/user/level":"\"reseller\""}
Overall, I would prefer to stop randomly tinkering with bash scripts and cron jobs that modify .conf and .json files.
Also, I can't manually navigate through hundreds of user sub-accounts to change the setting by hand every time I want to globally modify an option under "Customize Evolution Skin."
So, what is the proper way to set a unique "Default Layout" globally for all my users/resllers (as well as the other options available in "Customize Evolution Skin" (Layout Options, etc.)), for both old and new users?
A command line?
A feature to enhance in the DirectAdmin interface?
Thank you in advance for your help with this issue, which is very important for my DirectAdmin projects, as it greatly affects my users' experience.