session fix
This commit is contained in:
@@ -27,30 +27,25 @@ class Auth extends BaseController
|
||||
$out = $this->APIcall('POST', $this->wrenchAdminApiServer(). 'auth',$data);
|
||||
// var_dump( $out );
|
||||
if (is_array($out) && isset($out['sessionid']) && isset($out['promo_admin_id'])){
|
||||
session_status();
|
||||
|
||||
$_SESSION['firstname'] = $out['firstname'];
|
||||
$_SESSION['lastname'] = $out['lastname'];
|
||||
$_SESSION['email'] = $out['email'];
|
||||
$_SESSION['promo_admin_id'] =$out['promo_admin_id'];
|
||||
$_SESSION['sessionid'] = $out['sessionid'];
|
||||
|
||||
$_SESSION['new_users'] = 0;
|
||||
$_SESSION['pending_users'] = 0;
|
||||
$_SESSION['active_users'] = 0;
|
||||
$_SESSION['total_users'] = 0;
|
||||
|
||||
|
||||
return view('admin/index', $out);
|
||||
}
|
||||
|
||||
return view('promo_admin_home', $out);
|
||||
}
|
||||
|
||||
// public function AuthPromoDash(){
|
||||
// $out=[];
|
||||
// //exit();
|
||||
// return view('admin/index', $out);
|
||||
// }
|
||||
|
||||
public function addRefMember(){
|
||||
echo "Ameye Olu Test ";
|
||||
}
|
||||
//$routes->post('/en/promoadmin/api/v1/auth', 'Promo::promoAuth');
|
||||
//$routes->get('/en/promoadmin/api/v1/list', 'Promo::promoList');
|
||||
//$routes->post('/en/promoadmin/api/v1/list', 'Promo::promoAddRef');
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ abstract class BaseController extends Controller
|
||||
* Be sure to declare properties for any property fetch you initialized.
|
||||
* The creation of dynamic property is deprecated in PHP 8.2.
|
||||
*/
|
||||
// protected $session;
|
||||
protected $session;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
@@ -54,12 +54,14 @@ abstract class BaseController extends Controller
|
||||
// Preload any models, libraries, etc, here.
|
||||
|
||||
// E.g.: $this->session = \Config\Services::session();
|
||||
$this->session = \Config\Services::session();
|
||||
$httpHost = $_SERVER['HTTP_HOST'];
|
||||
|
||||
if ( $httpHost == 'https://promo.wrenchboard.com' || $httpHost == 'promo.wrenchboard.com' ){
|
||||
$_SERVER['CI_ENV'] = 'production';
|
||||
$_SERVER['CI_ENVIRONMENT'] = 'production';
|
||||
}
|
||||
// if ( session_status() !== PHP_SESSION_ACTIVE ) session_start();
|
||||
}
|
||||
|
||||
public function APIcall($method, $url, $data) {
|
||||
|
||||
@@ -25,19 +25,18 @@ class PromoAdmin extends BaseController
|
||||
return view('admin/index', $out);
|
||||
}
|
||||
|
||||
public function addRefMember(){
|
||||
// $raw_json = file_get_contents('php://input');
|
||||
// $in = json_decode($raw_json, true);
|
||||
// $id_booking = $this->input->post('id_booking');
|
||||
// $in = $this->request->get;
|
||||
// var_dump( $_GET );
|
||||
// exit;
|
||||
$data['email'] = $_GET['email']; // strtolower($this->input->get('email')); // '08174596144';
|
||||
$data['firstname'] = $_GET['firstname']; // $this->input->get('firstname'); //'7978';
|
||||
$data['lastname'] = $_GET['lastname']; // strtolower($this->input->get('lastname')); // '08174596144';
|
||||
|
||||
public function PromoMyList(){
|
||||
$out=[];
|
||||
//exit();
|
||||
return view('admin/mylist', $out);
|
||||
}
|
||||
public function addRefMember(){
|
||||
|
||||
$data['email'] = $_GET['email'];
|
||||
$data['firstname'] = $_GET['firstname'];
|
||||
$data['lastname'] = $_GET['lastname'];
|
||||
|
||||
$out=[];
|
||||
$out = $this->APIcall('POST', $this->wrenchAdminApiServer(). 'list',$data);
|
||||
var_dump( $out );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user