mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 16:32:20 +00:00
- AuthLib is loaded only in fhcauth_helper, PermissionLib and REST_Controller
- Removed all the NOT usefull loads of helpers and libraries - Fixed undefined index in controllers/system/UDF and model system/UDF_model - APIv1_Controller now loads helper fhcauth - FHC_Controller now loads ithe fhc and session helpers too - Added/Fixed comments - PermissionLib does NOT use anymore the getAuthUID function from the fhcauth helper, now relies on AuthLib directly - REST_Controller loads directly the AuthLib when is needed
This commit is contained in:
@@ -22,13 +22,13 @@ class MailJob extends FHC_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
|
||||
// Loads MessageLib
|
||||
$this->load->library("MessageLib");
|
||||
$this->load->library('MessageLib');
|
||||
}
|
||||
|
||||
|
||||
public function sendMessages($numberToSent = null, $numberPerTimeRange = null, $email_time_range = null, $email_from_system = null)
|
||||
{
|
||||
$this->messagelib->sendAll($numberToSent, $numberPerTimeRange, $email_time_range, $email_from_system);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,6 @@ class CheckUserAuth extends APIv1_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads the authentication library
|
||||
$this->load->library('AuthLib');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,7 @@ class Basic extends CI_Controller
|
||||
parent::__construct();
|
||||
|
||||
$this->load->library(array('rdf'));
|
||||
$this->load->helper(array('form', 'url'));
|
||||
$this->load->helper('form');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,7 +25,7 @@ class Basic extends CI_Controller
|
||||
$d['content'] = $this->load->view('rdf/basic', $d, true);
|
||||
$this->load->view('home', $d);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Sparql-View
|
||||
* @return void
|
||||
@@ -37,7 +37,7 @@ class Basic extends CI_Controller
|
||||
$d['content'] = $this->load->view('rdf/basic_sparql', $d, true);
|
||||
$this->load->view('home', $d);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load foaf-View
|
||||
* @return void
|
||||
@@ -60,7 +60,7 @@ class Basic extends CI_Controller
|
||||
$d['content'] = $this->load->view('rdf/foafmaker', $d, true);
|
||||
$this->load->view('home', $d);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load converter View
|
||||
* @return void
|
||||
|
||||
@@ -2,25 +2,19 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class UDF extends VileSci_Controller
|
||||
class UDF extends VileSci_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Load session library
|
||||
$this->load->library('session');
|
||||
|
||||
// Loads the UDF library
|
||||
$this->load->library('UDFLib');
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
@@ -33,7 +27,7 @@ class UDF extends VileSci_Controller
|
||||
}
|
||||
unset($this->session->person_id);
|
||||
}
|
||||
|
||||
|
||||
$prestudent_id = $this->input->get('prestudent_id');
|
||||
if (isset($this->session->prestudent_id))
|
||||
{
|
||||
@@ -43,16 +37,16 @@ class UDF extends VileSci_Controller
|
||||
}
|
||||
unset($this->session->prestudent_id);
|
||||
}
|
||||
|
||||
|
||||
$result = null;
|
||||
if (isset($this->session->result))
|
||||
{
|
||||
$result = clone $this->session->result;
|
||||
$this->session->set_userdata('result', null);
|
||||
}
|
||||
|
||||
|
||||
$data = array('result' => $result);
|
||||
|
||||
|
||||
if (isset($person_id) && is_numeric($person_id))
|
||||
{
|
||||
if ($this->PersonModel->hasUDF())
|
||||
@@ -62,7 +56,7 @@ class UDF extends VileSci_Controller
|
||||
$data['personUdfs'] = $personUdfs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($prestudent_id) && is_numeric($prestudent_id))
|
||||
{
|
||||
if ($this->PrestudentModel->hasUDF())
|
||||
@@ -72,54 +66,54 @@ class UDF extends VileSci_Controller
|
||||
$data['prestudentUdfs'] = $prestudentUdfs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->load->view('system/udf', $data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function saveUDF()
|
||||
{
|
||||
$udfs = $this->input->post();
|
||||
$validation = $this->_validate($udfs);
|
||||
|
||||
|
||||
$userdata = array(
|
||||
'person_id' => $udfs['person_id'],
|
||||
'prestudent_id' => $udfs['prestudent_id']
|
||||
'person_id' => $this->input->post('person_id'),
|
||||
'prestudent_id' => $this->input->post('prestudent_id')
|
||||
);
|
||||
|
||||
|
||||
if (isSuccess($validation))
|
||||
{
|
||||
// Load model UDF_model
|
||||
$this->load->model('system/UDF_model', 'UDFModel');
|
||||
|
||||
|
||||
$result = $this->UDFModel->saveUDFs($udfs);
|
||||
|
||||
|
||||
$userdata['result'] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$userdata['result'] = $validation;
|
||||
}
|
||||
|
||||
|
||||
$this->session->set_userdata($userdata);
|
||||
redirect('system/UDF');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private function _validate($udfs)
|
||||
{
|
||||
$validation = error('person_id or prestudent_id is missing');
|
||||
|
||||
|
||||
if((isset($udfs['person_id']) && !(is_null($udfs['person_id'])) && ($udfs['person_id'] != ''))
|
||||
|| (isset($udfs['prestudent_id']) && !(is_null($udfs['prestudent_id'])) && ($udfs['prestudent_id'] != '')))
|
||||
{
|
||||
$validation = success(true);
|
||||
}
|
||||
|
||||
|
||||
return $validation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class Manager extends VileSci_Controller
|
||||
parent::__construct();
|
||||
|
||||
// Load helpers to upload files
|
||||
$this->load->helper(array('form', 'url'));
|
||||
$this->load->helper('form');
|
||||
|
||||
// Loads the extensions library
|
||||
$this->load->library('ExtensionsLib');
|
||||
|
||||
Reference in New Issue
Block a user