I'm working in MVC 3 with C#. I'm working on security trimming. I'm obviously implementing it through a sitemap. My question is can I pass the user's current user name to the sitemap? My goal is to have an "account" link that has text equal to the user's user name. Right now my sitemap code looks like:
<siteMapNode title="Account" description="Account settings" url="~/Account" />
This code is nestled correctly and everything is fine. I just want to know how to make the title section update dynamically and match the user's username. Is this possible?
Additional information: all trimming is done through the code expressed in this article. Additionally, this is my sitemap string:
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
Profiles are done through ASP .NET SQL Profile/Role Provider. Thanks in advance.
HttpContext.Current.User if not null
Related
I had to add a series of custom fields to the joomla registration form. Thanks to the guide I managed to do it, both for the registration form and for the administrator form.
The process I followed for this are the following:
Added the fields to the users table
Added the fields in joomla user entity /library/src/user/user.php
Added the fields and definition to /components/com_users/model/forms/registration.xml file to update the registration form
Added the fields and definition to administrator/components/com_users/model/forms/user.xml file to update the user edition form for user with administrator role
Now I require the user to be able to change their profile data with the inthe fields that were created manually. To do this I added a link to the menu
form to edit profile, here I expected to see all user fields, both native and custom created, but instead I obtain only the native fields, although upon inspecting the object (user) I can access all the user fields.
I created the fields by hand and then I expected that when they were saved they would persist, but it is not, when sending the form only the native data is updated and not the custom fields.
When I inspect, I see that a component named k2 is the one that facilitates this profile editing form, I am new to joomla and its ecosystem
Could you please give me guidance on how to implement this task?
Greetings and thanks in advance
Do not edit core components.
There is a way to do the same using Profile plugin.
https://docs.joomla.org/Creating_a_profile_plugin
Go through above link and create a new profile plugin.
This is not the way to add extra user fields. What will you do if you need to update Joomla. Joomla releases security updates at regular intervals. First you need to create a user plugin and then you add whatever user fields you need. I found a detailed description here, you also can have a look. if still you get any doubts you can ask me here in comments.
https://smartyblog.com/adding-custom-fields-to-joomla-registration-using-profile-plugin/
I have been looking into Broadleaf since last couple of days. I have managed to run it on local tomcat with MySql. I have extended Entity for my custom requirement following Broadleaf's documentation.
Now I want to add a menu option (in left menu) in admin. I have no clue from where Broadleaf admin site displays the web page. How left menu is displayed ? How data from controller are binding with view ?
For example, if you access product page in broadleaf admin section, then URL will be http://localhost:8081/admin/product/. Following it I managed to know that it calls AdminProductController.java of framework's admin module. I looked at the code of AdminProductController.java but didn't get a clue how data is being forwarded to view. Also didn't find the product jsp/template/html.
I guess admin module is using EntityForm.java for view. If I intend to use simple jstl then is it possible?
My question how easily I can extend admin of Heat Clinic demo site to add new pages, menu items etc? If anyone has customized/extended demosite admin then please suggest.
We have some docs on how to do this at http://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/admin/admin-custom-controllers. The bottom line here is that if you want to add a new page then you can simply use normal Spring MVC as you would on the frontend. The only difference is that there are some specific ways to place new template files (which is documented on that page).
To answer your question, most URLs in the admin are handled dynamically by the AdminBasicEntityController. Most of the sections are handled generically by this controller but there are still certain instances where we needed to override things specifically, like with AdminProductController.
Also, the admin is built with Thymeleaf and not JSPs so if you want to add more pages they will need to be done with Thymeleaf.
Ok so I’m trying to implement social media into the footer. However, they are images that change color when hovered over that I’m working into the CSS.
But my question is, if the end user changed their Facebook URL, how will they update the url? I obviously can’t just put it directly into the theme because then the end-user will know how to program and where to look just to change the URL.
How do I go about implementing this the right way so the end-user can update their social media URLs to their Facebook/Twitter/YouTube/Etc easily..?
What do you mean by saying "user changed their Facebook URL"?
You talking about customer or administrator?
If you mean administrator, then the you can create custom settings for social media links
For customers store theirs social uids
In order to do this, you will need to create an extension, albeit not a very complicated one. If you've never done this before, Alan storm wrote an excellent tutorial.
One file that is often included in extensions (but seems not to be mentioned in the above mentioned tutorial) is etc/system.xml. This file lets you define a new page in the System->Configuration section of the Magento admin panel. Magento provides a good tutorial on writing those.
Any fields you put in etc/system.xml will be modifiable in the Magento admin panel, and you can access them anywhere in your code with Mage::getStoreConfig('your extension's name/the name of the field'), e.g., Mage::getStoreConfig('facebook/enabled');
I would like to create some pages related to a member account in umbraco 4.
In asp.net webforms, an account folder is created and in it are the account related pages, such as Login.aspx, ForgotPassword.aspx, etc...
Now, these pages are not actual content pages, but are more of the adminitrative type.
I've created user controls for the login, register, etc.
Should I create a document type in umbraco for each page type, and put the respective user control in each template ? what is the recommended way to do this in umbraco ?
On the content manager, just right click on the page or node you want to protect, right click on and select "Public Access".
In there you can apply permissions to individual users and/or roled based. The Roled based one will require for you to have "Member Groups".
That is it. All the security is kept on the "\App_Data\access.config" file; you can review it for more details on how they are achieving this.
hth,
-covo
I want to create a custom Joomla registration form and a profile to show the information saved. For this I followed the answer on this thread. I have cloned and changed the files of the user profile plugin. Now the problem is that the edited profile form is not displayed after I have enabled the plugin. I have a login link on my site, which on success redirects to a profile display page after that. When I click edit on the profile display page, the edit profile form is still the same old one and it is located at profile?layout=edit. All it has is:
Name
Username
Password
Confirm Password
Email
Confirm Email
Basic Settings
Why is this not working. The installation was also fine.
Is this even the right way of doing this.
Please help with this. I appreciate all the help. Thanks!
See original Joomla docs on how to add a profile plugin in Joomla 1.6
http://docs.joomla.org/Creating_a_profile_plugin
I ended up going with Community Builder. It has amazing search features.