define('LS_PARSE_REQUEST', $realrequest); // We need the template folder, title, author and lang as template variable $LS_CMSLANG = LS_LANG; $LS_CONTACT_FORM = LS_CONTACTFORM; $LS_REGISTER_FORM = LS_REGISTER; define('LS_PAGINATE_ADMIN', 1); // First check if the user is logged in if (LS_USERID_RHINO) { define('LS_OPERATORACCESS', true); // Get the name from the user for the welcome message $LS_WELCOME_NAME = $lsuser->getVar("name"); } else { define('LS_OPERATORACCESS', false); } // Now get the forgot password link into the right shape $P_FORGOT_PASS_ADMIN = LS_rewrite::lsParseurl($tl['login']['l12'], '', '', '', ''); // Delete the conversation if whish so if (isset($_POST['delete_conv'])) { // check to see if conversation is to be stored $result = $lsdb->query('SELECT convid, name, email, contact FROM ' . DB_PREFIX . 'jrc_sessions WHERE convid = "' . $_POST['id'] . '"'); $row = $result->fetch_assoc(); $lsdb->query('UPDATE ' . DB_PREFIX . 'jrc_sessions SET status = 0, ended = "' . time() . '", hide = 1 WHERE convid = "' . $row['convid'] . '"'); $lsdb->query('INSERT INTO ' . DB_PREFIX . 'jrc_transcript SET name = "' . $lsuser->getVar("name") . '", message = "' . smartsql($tl['general']['g63']) . '", user = "******"username") . '", convid = "' . $row['convid'] . '", time = NOW(), class = "notice"'); } $checkp = 0;
initiated = "' . time() . '", status = 1, contact = ' . $contactme); if ($result) { $cid = $lsdb->ls_last_id(); $_SESSION['jrc_convid'] = $cid; $lsdb->query('UPDATE ' . DB_PREFIX . 'jrc_sessions SET convid = "' . $cid . '" WHERE userid = "' . smartsql($_SESSION['jrc_userid']) . '"'); $lsdb->query('INSERT INTO ' . DB_PREFIX . 'jrc_transcript SET name = "Admin", message = "' . smartsql(LS_WELCOME_MESSAGE) . '", convid = "' . $cid . '", time = NOW(), class = "admin"'); } // Redirect page $gochat = LS_rewrite::lsParseurl('chat', '', '', '', ''); /* Outputtng the error messages */ if ($_SERVER['HTTP_X_REQUESTED_WITH']) { header('Cache-Control: no-cache'); echo json_encode(array('login' => 1, 'link' => $gochat)); exit; } ls_redirect($gochat); } } ?> <!DOCTYPE html> <html lang="en"> <head> <title><?php echo $tl["general"]["g"];
// Stop the chat if ($page == 'stop') { require_once 'stop.php'; $LS_CHECK_PAGE = 1; $PAGE_SHOWTITLE = 1; } // Stop the chat if ($page == 'feedback') { require_once 'feedback.php'; $LS_CHECK_PAGE = 1; $PAGE_SHOWTITLE = 1; } // Get the button if ($page == 'b') { require_once 'button.php'; $LS_CHECK_PAGE = 1; $PAGE_SHOWTITLE = 1; } // Get the 404 page if ($page == '404') { $PAGE_TITLE = '404 '; require_once '404.php'; $LS_CHECK_PAGE = 1; $PAGE_SHOWTITLE = 1; } // if page not found if ($LS_CHECK_PAGE == 0) { ls_redirect(LS_rewrite::lsParseurl('404', '', '', '', '')); } // Finally close all db connections $lsdb->ls_close();
} } else { include 'include/nexmo/NexmoMessage.php'; while ($row = $result->fetch_assoc()) { // Step 1: Declare new NexmoMessage. (Api Key) (Api Secret) $nexmo_sms = new NexmoMessage(base64_decode(LS_TW_SID), base64_decode(LS_TW_TOKEN)); // Step 2: Use sendText( $to, $from, $message ) method to send a message. $info = $nexmo_sms->sendText($row['phonenumber'], LS_TITLE, LS_TW_MSG); } } } } } } // Redirect page $gochat = LS_rewrite::lsParseurl('chat', $_POST['slide_chat'], $_POST['lang'], '', ''); /* Outputtng the error messages */ if ($_SERVER['HTTP_X_REQUESTED_WITH']) { header('Cache-Control: no-cache'); die(json_encode(array('login' => 1, 'link' => html_entity_decode($gochat)))); } ls_redirect(html_entity_decode($gochat)); } } ?> <!DOCTYPE html> <html lang="en"> <head> <title><?php echo $tl["general"]["g"]; ?>
?> </label> <div class="controls"> <textarea name="message" id="message" rows="5" class="input-large"></textarea> </div> </div> <input type="hidden" name="send_feedback" value="1" /> <input type="hidden" name="convid" value="<?php echo $page1; ?> " /> <div class="form-actions"> <a href="<?php echo LS_rewrite::lsParseurl('stop', $_SESSION['jrc_convid'], '', '', ''); ?> " class="btn btn-danger"><?php echo $tl["general"]["g3"]; ?> </a> <button type="submit" id="formsubmit" class="btn btn-primary pull-right"><?php echo $tl["general"]["g25"]; ?> </button> </div> </form> </div> <?php }
// Forgot password if ($_SERVER["REQUEST_METHOD"] == 'POST' && isset($_POST['forgotP'])) { $defaults = $_POST; if ($defaults['lsE'] == '' || !filter_var($defaults['lsE'], FILTER_VALIDATE_EMAIL)) { $errors['e'] = $tl['error']['e19']; } // transform user email $femail = filter_var($_POST['lsE'], FILTER_SANITIZE_EMAIL); $fwhen = time(); // Check if this user exist $user_check = $lsuserlogin->lsForgotpassword($femail, $fwhen); if (!$errors['e'] && !$user_check) { $errors['e'] = $tl['error']['e19']; } if (count($errors) == 0) { $mail = new PHPMailer(); // defaults to using php "mail()" $mail->SetFrom(LS_EMAIL, LS_TITLE); $address = $femail; $mail->AddAddress($address, $fusername); $mail->Subject = LS_TITLE . ' - ' . $tl['login']['l13']; $mail->Body = $tl['login']['l14'] . ' ' . BASE_URL . html_entity_decode(LS_rewrite::lsParseurl($tl['login']['l12'], $fwhen, '', '', '')); if ($mail->Send()) { $_SESSION['password_recover'] = 1; ls_redirect(BASE_URL); } } else { $errorfp = $errors; } } $template = 'login.php';
if (!defined('LS_PREVENT_ACCESS')) { die('You cannot access this file directly.'); } // start buffer ob_start(); if (empty($_SESSION['jrc_userid']) || empty($_SESSION['convid']) || LS_base::lsCheckSession($_SESSION['jrc_userid'], $_SESSION['convid'])) { // Destroy Session unset($_SESSION['convid']); unset($_SESSION['jrc_userid']); unset($_SESSION['jrc_email']); ls_redirect(html_entity_decode(LS_rewrite::lsParseurl('start', $page1, $page2, '', ''))); } if (LS_FEEDBACK) { $parseurl = LS_rewrite::lsParseurl('feedback', $page1, $page2, '', ''); } else { $parseurl = LS_rewrite::lsParseurl('stop', $page1, $page2, '', ''); } ?> <!DOCTYPE html> <html lang="en"> <head> <title><?php echo $tl["general"]["g"]; ?> - <?php echo LS_TITLE; ?> </title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Live Chat Rhino" />
message = "' . smartsql($tl['general']['g16']) . '", user = "******", convid = "' . $row['id'] . '", time = NOW(), class = "ended"'); } // Now get the support time $result2 = $lsdb->query('SELECT initiated, ended FROM ' . DB_PREFIX . 'sessions WHERE id = "' . smartsql($page1) . '"'); $row2 = $result2->fetch_assoc(); $total_supporttime = $row2['ended'] - $row2['initiated']; // Write stuff into the user stats $lsdb->query('INSERT INTO ' . DB_PREFIX . 'user_stats SET userid = "' . smartsql($row["operatorid"]) . '", vote = 0, name = "' . smartsql($_SESSION['jrc_name']) . '", email = "' . smartsql($row["email"]) . '", support_time = "' . $total_supporttime . '", time = NOW()'); } unset($_SESSION['convid']); unset($_SESSION['jrc_userid']); unset($_SESSION['jrc_email']); unset($_SESSION['jrc_captcha']); ls_redirect(html_entity_decode(LS_rewrite::lsParseurl('start', $page1, $page2, '', ''))); } ob_flush(); ?> <script type="text/javascript"> javascript:window.close(); </script>