Merge branch 'master' of https://gitlab.chiefsoft.net/Chiefsoft/CoreGrade
Conflicts: www/application/controllers/Auth.php
This commit is contained in:
@@ -1,118 +0,0 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Auth extends Start_Controller {
|
||||
|
||||
public function index() {
|
||||
$login_done = false;
|
||||
$data = array();
|
||||
$username = '';
|
||||
$password = '';
|
||||
$error_message = '';
|
||||
$valid_entry = false;
|
||||
$valid_login = false;
|
||||
$out = [];
|
||||
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
|
||||
|
||||
$this->testLoginInput($username, $password, $error_message, $valid_entry);
|
||||
|
||||
if (true == $valid_entry) {
|
||||
if ($username != '' && $password != '') {
|
||||
|
||||
$data["page_title"] = "";
|
||||
$data["username"] = $username; //"auxsupport";
|
||||
$data["password"] = $password;
|
||||
$out = [];
|
||||
$this->coregrade_webapi(COREGRADE_ACCOUNT_LOGIN, $data, $out);
|
||||
//print_r( $data );
|
||||
//print_r( $out );
|
||||
if (count($out) > 0 && isset($out["session"])) {
|
||||
//print_r($out);
|
||||
//$this->getSessionData($out[0], $session_data); // just for testing
|
||||
|
||||
$this->buildUserSession(PHP_API_OK, $out);
|
||||
$valid_login = true;
|
||||
$this->session->set_flashdata('in', $out);
|
||||
// redirect("page/index");
|
||||
} else {
|
||||
$error_message = "Invalid Username/Password";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->renderMemberPages('view_dash', $data);
|
||||
$login_done = true;
|
||||
|
||||
// exit();
|
||||
}
|
||||
echo 'Welcome on board!';
|
||||
$this->coregrade_webapi(100, $data, $out);
|
||||
|
||||
print_r($out);
|
||||
|
||||
if (false == $login_done) {
|
||||
$this->renderAuthPages('view_login', $data);
|
||||
}
|
||||
}
|
||||
|
||||
public function newuser() {
|
||||
//$this->load->view('home/home');
|
||||
$data["firstname"] = $data["lastname"] = $data["password"] = $data["email"] = "";
|
||||
$valid_entry = true;
|
||||
$valid_login = false;
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
|
||||
$data['firstname'] = trim($this->input->post('firstname'));
|
||||
$data['lastname'] = trim($this->input->post('lastname'));
|
||||
$data['username'] = trim($this->input->post('username'));
|
||||
$data['password'] = trim($this->input->post('pass1'));
|
||||
$data['email'] = $data['username'];
|
||||
|
||||
if (true == $valid_entry) {
|
||||
if ($data['username'] != '' && $data['password'] != '') {
|
||||
$out = [];
|
||||
$this->coregrade_webapi(COREGRADE_ACCOUNT_PENDING, $data, $out);
|
||||
|
||||
//print_r( $data );
|
||||
// print_r($out);
|
||||
if (count($out) > 0 && isset($out["pending_id"]) && $out["pending_id"] > 0) {
|
||||
//print_r($out);
|
||||
//$this->getSessionData($out[0], $session_data); // just for testing
|
||||
|
||||
$this->renderAuthPages('view_pending', $data);
|
||||
$login_done = true;
|
||||
// redirect("page/index");
|
||||
} else {
|
||||
$error_message = "Invalid Username/Password";
|
||||
}
|
||||
}
|
||||
}
|
||||
// exit();
|
||||
}
|
||||
|
||||
|
||||
$this->load->view('auth/view_head');
|
||||
$this->load->view('auth/view_register');
|
||||
$this->load->view('auth/view_foot');
|
||||
}
|
||||
|
||||
public function resetpass() {
|
||||
//$this->load->view('home/home');
|
||||
//echo "START RESET 1";
|
||||
$this->load->view('auth/view_head');
|
||||
$this->load->view('auth/view_reset_password');
|
||||
$this->load->view('auth/view_foot');
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
$this->index();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,16 +5,75 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class Member extends Member_Controller {
|
||||
|
||||
public function index() {
|
||||
|
||||
|
||||
$data = array();
|
||||
|
||||
$mysql = "SELECT * FROM members_pages WHERE member_id = " . $_SESSION["member_id"];
|
||||
$r = $this->db->query($mysql);
|
||||
$data["page_card"] = $r->result();
|
||||
|
||||
|
||||
|
||||
$this->renderMemberPages('view_dash', $data);
|
||||
}
|
||||
|
||||
public function mycalendar(){
|
||||
public function page() {
|
||||
// echo 'yes'; view_mypage
|
||||
|
||||
$data = array();
|
||||
|
||||
//$mysql = "SELECT * FROM members_pages WHERE member_id = " . $_SESSION["member_id"];
|
||||
// $r = $this->db->query($mysql);
|
||||
// $data["page_card"] = $r->result();
|
||||
$this->renderMemberPages('view_mypage', $data);
|
||||
}
|
||||
|
||||
public function configure() {
|
||||
// echo 'yes'; view_mypage
|
||||
|
||||
$data = array();
|
||||
|
||||
|
||||
$mysql = "SELECT * FROM members_pages WHERE member_id = " . $_SESSION["member_id"];
|
||||
$r = $this->db->query($mysql);
|
||||
$data["page_card"] = $r->result();
|
||||
|
||||
|
||||
//$mysql = "SELECT * FROM members_pages WHERE member_id = " . $_SESSION["member_id"];
|
||||
// $r = $this->db->query($mysql);
|
||||
// $data["page_card"] = $r->result();
|
||||
$this->renderMemberPages('view_configure', $data);
|
||||
}
|
||||
|
||||
public function addcard() {
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
|
||||
$data['description'] = trim($this->input->post('description'));
|
||||
$data['title'] = trim($this->input->post('title'));
|
||||
$data['member_id'] = $_SESSION["member_id"];
|
||||
$data['session'] = $_SESSION["sessionid"];
|
||||
|
||||
|
||||
|
||||
if ($data['description'] != '' && $data['title'] != '') {
|
||||
$out = [];
|
||||
$this->coregrade_webapi(COREGRADE_ACCOUNT_ADDCARD, $data, $out);
|
||||
}
|
||||
|
||||
// exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$this->configure();
|
||||
}
|
||||
|
||||
public function mycalendar() {
|
||||
$data = array();
|
||||
$this->renderMemberPages('view_mycalendar', $data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ class Vemail extends Start_Controller {
|
||||
//$this->load->view('home/home');
|
||||
$valid_entry = true;
|
||||
$valid_login = false;
|
||||
$data = [];
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
|
||||
|
||||
@@ -19,16 +20,10 @@ class Vemail extends Start_Controller {
|
||||
$this->coregrade_webapi(COREGRADE_ACCOUNT_CREATEACC, $data, $out);
|
||||
//print_r( $data );
|
||||
//print_r( $out );
|
||||
if (count($out) > 0 && isset($out["session"])) {
|
||||
//print_r($out);
|
||||
//$this->getSessionData($out[0], $session_data); // just for testing
|
||||
if (count($out) > 0 && isset($out["member_id"]) && $out["member_id"] > 0) {
|
||||
// $this->renderAuthPages('view_login', $data);
|
||||
|
||||
|
||||
$this->buildUserSession(PHP_API_OK, $out);
|
||||
$valid_login = true;
|
||||
$this->session->set_flashdata('in', $out);
|
||||
|
||||
$this->renderMemberPages('view_dash', $data);
|
||||
$login_done = true;
|
||||
|
||||
// redirect("page/index");
|
||||
} else {
|
||||
@@ -44,9 +39,7 @@ class Vemail extends Start_Controller {
|
||||
}
|
||||
|
||||
|
||||
$this->load->view('auth/view_head');
|
||||
$this->load->view('auth/view_register');
|
||||
$this->load->view('auth/view_foot');
|
||||
$this->renderAuthPages('view_login', $data);
|
||||
}
|
||||
|
||||
public function resetpass() {
|
||||
|
||||
Reference in New Issue
Block a user