Copied to clipboard

Flag this post as spam?

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


  • Jonathan Roberts 409 posts 1063 karma points
    Oct 19, 2017 @ 08:18
    Jonathan Roberts
    0

    How to delete a CMS user in 7.7.2

    Hi, If you send out an invite to a user to join the site CMS, they then loose their email - they cant login and their status is flagged as Invited. There is no way to resend an invite.

    Is there a simple way to set their account to Active? The only way I found is to Disable the Account then Enable their account - the status goes to Active and then they can login.

    At first I thought the only way I could get them access is to Delete their account and then add them back in but there isn't a visible way to Delete a User.

    Am I missing something?

    Thanks

    Jon

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Oct 19, 2017 @ 08:31
    Dan Diplo
    0

    Umbraco won't let you fully delete users since this would affect things like the Audit Trail and previous versions. There's basically a lot of stuff foreign-keyed back to the users table. So if you deleted the user, all the related data would also have to be deleted, which would be a problem (imagine all the content created by that user suddenly disappearing!).

    Having said that, for a newly created user who hasn't actually logged in (let alone managed any content) then you could probably just delete them directly from the umbracoUser table in the database. Not ideal, but it usually works (and SQL will scream at you if they can't be deleted because of constraints).

  • Nik 1614 posts 7260 karma points MVP 7x c-trib
    Oct 19, 2017 @ 09:03
    Nik
    0

    I think this probably raises another question, how can you re-invite a user or cancel an invitation. I've not used the invite approach yet (no requirement to so far) but it is an interesting question.

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Oct 19, 2017 @ 09:08
    Dan Diplo
    1

    I'd recommend raising an issues like this on the Umbraco issue tracker - http://issues.umbraco.org/dashboard I imagine there are probably a lot of real-life scenarios that haven't been accounted for.

  • kevainc 5 posts 97 karma points
    Oct 19, 2017 @ 12:06
    kevainc
    0

    Umbraco already has the following functionality in his UserService

    /// <summary>Deletes or disables a User</summary>
    /// <param name="user"><see cref="T:Umbraco.Core.Models.Membership.IUser" /> to delete</param>
    /// <param name="deletePermanently"><c>True</c> to permanently delete the user, <c>False</c> to disable the user</param>
    void Delete(IUser user, bool deletePermanently);
    

    So it should be possible.

  • Marcio Goularte 388 posts 1360 karma points
    Oct 19, 2017 @ 22:27
    Marcio Goularte
    1

    Kevain,

    It is not possible anymore. In umbraco.business.logic.User (depreciated) the description itself already describes why it is no longer possible.

    https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/umbraco.businesslogic/User.cs#L541

    "Deleting users are NOT supported as history needs to be kept. Please use the disable() method instead"
    

    This method is no longer used in backoffice. This UserService method was invoked only in this deprecated code. Only if you use the API UserService. But anyway I believe it will not work

Please Sign in or register to post replies

Write your reply to:

Draft