Multiple layouts in zend framework - zend-framework

In my site I want two layouts.
Main layout comes when no login.
Whenever a user logs in there will be 1 more layout inside 1st with menu for account changes etc.
Can anyone explain how can we do it.?

If you just want to change the navigation for logged in/not logged in users, look into role privileges in zend_navigation_page
http://framework.zend.com/manual/en/zend.navigation.pages.html

Several options.
One is to use a pre-dispatch front controller plugin. Simply check Zend_Auth to see if user is logged in. If so, then set the layout to the 'logged-in' layout, else leave as default layout.
Another option is to check Zend_Auth from inside your actual layout file, and only include the additional code/formatting if they are logged in.

Related

Hide modules from current user in the navigation bar in Suitecrm

I am right now using LDAP authentication for adding user in Suitecrm. In normal course when the user is added to the system we can assign him roles during creation and also hide some modules which are enabled for him, in his portal .
With LDAP authentication I have been able to assign user to a role through code when he first logins but hiding modules for those users by code or otherwise has not been possible
Can anyone guide me as to how to hide modules from the current user which otherwise show in the navigation bar?
Thanks in advance.
There is upgrade safe manner to do it via smarty file.
Check your active theme and copy the file from themes/<active_theme>/tpls/_headerModuleList.tpl to custom/themes/<active_theme>/tpls/_headerModuleList.tpl (if custom directory doesn't exist then create it)
Search for groupTabs, you will see foreach loops for processing it for different views. Hopefully, you can add your code there to do anything.

Adding buttons to admin user list section of moodle

I need to add a button for each user in admin's user list (admin/user.php).
is it possible to do it from my local plugin? if yes how?
Or I need to edit the user modules manually?
The only way to do this without a core code modification, would be to use the theme (or possibly a local plugin) to inject some javascript into the page to add the button after the page has loaded.
The page itself is quite old, so it doesn't use a renderer, so overriding the generated HTML via the theme is not an option. The user actions aren't designed to be pluginable either.
Depending on what you are wanting to do, you could, of course, create a local plugin that adds a new link to the 'Site administration' tree. On the page this links to, you could add your own list of users, with whatever buttons you wanted on them.

How to hide a page based on the logged-in user in CQ5?

I want to hide a page in navigation component based on the logged in user. I have two approaches in mind. Set permissions on the page's node in CRX-DE; denying it for all users; and then allowing it for specific groups. I have been trying it; not found much success. Else; I can get the id of the logged in user in the jsp and based on the user group; I can set the page's property 'Hide in Navigation' . But I am not able to find how to set that property in jsp. Please suggest.
Edit:
I am using the default authentication.I wanted to hide a page from navigation in the default 'list' component. If I use CUG; the users belonging to that group will still be able to see that particular page's link in the list component; and would be asked for login on clicking on that page.I want the link itself to be hidden if the user belonged to a particular group
Thanks.
If you are using the default authentication features in AEM (like Geometrixx), which rely on users that exist in AEM, you can use Closed User Groups. CUG allows you to set what users or groups can or cannot see a specific page. You can see where to set CUGs in the page properties dialog for each page. I'm pretty sure CUG settings inherit down the page hierarchy as well.
Using the JCR permissions for this is a good deal more complex, because it's such a low-level architectural thing. However, for more complex solutions, sometimes it's a necessary part of the equation.
I agree with ryanluka that going for JCR permissions should be avoided when the problem can be solved by much simpler approach. I modified the list.jsp of the default list component. Extracted the login user's id using Userpropertiesutil; and based on the group; wrote the code in jQuery to remove that particular page's div from list component.

Administrator has no admin bar for specific pages

I have an issue with a dotnetnuke 7 site, where the administrator cannot edit a minority of the pages.
When logged in and on such a page, the edit page menu missing.
When on the page management view, there are only options to view or make homepage. On clicking, properties are not shown.
What could be causing this?
Cheers, mark
I've seen in the past where the Administrator Role Id is incorrectly defined in the database.
Unfortunately there isn't a UI way to change this, you'll need to go into the DB to see what Role ID is defined. I believe AdministratorRoleID is stored either in the Portals table, or in the PortalSettings or PortalLocalization table. Check the # and see if that matches the ID of the Administrators role for that portal.
It could also be a CSS issue if it only affects some pages. Can you try changing the skin on those pages to the default skin and try again...
Just noticed this old question, so I thought that I'd update with what the actual problem was.
We imported pages using a direct to database program - we naturally assumed that the site administrator could, as a default be able to edit pages within their own site.
As it turns out, DNN actually creates correct access rights to each page as they are created, and rights are added and removed as required. This means that if you create pages you must directly create access rights for the correct site administrator.
Kind Regards, Mark, IA

MODx removing content resource field

How do I hide the content resource field from non-admin users?
So you'd like a user to be able to change document fields such as title, alias etc but not the content?
You can not lock individual fields to admin user (as far as I know). You can either lock the whole page/resource or you could put the content that you want to be locked into the template for that document and lock the template to only the admin user which would achieve the same effect.
Make sure you don't have a reference to [+content+] in the template and even if the user enters document content it won't impact the page.
New answer instead of editing the above as this is a much cleaner solution.
Create different user groups eg. Admin & Editor
Make sure admin is in the admin user group
Create a template variable for your content and in the Access Permissions section only tick the admin group.
Assign the TV to your template.
Now if the user isn't in the admin user group the TV won't even be visible when they are editing the resource.
Hey, thanks for the answer.
I thought I'd post what I ended up doing.
With MODx Evo 1+, you have managermanager included. After removing the included file(which is used rather than the default chunk) using the rules in there I can rename hide and sync content.