Following the discussion of these 2 threads: http://groups.google.com/group/cake-php/browse_frm/thread/6440d2b1f7a29534/b0d25b27475b6bdc?lnk=gst&q=SMf#b0d25b27475b6bdc
http://groups.google.com/group/cake-php/browse_frm/thread/55d0edff83e39775/2040fbf427a3996c?lnk=gst&q=SMf#2040fbf427a3996c I came out with the following: 1. put the SMF forum in app/webroot/forums/ 2. Set CAKE_SESSION_COOKIE to be the default 'PHPSESSID'. 3. Modify the session handling functions in Cake to use the MySQL table used by SMF (forumprefix_sessions) 4. in my app/bootstrap.php I added this line at the end ------------------------------------------------ require_Once('forum/SSI.php'); ------------------------------------------------ # NOW WE NEED TO TELL CAKE TO USE SMF session table (here I'll assume that your SMF DB tables prefix is *smf_* # THE SMF sessin table doen't have an id column, but rather a *session_id* one 5. rename cake/libs/session.php in *session_cake.php* 6. rename the class in your new *session_cake.php* into ------------------------------------------------ class CakeOriginalSession extends Object { ------------------------------------------------ 7. create a file in cake/libs/ called *session_cake.php* [this extends the original Cake Session lib. go in the bin and copy and past what you will find in here: http://bin.cakephp.org/view/1933866502 into the newly created file. 8. create a file in cake/libs/ called *session.php* with the following in it. ------------------------------------------------ <?php require_once('session_smf.php'); class CakeSession extends SmfSession { } ------------------------------------------------ 9. somewhere in you template write the following ------------------------------------------------ <?php echo ssi_welcome()?> ------------------------------------------------ 10. you can you retrieve the SMF session data then? try this: ------------------------------------------------ $user = (unserialize($this->Session- >read('THE_LOGIN_COOKIE_NAME_YOU_SET_IN_SMF_CONFIG'))); echo $user[0]; ------------------------------------------------ This will give you the id of the currently logged in user in SMF. ################# # EXPLANATION # ################# Why all this files? Well in this way if you update *cake/* dir you want override you extension. What's missing yet? An helper or component that behaves as a wrapper for the functions in SSI.php Dan PS: a different approach is presented here: http://bakery.cakephp.org/articles/view/cakephp-smf --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---