PostNuke: A Flexible Open Source Content Management System
home | forum | international support | contact us

Support Forum

Start ::  Developers Corner ::  Module Development ::  Users module APIs

Moderated by: Support Team

Bottom
Users module APIs

  • Link to this postingPosted: 22.04.2008, 21:58
    Profile Homepage
    bbirney
    rank:
    pnFreshman pnFreshman
    registered:
     April 2004
    Status:
    offline
    last visit:
    23.04.08
    Posts:
    27
    I guess I meant the Users API, not the module itself. Actually, the administrative interfaces for user management are much improved. But a number of my modules contain signup and account management interfaces, and they talked directly with the pn_users database to accomplish this (rather than using the native PostNuke 0.7x account management tools). Obviously this is not the preferred route! But there was no API support for user management in 0.7x.

    I had hoped that in 0.8 there would be an API for managing user data (e.g. Users_adminapi_create, Users_adminapi_update, Users_userapi_getall, etc.), but no such luck as far as I can tell. So for the modules that deal with user accounts, I'll have to figure out how Users manages data and duplicate that in a library so that my modules will be able to interact with PN 0.8's user database.

    It now occurs to me that this part of the discussion isn't related to the Sites Showcase forum. I hope the Powers That Be will forgive this divergence.



    edited by: bbirney, Apr 22, 2008 - 05:00 PM

    -----
    --
    Ben Birney
    http://www.tilsontech.com/
    http://www.sophiasfall.com/
  • Link to this postingPosted: 22.04.2008, 22:15
    Profile Homepage
    markwest
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    24.04.08
    Posts:
    7647
    Most of the API functions you need should be there - check the documentation. A few aren't quite named the same but all the basics seem to be there.

    -Mark
  • Link to this postingPosted: 22.04.2008, 22:27
    Profile Homepage
    bbirney
    rank:
    pnFreshman pnFreshman
    registered:
     April 2004
    Status:
    offline
    last visit:
    23.04.08
    Posts:
    27
    You're right, Mark, the userapi are there, my mistake. I haven't yet been able to discover the critical adminapi functions, though, that would let me create and edit users, which are the most important functionality I'd need to rebuild my module library to be 0.8 compatible.

    Just as an example, users_adminapi_saveuser() might initially appear to be an analog of users_adminapi_create() - but on closer inspection, it appears to be expecting form input, and performs additional operations other than simply checking and saving the data. As an active module developer, what I really need is your basic "add/edit/delete" functionality, without all the additional action. I realize that all this is needed for the core PN 0.8 users system, but it still seems like something is missing from Users - the low-level abstraction layer that would just provide an interface into the database and let the calling module worry about the rest of the operational details.

    I'm not saying it's not a step forward from 0.7x - it certainly is. Previously my user-related modules had to write directly into pn_users! It just doesn't seem to have gotten quite to the level of flexibility that's needed for a true application framework.

    Perhaps I'm missing something. Is DBUtil::updateObject() that magical low-level abstraction I'm looking for?

    -----
    --
    Ben Birney
    http://www.tilsontech.com/
    http://www.sophiasfall.com/
  • Link to this postingPosted: 22.04.2008, 22:56
    Profile Homepage
    markwest
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    24.04.08
    Posts:
    7647
    From a quick look it looks as though create is finishnewuser and update is saveuser. The update function looks ok to me - theres only sanity checks here. The create API does a little more than i'd like - such as e-mailing the user password. Splitting the actual create user code into another API probably makes sense here.

    In terms of DBUtil - updateObject will update a DB record and insertObject will create one.

    -Mark

Start ::  Developers Corner ::  Module Development ::  Users module APIs

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to PostNuke