protected function topnav() { $words = $this->getWords(); $logged_in = APP_User::IsBWLoggedIn("NeedMore,Pending"); if (class_exists('MOD_online')) { $who_is_online_count = MOD_online::get()->howManyMembersOnline(); } else { // echo 'MOD_online not active'; if (isset($_SESSION['WhoIsOnlineCount'])) { $who_is_online_count = $_SESSION['WhoIsOnlineCount']; // MOD_whoisonline::get()->whoIsOnlineCount(); } else { $who_is_online_count = 0; } } require TEMPLATE_DIR . 'shared/roxpage/topnav.php'; }
public function render($small = false) { $layoutkit = $this->layoutkit; $words = $this->words; $ww = $this->ww; $formkit = $layoutkit->formkit; $callback_tag = $formkit->setPostCallback('LoginController', 'loginCallback'); $mem_recovery_tag = $formkit->setMemForRecovery(); $mem_redirect = $formkit->mem_from_redirect; $err = is_object($mem_redirect) ? $mem_redirect->errmsg : ''; $baseuri = PVars::getObj('env')->baseuri; if (PVars::getObj('env')->force_ssl_sensitive) { $baseuri = PVars::getObj('env')->baseuri_https; } $url = $baseuri . htmlspecialchars(implode('/', PRequest::get()->request), ENT_QUOTES); $memoryExpiry = PVars::getObj('env')->rememberme_expiry; if (!empty($_SERVER['QUERY_STRING'])) { $url .= '?' . $_SERVER['QUERY_STRING']; } $logged_in = APP_User::IsBWLoggedIn("NeedMore,Pending"); if ($logged_in) { // already logged in // why show this form? if ($small != true) { ?> <div> <p><?php echo $ww->LoginformAlreadyLogged($_SESSION['Username']); ?> </p> <p><a href="user/logout"><?php echo $ww->Logout; ?> </a></p> </div> <?php } else { ?> <span id="logout"><a href="user/logout" ><?php echo $words->get('Logout'); ?> </a></span> <?php } // for translators, we want links for all the translations, // because otherwise they will never see the login form words. // we make this happen with a little trick :) ob_start(); $ww = $this->wwsilent; } // Adds for subdomain to forward login (not definitive, under discussions), jy 5/7/2009 $ItIsNotASubDomain = true; $url_login = $url; // Test if it is a knowm subdomain, and if so change prepare forwarding to a login widget on www if (strrpos($url_login, 'fr.') !== false or strrpos($url_login, 'de.') !== false) { $ItIsNotASubDomain = false; $url_login = "******"; } // end of adds for subdomains ?> <?php if ($small == true) { ?> <div class="login-widget-small" > <form id="main-login-form" method="post" action="<?php echo $url_login; ?> "> <?php echo $callback_tag; ?> <?php echo $mem_recovery_tag; ?> <?php if ($ItIsNotASubDomain) { // Added because this is hidden for subdomain ?> <table> <tr> <td> <label for="login-u"><?php echo $ww->Username; ?> </label><br /> <input type="text" id="login-u" name="u" /> </td> <td> <label for="login-p"><?php echo $ww->Password; ?> </label><br /> <input type="password" id="login-p" name="p" /> </td> <td title="<?php echo $ww->StayLoggedIn_SecurityHint($memoryExpiry); ?> "> <input type="checkbox" id="login-r" name="r" /><label for="login-r"><?php echo $ww->StayLoggedIn; ?> </label> </td> <td> <br /><input type="submit" value="<?php echo $ww->IndexPageLoginSubmit; ?> " id="smallbutton" class="button"/> </td> </tr> </table> <?php } // Added because this is hidden for subdomain ?> </form> <script type="text/javascript"> document.getElementById("login-u").focus(); </script> </div> <?php } else { ?> <div class="info" id="login-widget"> <h3><?php echo $ww->Login; ?> </h3> <?php if ($err) { ?> <p class="note warning"><?php echo $err; ?> </p> <?php } ?> <script type="text/javascript"> if(!navigator.cookieEnabled) document.write("<p class=\"note warning\">Please enable cookies in your browser.</p>"); </script> <form method="post" action="<?php echo $url_login; ?> "> <?php echo $callback_tag; ?> <?php echo $mem_recovery_tag; ?> <?php if ($ItIsNotASubDomain) { // Added because this is hidden for subdomain ?> <table> <tr> <td align="right" class="login_widget"> <label for="login-u"><?php echo $ww->Username; ?> </label> </td> <td> <input type="text" id="login-u" name="u" /> </td> </tr> <tr> <td align="right"> <label for="login-p"><?php echo $ww->Password; ?> </label> </td> <td> <input type="password" id="login-p" name="p" /> </td> </tr> <tr> <td></td> <td title="<?php echo $ww->StayLoggedIn_SecurityHint($memoryExpiry); ?> "> <input type="checkbox" id="login-r" name="r" /> <label for="login-r"><?php echo $ww->StayLoggedIn; ?> </label> </td> </tr> <tr><td> </td><td> <?php } // Added because this is hidden for subdomain ?> <input type="submit" value="<?php echo $ww->IndexPageLoginSubmit; ?> " class="button"/> </td></tr></table> <br /> <p><?php echo $ww->LoginformForgetPassword('<a href="resetpassword/">', '</a>'); ?> <br /><br /></p> <h3><?php echo $ww->SignupNow; ?> </h3> <p><?php echo $ww->IndexPageWord17('<a class="button" href="signup">', '</a>'); ?> </p> </form> <script type="text/javascript">document.getElementById("login-u").focus();</script> </div> <?php } ?> <?php if ($logged_in) { ob_end_clean(); echo $words->flushBuffer(); } }
protected function statusMessage() { $words = new MOD_words(); // messages about the member's status preceed the info messages $logged_in = APP_User::IsBWLoggedIn("NeedMore,Pending"); if ($logged_in && $_SESSION['Status'] != 'Active') { echo '<p class="status note big">' . $words->get('StatusMessage_' . $_SESSION['Status']) . '</p>'; } // infoMessage should be used by other Pages to show post-form-messages and other status-messages to the member $class = isset($this->infoMessageClass) && $this->infoMessageClass != '' ? $this->infoMessageClass : ''; if (isset($this->infoMessage) && $this->infoMessage != '') { echo '<p class="note big ' . $class . '">' . $this->infoMessage . '</p>'; } }