|
|
 Rank: Fanatic
Joined: 3/19/2008 Posts: 219 Location: London, UK
|
Hello all, I have an actionhandler which fires on document publish. I get the action and the document passed to me as objects..... Code: Boolean IActionHandler.Execute(Document doc, IAction action) Is there any way to get hold of the user who is performing the action? At the moment I do the following: Code:foreach (DocumentVersionList dl in doc.GetVersions()) { to = dl.User.Email; } which gives me the latest user to modify the document. It seems like a hack somehow!
Darren Ferguson - Umbraco level 2 certified www.darren-ferguson.com - www.fergusonmoriyama.com
|
|
 Rank: Addict
Joined: 9/27/2007 Posts: 977 Location: Belgium
|
Hi Darren, Just had a quick look at the source and the apiDocs, and could find some interesting stuff in umbraco.BasePages.BasePage class. Found some functions and methods that deal with the user being currently logged in. Hope that helps. Regards, /Dirk
level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
|
|
Rank: Enthusiast
Joined: 8/13/2007 Posts: 36 Location: Sydney, Australia
|
you can use:
UmbracoEnsuredPage bp = new UmbracoEnsuredPage(); User u = bp.getUser();
enjoy!
|
|
Rank: Enthusiast
Joined: 8/13/2007 Posts: 36 Location: Sydney, Australia
|
Also... if you are going to iterate through the business logic object in Umbraco, it make a TON of requests to the database (use SQL Server Profiler and you'll see). If you want to iterate over the content nodes, best to use XSLT and using the umbraco.library.GetXmlNodeByXPath method
|
|
 Rank: Fanatic
Joined: 3/19/2008 Posts: 219 Location: London, UK
|
Thanks, using the ensured page works well. Shandem wrote:Also... if you are going to iterate through the business logic object in Umbraco, it make a TON of requests to the database (use SQL Server Profiler and you'll see). If you want to iterate over the content nodes, best to use XSLT and using the umbraco.library.GetXmlNodeByXPath method Nope, my intention was never to do that :) As I said, I knew what I was doing was a hack.....
Darren Ferguson - Umbraco level 2 certified www.darren-ferguson.com - www.fergusonmoriyama.com
|
|
|
Guest |