fix
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
class JUB_Controller extends CI_Controller {
|
||||
|
||||
var $template = array(
|
||||
'table_open' => "<table class='table-responsive table-striped table-hover table-bordered table-condensed'>",
|
||||
'thead_open' => '<thead class=\'bg-indigo\'>',
|
||||
'thead_close' => '</thead>',
|
||||
'heading_row_start' => '<tr style=\'padding:1px;\'>',
|
||||
'heading_row_end' => '</tr>',
|
||||
'heading_cell_start' => '<th>',
|
||||
'heading_cell_end' => '</th>',
|
||||
'tbody_open' => '<tbody>',
|
||||
'tbody_close' => '</tbody>',
|
||||
'row_start' => '<tr style=\'padding:0px;\'>',
|
||||
'row_end' => '</tr>',
|
||||
'cell_start' => '<td>',
|
||||
'cell_end' => '</td>',
|
||||
'row_alt_start' => '<tr>',
|
||||
'row_alt_end' => '</tr>',
|
||||
'cell_alt_start' => '<td>',
|
||||
'cell_alt_end' => '</td>',
|
||||
'table_close' => '</table>'
|
||||
);
|
||||
|
||||
public $data = array();
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function smart_htmlspecialchars($str) {
|
||||
if (substr($str, 0, 1) == '<')
|
||||
return $str;
|
||||
return htmlspecialchars($str);
|
||||
}
|
||||
|
||||
protected function sql_escape_func($inp) {
|
||||
if (is_array($inp)) {
|
||||
return array_map(__METHOD__, $inp);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($inp) && is_string($inp)) {
|
||||
return str_replace(array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), array('\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z'), $inp);
|
||||
}
|
||||
|
||||
return $inp;
|
||||
}
|
||||
|
||||
protected function jubabox_webapi($action, $in, &$out) {
|
||||
global $savvyext;
|
||||
$ret = -1;
|
||||
$in['pid'] = 115;
|
||||
|
||||
error_log("ret = $ret");
|
||||
error_log(json_encode($out));
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function formatedMesage($msgType, $theMessage) {
|
||||
return "<div class=\"text-left\"><div class=\"alert alert-danger no-border\">" . $theMessage . "</div></div>";
|
||||
}
|
||||
|
||||
protected function renderPracticePage($page_name, $data) {
|
||||
$this->load->view('secure/view_practice_header', $data);
|
||||
$this->load->view('secure/' . $page_name, $data);
|
||||
$this->load->view('secure/view_practice_footer', $data);
|
||||
}
|
||||
|
||||
|
||||
protected function renderAdminPage($page_name, $data) {
|
||||
$this->load->view('admin/view_admin_header', $data);
|
||||
$this->load->view('admin/' . $page_name, $data);
|
||||
$this->load->view('admin/view_admin_footer', $data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Practice_Controller extends JUB_Controller {
|
||||
|
||||
public $data = array();
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
if (!isset($_SESSION['username']) or $_SESSION['username'] == '') {
|
||||
// redirect('site');
|
||||
} else {
|
||||
// erase the session properly if here
|
||||
// redirect('dash');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Start_Controller extends JUB_Controller {
|
||||
|
||||
public $data = array();
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
if (!isset($_SESSION['username']) or $_SESSION['username'] == '') {
|
||||
//redirect('site');
|
||||
} else {
|
||||
// erase the session properly if here
|
||||
// redirect('dash');
|
||||
}
|
||||
}
|
||||
|
||||
protected function buildUserSession($ret, $out) {
|
||||
|
||||
//session_destroy();
|
||||
|
||||
if ($ret == PHP_API_OK) {
|
||||
|
||||
|
||||
$_SESSION['session_id'] = $out["sessionid"];
|
||||
$_SESSION['sessionid'] = $out["sessionid"];
|
||||
$_SESSION['username'] = $out["username"]; // $this->input->post('username');
|
||||
$_SESSION['firstname'] = $out["firstname"]; // $ret->firstname;
|
||||
$_SESSION['lastname'] = $out["lastname"]; // $ret->lastname;
|
||||
$_SESSION['email'] = $out["email"]; // $ret->email;
|
||||
$_SESSION['user_id'] = $out["user_id"]; // $ret->id;
|
||||
$_SESSION['pid'] = $out["pid"]; // $ret->id;
|
||||
$_SESSION['loc'] = $out["loc"];
|
||||
$_SESSION['practice'] = $out["practice"];
|
||||
$_SESSION['PracticeID'] = $out["PracticeID"];
|
||||
$_SESSION['UserId'] = $out["UserId"];
|
||||
}
|
||||
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
||||
$_SESSION['loc'] = $_SERVER['HTTP_CLIENT_IP'];
|
||||
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$_SESSION['loc'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
} else {
|
||||
$_SESSION['loc'] = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
}
|
||||
|
||||
protected function testLoginInput(&$username, &$password,&$error_message, &$valid_entry) {
|
||||
$valid_entry = true;
|
||||
$username = trim($this->input->post('username'));
|
||||
$password = trim($this->input->post('password'));
|
||||
if ($username == '' or $password == '') {
|
||||
$valid_entry = false;
|
||||
$error_message = 'Enter a Username/Password & PracticeID to continue';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user