tags:

views:

208

answers:

1

I wrote a small app that relies heavily on a series of php pages in which mysql data is displayed and formatted, given the user's credentials.

Rather than rolling a whole user management system from scratch, im debating putting these files into modx pages and utilizing its usermanagement features to secure and restrict those pages and the data.

My question is 2 fold, first, how smart is this from a difficulty stand point? Ive done a test creating a snippet and everything shows up ok, but is there an easier way to do this?

Second, how can i take modx's session or login data and pass it to my app so it knows WHO is logged in.

Thanks

+1  A: 

I relatively new to modx so I'm not the best person to comment on how smart it is, although I personally have no problem with the methodology.

You can get details of the logged in user using the modx API.

eg

// In the front end, returns an array of the logged in user's attributes.
$userInfo = $modx->db->getRow(
    $modx->db->select(
        "*", 
        $modx->db->getFullTableName('web_user_attributes'), 
        "`internalKey`=".$modx->getLoginUserID()
    )
);
Fishcake