Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Scott Rozman 2 posts 22 karma points
    Sep 09, 2009 @ 22:42
    Scott Rozman
    0

    changing default user type v4

    I've set up Umbraco to use our School's Active Directory. It seems to work OK, but I can see a problem if everyone in the directory can log in and they are assigned a default role of "Writer".

    My thought was to set up a user type of "No Permissions" and let that be the default type.

    I can't find where to change the default type, other than a workaround by making "No Permissions" the record in the db with id=2.

    Any suggestions on where to change this? Or any way to limit the users to those in a group of the AD?

    I used the directions here

    http://our.umbraco.org/wiki/how-tos/membership-providers/active-directory-membership-provider

    and found them very helpful, but somewhat hard to find. Hopefully having another link to it will help someone else find it faster!

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Sep 11, 2009 @ 06:13
    Richard Soeteman
    0

    Maybe you can use an Event that set the usertype when the user is Created. Here you'll find a page with all events. Here you can find some basic info how to wire up events and what references you should have.

    Below you find an Example how to set the default Usertype.

    using

     

    System;

    using

     

    System.Collections.Generic;

    using

     

    System.Text;

    using

     

    umbraco.BusinessLogic;

    namespace

     

    UserTest

    {

     

    public class CreateUserHandler :ApplicationBase

    {

     

    public CreateUserHandler()

    {

     

    User.New += new User.NewEventHandler(User_New);

    }

     

    void User_New(User sender, EventArgs e)

    {

     

    //Get the usertype by Id you could also iterate over UserType.getAll

     

    UserType type = UserType.GetUserType(4); //Translator

     

    //Assign the type

    sender.UserType = type;

     

    //Save the user

    sender.Save();

    }

    }

    }

    Hope this helps you,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft