Dynamic landing page in Alfresco Share - authentication

I'm trying to figure out how to implement a mechanism that decides dynamically what's the landing page for a user.
I know that the default landing page is relatively easy to customize, as you can see in the following link:
http://blogs.alfresco.com/wp/ddraper/2011/11/01/advanced-share-customization-part-1/
http://zscribble.wordpress.com/2012/02/13/how-to-change-user-landing-page-in-alfresco-share/
But it is not enough because I need go a little further; after the successful authentication of any user, I need to retrieve the site/s that a user belongs to and then redirect to the dashboard of any of the sites.
I guess there is any authentication service that redirects to TOMCAT/webapps/share/site-index.jsp, and from here to either the user dashboard or a site dashboard, depending on the parameters received. If I'm right with my assumption, I understand I just should customize such supposed authentication service in order to get the user's sites and then redirect to the appropriate site dashboard's URL.
Am I in the right way? If not, any idea on how to proceed?
Thanks.

There are two possible approach in order to implement a mechanism which dynamically redirects to a page after a successful authentication in Alfresco Share.
The easiest way consists in the next steps:
Change the default landing page by updating the value of the tag <root-page> in the file alfresco\site-data\configurations\slingshot.site.configuration.xml (the default value is site-index).
Create a custom Surf page according to the value defined before.
Create a custom template-instance
Create a custom FreeMarker template, exclusively containing a region that loads a webscript (will be created in the next step).
Implement a webscript that decides whatever a URL to redirect to (in my case I have to retrieve the user's sites via RESTful API and then redirect to a site's dashboard)
Perform the redirection similarly to the accept-invite component is doing
The other possible way is to override the classes PageView and PageViewResolver, this way you can perform the redirection to the landing page in a single step rather than two steps, what is more efficient as a consequence. I didn't developed this solution so I cannot give more details but according to what an Alfresco Engineer says, it is viable to achieve.
If you want to know more about this, read this thread.

Related

Page & Action wise Authorization Asp.Net Core Razor Pages

I have a requirement to configure the user's authorization per module per screen per action. For example, one user should be able to Create/Save WorkOrders in WorkOrder Module, but another user should only able to View/Delete WorkOrders. Similarly, a third user should only be able to View WorkOrders. This is an example of one screen. Now there are many screens in the application. Let's keep the actions same for all i.e. View, New, Update, Delete.
There is a reports module also, in which the user will create reports on the fly and add it into the application. So authorization is required here too. For example, a user can View/Print WorkOrder reports. But another user can only view reports. Let's keep the actions in reports only View & Print.
I am not sure Asp.Net Core built-in authorization is capable of this or not. What I have looked so far, it is not possible. Please correct me if I am wrong.
Now question is, how should I do this? I had a similar kind of requirement in a previously built application where I used database tables to store rights against each user and each screen. And upon log-in, I used to fetch that data, and then while loading the web page; I used to show or hide the relevant buttons & menus based on user's rights. But here in Asp.Net Razor Pages, the action method matters (If I'm not wrong), and certain functionality can be accessed via route. I am looking for some attribute-based solution.
I found this link with more or less above mentioned implementation using database tables and route URL to determine action name. So the URLs are saved in the database and on runtime they are checked and matched with the current URL and the user is authenticated.
Another link here, where the developer has used attribute-based filtering on action methods. But URL Routes are not being saved in the database or anywhere.
Are these the only & best solution to my problem? I have no problem implementing them, they look logical. But I just want to use the best available approach. Can anyone assist me with any other more suitable approach?

Is there a way to save search filters between sessions per user account on Shopify?

So (for example) if a user selects their gender and pant size while searching on Shopify store, could those selections be saved and be in place when they visit again?
I'm open to switching to a new Shopify search app that would support this feature.
There a few approaches that you can achieve this.
Using cookies
You can save their choices as cookies and refer to them once they search modifying the search URL before redirecting or appending hidden files in the form so that they submit them as well.
Creating a custom app
You can create a custom app with only one purpose to save the information to the customer metafields or tags.
Once you have this information you will be able to use the same logic as the cookie one but instead of relying on a cookie you will have access to the metafields directly.
App
I don't think that there is an App that meets these criteria, but you can look it up. Yet it may be possible to hack up the Apps in a such way that you may be able to pass this information.

Rally : document.referrer is not returning complete URL

We have created a custom App using Rally SDK. We are providing link to this app in a custom field in USER story. Once we click on this link, it gets redirected to the App. Within this app, we want know from which User story it has redirected from.
For the same purpose we are making use of document.referrer. However, it only returns 'https://rally1.rallydev.com' and not the complete URL.
Based on our research, we come to know that meta tag for refferer with appropriate value has to be mentioned in the web page to get the complete URL. Which we think is not mentioned in this case.
Please correct if our understanding is wrong.
It will be very helpful if you could suggest any alternatives to achieve this.

Show different custom login screens for different sets of Pentaho solutions

I have two sets of solutions targeted at different users (say: finance and operations). They're composed basically of CDE dashboards.
I wish to present a different Pentaho login screen for each of the solutions, to kind of show they're different "applications", or a different set of dashboards.
Can I have two customized login screens that can be invoked or switched according to a parameter? Like, say, sending &theme=newapp in the URL? Has anyone done it?
I have customized the login screen and have done themes in Pentaho, so I know the basics.
I'm using Pentaho 5.2 CE
Thanks!
You will need to change the login redirect filter. Everytime you hit a Pentaho URL and don't have a valid session you're sent to the Pentaho/Login page.
So you have two options: change the redirect class so that it redirects to different login pages depending on the URL or have the referral URL parsed by the login page and display different content depending on where the user came from.
Neither of these options is easy, though.

Track last view with C# ASP.NET MVC

I don't have any code to show, because I'm not sure how to approach this. I am sending a user from one view to another where we will be doing CRUD OPERATIONS, I need to have a way of knowing what the last view I came to before the CRUD OPERATION so that I can send my user back to that view. I would also like to use this for redirection once someone has logged in. I want to have a way of setting the view I want them to get sent back to so that they can log in from any page on the site and it will remember that page instead of just dropping you on the home page.
I would accept a good tutorial as well, I'm pretty desperate to figure this out. SHoudl I just use ViewBag?
If you making <a></a> Through Html Helper then you globally set the querystring in function that can be later used for know the last view user visit.
As Balachandra mention you can use ReturnUrl inside the Request object.
Some other idea which can help you are
Request.Server["HTTP_REFERER"]
Request.UrlReferrer
A another simple algorithm to solve this issue is making JavaScript cookie to know what is current url. and last url. it's only take 2 url to remember in cookie.
When you want to know last referrer then you can easily look in user cookie to know the referrer.
If you want to know the url refeffer in inside Action then make a ActionFilter and just call this code
HttpContext.Current.Request.UrlReferrer.ToString()
In ASP.NET MVC we have TempData which used to pass Data from Views to Views. From this post http://www.rachelappel.com/when-to-use-viewbag-viewdata-or-tempdata-in-asp.net-mvc-3-applications You can get better explanation.
This are enough Tricks to pass the data from Views to Views. For Example TempData will help you to store current url and you can get same information on next view. Remember that TempData is based on Session so it doesn't store the information for long time. For me TempData look perfect solution that you need to use for your own solution.
If you enable asp.net mvc authentication and try to browse any page in application, it will redirect user to login page with 'ReturnUrl' querystring parameter. This parameter holds the name of previous page from where user redirected from.
You can use similar approach even after login as well.