Menu

Add Attributes to class User

DaveHeart
2024-12-10
2024-12-10
  • DaveHeart

    DaveHeart - 2024-12-10

    Hello,
    I would like to add custom attributes to the class User. Because it is not defined in XML, I can't use the XML definition to modify it. Is there another way to do it without modifying the iTop code?

    Thanks!

     
  • Molkobain

    Molkobain - 2024-12-10

    Hello Dave,

    Standard User classes are in PHP on purpose so they can't be customized.

    You could always crete your own class extending UserLocal or else, and do it in XML, but you would have to migrate all your existing users. Also it might not work with some extensions, so I don't really recommend it.

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2024-12-10

    What kind of attributes do you want to add?

    Depending on your use case - maybe you just want to create another class instead with an AttributeExternalKey pointing to the user?

     
  • DaveHeart

    DaveHeart - 2024-12-10

    Hello Molkobain,
    that's sad. Then I have to find another solution.

    Thank you very much for your fast reply!

     
  • DaveHeart

    DaveHeart - 2024-12-10

    Hello Jeffrey,
    I wanted to add a last_login attribute and a stopwatch related to it. I want to send email notification when a user didn't log in since X days.

    I know of the configuration 'log_usage'. But it doesn't help me to send email notifications.

    As you wrote, I'm thinking of creating an extra class which is pointing to the user.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.