Handle a user forum login

  1. <?php
  2. # Handle a user forum login
  3.  
  4. if (!defined('PHORUM')) return;
  5.  
  6. require_once("./include/api/base.php");
  7. require_once("./include/api/user.php");
  8.  
  9. // Check the username and password.
  10.     PHORUM_FORUM_SESSION,     // for a standard front end forum session
  11.     "username",               // the username to check
  12.     "password"                // the password to check
  13. );
  14. if (!$user_iddie("Username or password incorrect!\n");
  15.  
  16. // Make the authenticated user the active user for Phorum. This is all
  17. // that is needed to tell Phorum that this user is logged in.
  18.     PHORUM_FORUM_SESSION,     // for a standard front end forum session
  19.     $user_id,                 // the user_id that has to be the active user
  20.     PHORUM_FLAG_SESSION_ST    // jumpstart the short term session
  21. );
  22. if (!$set_activedie("Setting user_id $user_id as the active user failed!\n");
  23.  
  24. // Create a session for the active user, so the user will be remembered
  25. // on subsequent requests.
  26.     PHORUM_FORUM_SESSION,     // for a standard front end forum session
  27.     PHORUM_SESSID_RESET_LOGIN // reset session ids for which that is
  28. );                            // appropriate at login time
  29.  
  30. ?>

Documentation generated on Fri, 24 Aug 2012 01:45:40 -0500 by phpDocumentor 1.4.3