Copied to clipboard

Flag this post as spam?

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


  • syn-rg 282 posts 425 karma points
    Sep 08, 2011 @ 01:13
    syn-rg
    0

    Limiting the number of Members or Users in Umbraco Database

    I have two questions:

    1. Is there a way that I can limit the number of Users in the Umbraco backend?
    2. Is there a way that I can limit the number of Members in the Umbraco backend?

    Essentially, want I want is for the system to automatically disallow more Members or Users to be added once a certain number is reached in the database.

    Cheers,
    JV

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Sep 08, 2011 @ 09:03
    Dirk De Grave
    0

    If you really need this feature, you could subscribe to the BeforeNodeRender/AfterNodeRender event to remove the create user/member from the context menu in case the number of users/members has exceeded a certain number.

    References and sample code: http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events and http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events/overview-of-all-events and http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events/event-examples

    Cheers,

    /Dirk

  • syn-rg 282 posts 425 karma points
    Sep 09, 2011 @ 02:38
    syn-rg
    0

    Thanks Dirk,

    There's some really good ideas amongst those examples. But I'm looking for something automated.

    Where I can limit the number of Members who register to the website. i.e. 100, 300, 500, etc.

    The same for the Users as well, but this might not be as simple as the Member limitation.

    Does anyone have any ideas?

    Cheers,
    JV

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Sep 09, 2011 @ 09:08
    Dirk De Grave
    0

    So, what exactly is automated? If you remove the items from the context menu, isn't that automated enough? Anyway, maybe an even better solution (which will work in both back- end frontend for limiting) is to build your own membership provider for members/users (can inherit from the umbraco providers) and override the CreateUser() method, and do not create users/members if number has exceeded a predefined number.

     

    Cheers,

    /Dirk

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies