ActionHandlers? Options
rtk
Posted: Tuesday, October 23, 2007 2:28:12 PM

Rank: Devotee

Joined: 7/24/2006
Posts: 59
Hi, I'm about to make a ActionHandler that will create a new Member Group when a document with a node with a DocType of "Event" are created.

In the actionHandler I did this:


Code:

public bool Execute(umbraco.cms.businesslogic.web.Document docObj, umbraco.interfaces.IAction action)
{
    if (docObj.ContentType.Alias == "Event")
    {
        int newId = docObj.Id;
        User u = new User(0);

        Node n = new Node(newId);

        MemberGroup.MakeNew("(" + newId + ")" + n.Name + "*", u);

        return true;
    }
    return false;
}


The problem is that the MemberGroup name are "(1234)*" which meens it finds the ID of the node, but not nodeName.

What are the work arround this one?
rtk
Posted: Tuesday, October 23, 2007 2:50:21 PM

Rank: Devotee

Joined: 7/24/2006
Posts: 59
One more thing - how can I get current user that are logged into Umbraco instead of taking the lazy way using User(0) ?
Gerben
Posted: Wednesday, October 24, 2007 6:14:26 PM
Rank: Newbie

Joined: 10/24/2007
Posts: 8
If I understand what you need, you can get the Document name by use this property:

docObj.Text;
rtk
Posted: Wednesday, October 24, 2007 9:48:14 PM

Rank: Devotee

Joined: 7/24/2006
Posts: 59
Yes it solved the problem. But how about getting the logged on Umbraco User, instead of using the built-in administrator.

// RTK
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.