Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

17478 Posts in 4473 Topics by 1972 members

Archive

SilverStripe Forums » Archive » A question about DataObjectDecorators

Our old forums are still available as a read-only archive.

Page: 1
Go to End
Author Topic: A question about DataObjectDecorators 1117 Views
  • Markus
    avatar
    Google Summer of Code Hacker
    152 posts

    A question about DataObjectDecorators Link to this post

    For OpenID support I implemented a DataObjectDecorator, but I couldn't figure out how I can add a custom validator to it.

    I need to ensure that the entered OpenID is unique so that only one user account is linked to a specific OpenID. Is that somehow possible?

    The only way I know about is to use the augmentDatabase() method to add an unique-index to the database (adding it to extraDBFields() 'indexes' doesn't work) but in that way I can't output an error-message.

    Does someone know how this can be solved?

    Thanks a lot,
    Markus

  • Sam
    avatar
    Administrator
    649 posts

    Re: A question about DataObjectDecorators Link to this post

    Arg, this is a bug. I forgot to includes indexes on the list of You'll need to fix DataObjectDecorator::loadExtraDBFields()

    There's a list of the static variables that are updated; just add indexes to this list.

  • Markus
    avatar
    Google Summer of Code Hacker
    152 posts

    Re: A question about DataObjectDecorators Link to this post

    OK, I fixed it in r38854 (and added also defaults to it). But this doesn't help to solve my problem

    Now I can prevent that duplicate entries are created, but no error message will be shown since an database error occurs.. is there any way to implement a validator for DataObjectDecorators or handle such database errors ("Duplicate entry 'http://markus-lanthaler.myopenid.com/' for key 2")?

  • Markus
    avatar
    Google Summer of Code Hacker
    152 posts

    Re: A question about DataObjectDecorators Link to this post

    Are there any news on this? How can I implement a validator on a DataObjectDecorator??

  • Markus
    avatar
    Google Summer of Code Hacker
    152 posts

    Re: A question about DataObjectDecorators Link to this post

    OK, I fixed that in r40925 (also for the forum module: GSoC branch r40926).

    It's not the best (scalable) solution but it works for the moment and Hayden said that I should not change the core's validation behavior at the moment.

    1117 Views
Page: 1
Go to Top

Currently Online: sparkalow, davidm2010, Juanitou, Euphemismus, mattman, PatJnr

Welcome to our latest member: svenmagnus

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.