sentora-core icon indicating copy to clipboard operation
sentora-core copied to clipboard

DNS Manager update + substr like syntax for ui_lang::translate()

Open denysvitali opened this issue 10 years ago • 8 comments

With this edit I enabled administrators (from group ID 1) to manage any DNS domain, even if not owned by himself. I did this change because using the "shadowing" feature while having DNS Manager disabled for users doesn't let anyone to edit DNS values of the treated domain sentora-dns-update

I also edited the substr like feature in ui_lang::translate() in order to let creating awesome strings with ui_lang::translate("Hello %s",$username) like when you use sprintf()

denysvitali avatar Nov 19 '14 20:11 denysvitali

This is an interesting feature, and as you mentioned, maybe a good idea. But, i would suggest making a new module that does this rather than edit a core module. This way, an admin can add the module if he wants/needs it and it won't interfere with the core.

TGates71 avatar Nov 19 '14 21:11 TGates71

Isn't logic that an admin MUST have access to the whole server? Including other users data, and DNS zones

denysvitali avatar Nov 19 '14 22:11 denysvitali

I'll tag Bobby and see what he thinks ;) @bobsta63

TGates71 avatar Nov 20 '14 17:11 TGates71

Editing all reseller or client data is already possible and supposed to be done via the "Shadow" function.

I will have to review the details about changes proposed, but I think that enabling the master admin to directly edit reseller or client DNS outside of "shadow" function is out of the concept of the panel, and may become a problem according to security against mistakes : it would be extended to other modules and will become a problem with prefixes used for table, etc...

5050 avatar Nov 26 '14 14:11 5050

About modif of translate() : it is definitively not to the "translate()" function to handle parameters replacement. You can use sprintf(translate(), args); if you want, or create a new function to do it.

Note : the translate() function will be replaced by a system that will uses less resources, most likely by an included php file per language and per module containing module's texts defined in vars or constants.

5050 avatar Nov 26 '14 15:11 5050

Actually it isn't possible to edit a user's DNS zone having DNS Manager disable for the users.

If the module "DNS Manager" is disabled per-user and an admin must do an edit to the dns zone of the client he must enable DNS Manager globally for all users first, then use the shadow mode, make the changes and disable again the DNS Manager. While the DNS Manager is enabled every user could edit their DNS zones, which isn't the goal since you disabled it.

denysvitali avatar Nov 26 '14 21:11 denysvitali

Ok, I understand.

I feel there is a "bug" : while he is in shadow mode, an admin (or reseller) must be able to access to all modules enabled for admin + modules enabled to the user shadowed (if there is any not enabled for admin).

I will do a look on that, but not immediately (I hope to not forget as there is a pending pull request).

5050 avatar Nov 29 '14 18:11 5050

We'll tackle this as part of the 1.1 release.... Assigning to myself to look at the correct implementation, I also agree, there does appear to be a 'bug' in the DNS manager as I personally feel that an admin or reseller should ONLY edit user DNS when using the shadow feature - I for one know that I'd rather not see a massive list of domains, I'd much rather shadow a user to understand what account the domain(s) are on.

allebb avatar Feb 11 '15 10:02 allebb