Copied to clipboard

Flag this post as spam?

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


  • Amir Malik 6 posts 76 karma points
    Oct 17, 2016 @ 03:41
    Amir Malik
    0

    How to add property in [Backend] user?

    Hello,

    I am new with Umbraco I want to add new property in Admin Panel > User

    in user we can see all of user properties e.g Name, Username, Email etc. I want add new property, let say the property is Country.

    anyone can help me to do this?

    Thank You

  • Steve Morgan 1348 posts 4457 karma points c-trib
    Oct 17, 2016 @ 09:11
    Steve Morgan
    0

    Hi Amir,

    Can I just check - are you using these "users" to login to a front end website - if so you should be looking at "members".

    For backend users (editors etc) I'm not sure you can add custom properties. I might be wrong?

    Steve

  • Amir Malik 6 posts 76 karma points
    Oct 17, 2016 @ 09:31
    Amir Malik
    0

    Hello Steve

    Can I log in to Backend Panel as a member not as a user / admin?

  • Steve Morgan 1348 posts 4457 karma points c-trib
    Oct 17, 2016 @ 12:31
    Steve Morgan
    0

    Hi Amir,

    No - at least not anyway that I'm aware of.

    Steve

  • Marcio Goularte 388 posts 1360 karma points
    Oct 17, 2016 @ 19:18
    Marcio Goularte
    0

    Properties for the User type only customizes Umbraco backoffice. recently I had to do it in a project. We create a custom table with the properties we want. This table has relationship with Umbraco users table. And edit user page source code.

    code path that needs to change: /Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs

    I have an example, but it's all in Portuguese. I will search and post here.

  • Steve Morgan 1348 posts 4457 karma points c-trib
    Oct 17, 2016 @ 19:22
    Steve Morgan
    0

    This would make upgrades more difficult of course!

  • Marcio Goularte 388 posts 1360 karma points
    Oct 17, 2016 @ 19:49
    Marcio Goularte
    0

    Certainly. But depending on need is an alternative. My project do not want to upgrade at this time. And the documentation made it clear that any update should consider this customization. Another alternative would be to create a custom section. But it would take a long time to create.

  • Marcio Goularte 388 posts 1360 karma points
    Oct 17, 2016 @ 21:42
    Marcio Goularte
    0

    I found the code.

    Published here: https://gist.github.com/marciogoularte/96104cdaea5760ad80c9a3155e959f08

    Added type fields Phone and Department. Umbraco versão 7.3.3

    Replace EditUser.aspx.cs in /Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs

    I created tables with Peta Poco and modify the code to save additional properties. With that I think you can already do what you need.

  • Amir Malik 6 posts 76 karma points
    Oct 18, 2016 @ 03:42
    Amir Malik
    0

    Hello Marcio

    I cannot find EditUser.aspx.cs in my project (umbraco 7.5.3). where can I find the file?

  • Marcio Goularte 388 posts 1360 karma points
    Oct 18, 2016 @ 15:10
    Marcio Goularte
    0

    This code is only available if you downloaded the code source of Umbraco.

    If you do not have the source code. Create a class within your namespace, MyNamespace.EditUser. You can create a Class Library project or create a C # file in the App_Code.

    Search on the Web project the aspx /Umbraco/Users/EditUser.aspx

    Replace the directive Page that looks like this: <%@ Page Language="c#" Codebehind="EditUser.aspx.cs" MasterPageFile="../masterpages/umbracoPage.Master" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Umbraco.Users.EditUser" %>

    Replace the example below, and put Inherits = MyNamespace.EditUser.

    <%@ Page Language="c#" MasterPageFile="../masterpages/umbracoPage.Master" AutoEventWireup="True" Inherits="MyNamespace.EditUser" %>

  • Marcio Goularte 388 posts 1360 karma points
    Oct 26, 2016 @ 15:19
    Marcio Goularte
    0

    Amir, It worked?

Please Sign in or register to post replies

Write your reply to:

Draft