Discovered problems.
Multiple users will use same machine to access parent app and Usebb. If one user does not "logout" of Usebb the next user of parent app will auto login as previous user (client cookie not updated) and if a browser window was left open.
I changed the auto login from getting username from get variable to post variable.
So in parent app created a form to open usebb in new window:
/** begin: form to open discussion board in new window **/
echo ("<br clear=\"all\" />\n");
echo ("<form name=\"discussionbutton\" method=\"post\" action=\"UseBB/panel.php?act=login\" target=\"_blank\">\n");
echo ("<input type=\"hidden\" name=\"username\" value=\"". $login ."\" />\n");
echo ("<input type=\"submit\" value=\"Schedule Discussion\" />\n");
echo ("</form><br />\n");
echo ("<br clear=\"all\" />\n");
/** end: form to open discussion board in new window **/
so change the username check in panel_login.php
around line 195:
/** begin: check to make sure login opened from scheduler application using form button **/
$login = ( isset($_POST['username']) ) ? $_POST['username'] : null;
/** end: check to make sure login opened from scheduler application using form button **/
To fix the session problem:
(This is not the best fix but it resolves problem. User may have to click the parent app link twice if previous usebb user did not logout.)
in panel_login.php
around line 156:
} else {
# begin: session management to ensure that if previous of same machine user did not logout but just closed window and left a browser window open
$functions->setcookie($functions->get_config('session_name').'_sid', '');
# end: session management to ensure that if previous user of same machine did not logout but just closed window and left a browser window open
//
// Show the login form, if the user is not logged in
To make things easier for users I made the "logout" link immediate instead of requiring user confirmation:
in panel_logout.php
around line 55:
} else {
/** begin: make the logout link logout instead of requiring confirmation from user **/
# if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
if ( 1 == 1 ) {
# if ( !empty($_POST['logout']) ) {
if ( 1 == 1 ) {
/** end: make the logout link logout instead of requiring confirmation from user **/
This works for me now. Perhaps this might help other but remember/review this forum's sticky note about security and code modifications.