Ever wondered if you could only disable some menu items from the User Administration Area for a specific client? This guide will step you through on how to disable specific User Admin Menus for certain domain.
One of my customers requested that he doesn't want his users to see the Email Forwarding, Auto Responder etc. links on the Menu Items of the User Administration area. Definitely a special request as I could not find anything in the Ensim administration area about this. So, had to dig into Ensim more to reveal this. I found the place from where I can disable this. I disabled it. Unfortunately, that disables for all the domains in the appliance. I didnt want that.
Digged a little more in the mercury skin and found that by modifying the mercury.py and the dashboad.py it can be done for specific domain also.
I am going to state the steps here to achieve this functionality for mercury skin only. For other skins it should be pretty straight forward to identify where to modify. Although, this is a quick hack to get the job done, an upgrade from Ensim might overwrite the modifications if they have new file for /usr/lib/opcenter/skins/mercury/mercury.py and /usr/lib/python2.2/site-package/ensimappl/dashboad.py. Also, note that this is for Ensim Pro 3.x.
1. SSH into the Ensim box and then cd into the /usr/lib/opcenter/skins/mercury directory:
[root@ensim ~] # cd /usr/lib/opcenter/skins/mercury
[root@ensim mercury] #
2. Copy the mercury.py to mercury.py.orig. Purpose is to make a backup before you can start pulling your hair.
[root@ensim mercury] # cp mercury.py mercury.py.orig
3. Open the mercury.py file in you favourite editor (mine is 'vi'):
[root@ensim mercury] # vi mercury.py
4. Search for UA_menu_items. You should see something like:
from skin_gui_35 import AA_menu_items,RA_menu_items,\
SA_menu_items,UA_menu_items,\
AA_shortcuts,AA_shortcuts_basic,RA_shortcuts,\
SA_shortcuts,UA_shortcuts,blank_cell
Just delete the "UA_menu_items," from there. Note that the comma after UA_menu_items also should be deleted.
5. Ok, now search for "user_frame" (without the inverted commas). You should see something like this:
def user_frame(self):
r = self.get_response()
site,user = requestutil.get_site_user_from_request(self.REQUEST)
uaconf = dashboard.get_user_conf(site,user)
dashboard.load_user_request(self.REQUEST, uaconf)
self.load_common_translations(uaconf)
a = r.write('''
<HTML>
<HEAD>
<base href="https://%(http_host)s/webhost/services/virtualhosting/useradmin/" />
<!----- Copyright (c) 2000-2003 Ensim Corporation ----->
<TITLE>%(T_User_Administrator)s %(display_version)s %(login_name)s@%(siteinfo_domain)s</TITLE>
</HEAD>
<frameset rows="79,*,7" cols="*" framespacing="0" frameborder="no" border="0">
<frame src="topbar" name="top" frameborder="no" scrolling="no" noresize marginwidth="0" marginheight="0" id="top">
<frameset cols="199,*" framespacing="0" frameborder="no" border="0">
<frame src="navbar" name="navigation" frameborder="no" scrolling="no" noresize marginwidth="0" marginheight="0" id="navigation">
<!--<frame src="view_shortcuts" name="main" frameborder="no" scrolling="auto" noresize marginwidth="0" marginheight="0" id="main" >-->
<frame src="%(firstpage)s" name="main" frameborder="no" scrolling="auto" noresize marginwidth="0" marginheight="0" id="main">
</frameset>
<frame src="footer" name="footer" frameborder="no" scrolling="no" noresize marginwidth="0" marginheight="0" id="footer">
</frameset>
<noframes>
%(frames_warning)s
</noframes>
</HTML>''' % uaconf)
Note that there is a line in the above HTML code which is commented out:
<!--<frame src="view_shortcuts" name="main" frameborder="no" scrolling="auto" noresize marginwidth="0" marginheight="0" id="main" >-->
Also, note that a similar line following this line:
<frame src="%(firstpage)s" name="main" frameborder="no" scrolling="auto" noresize marginwidth="0" marginheight="0" id="main">
The only difference in these two line are the "%(firstpage)s" variable instead of the "view_shorcuts" in the src="" value. In your mercury.py you will not see these modifications. You will have to make these modifications now. All you have to do is comment out the line that is shown commented here, and add the line with "%(firstpage)s" after it.
Save the file and proceed to Step 2.
To be continued.... Too sleepy to continue now... :)