first commit
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Member_Controller extends COR_Controller {
|
||||
|
||||
var $template = array(
|
||||
'table_open' => "<table style='background-color:aliceblue' class='table table-striped table-hover table-bordered table-condensed'>",
|
||||
'thead_open' => '<thead class=\'bg-indigo\'>',
|
||||
'thead_close' => '</thead>',
|
||||
'heading_row_start' => '<tr>',
|
||||
'heading_row_end' => '</tr>',
|
||||
'heading_cell_start' => '<th>',
|
||||
'heading_cell_end' => '</th>',
|
||||
'tbody_open' => '<tbody>',
|
||||
'tbody_close' => '</tbody>',
|
||||
'row_start' => '<tr>',
|
||||
'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>'
|
||||
);
|
||||
|
||||
var $template_small = array(
|
||||
'table_open' => "<table class='table table-striped table-hover table-bordered table-condensed' style='font-size:10px;'>",
|
||||
'thead_open' => '<thead class=\'bg-teal\'>',
|
||||
'thead_close' => '</thead>',
|
||||
'heading_row_start' => '<tr>',
|
||||
'heading_row_end' => '</tr>',
|
||||
'heading_cell_start' => '<th>',
|
||||
'heading_cell_end' => '</th>',
|
||||
'tbody_open' => '<tbody>',
|
||||
'tbody_close' => '</tbody>',
|
||||
'row_start' => '<tr>',
|
||||
'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();
|
||||
if (!isset($_SESSION['username']) or $_SESSION['username'] == '') {
|
||||
redirect('/');
|
||||
} 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 COR_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['member_id'] = $out["member_id"]; // $ret->id;
|
||||
$_SESSION['loc'] = $out["loc"];
|
||||
$_SESSION['mypage'] = $out["mypage"];
|
||||
$_SESSION["top_message"] = " Welcome ".$_SESSION['firstname'];
|
||||
$_SESSION['myfolder'] = $out["folder"];
|
||||
$_SESSION['profile_picture'] ="";
|
||||
}
|
||||
|
||||
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('pass1'));
|
||||
if ($username == '' or $password == '') {
|
||||
$valid_entry = false;
|
||||
$error_message = 'Enter a Username/Password & PracticeID to continue';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user