Fixed a bug when accessing the session userdata
This commit is contained in:
@@ -4,7 +4,7 @@ class Jobs extends CI_Controller {
|
|||||||
|
|
||||||
public function getOwn() {
|
public function getOwn() {
|
||||||
$query = $this->db->order_by('progress', 'desc')
|
$query = $this->db->order_by('progress', 'desc')
|
||||||
->get_where('jobs', array('started_by' => $this->session->user_data('user_id')));
|
->get_where('jobs', array('started_by' => $this->session->userdata('user_id')));
|
||||||
$count = $query->num_rows();
|
$count = $query->num_rows();
|
||||||
$jobs = $query->result_array();
|
$jobs = $query->result_array();
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ class Jobs extends CI_Controller {
|
|||||||
|
|
||||||
public function listResultsNotSeen() {
|
public function listResultsNotSeen() {
|
||||||
$query = $this->db->order_by('started_at', 'asc')
|
$query = $this->db->order_by('started_at', 'asc')
|
||||||
->get_where('jobs', array('started_by' => $this->session->user_data('user_id'), 'seen' => '0'));
|
->get_where('jobs', array('started_by' => $this->session->userdata('user_id'), 'seen' => '0'));
|
||||||
$count = $query->num_rows();
|
$count = $query->num_rows();
|
||||||
$jobs = $query->result_array();
|
$jobs = $query->result_array();
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Project extends CI_Model {
|
|||||||
* @return array The user's projects.
|
* @return array The user's projects.
|
||||||
*/
|
*/
|
||||||
public function getOwn() {
|
public function getOwn() {
|
||||||
$query = $this->db->where(array('owner' => $this->session->user_data('user_id')))
|
$query = $this->db->where(array('owner' => $this->session->userdata('user_id')))
|
||||||
->order_by('lastaccess', 'desc')
|
->order_by('lastaccess', 'desc')
|
||||||
->get('projects');
|
->get('projects');
|
||||||
$projects = $query->result_array();
|
$projects = $query->result_array();
|
||||||
@@ -39,7 +39,8 @@ class Project extends CI_Model {
|
|||||||
* @return array The shared projects.
|
* @return array The shared projects.
|
||||||
*/
|
*/
|
||||||
public function getShared() {
|
public function getShared() {
|
||||||
$this->db->select('*')->from('shares')->order_by('lastaccess', 'desc')->where(array('user_id' => $this->session->user_data('user_id')));
|
$this->load->library('session');
|
||||||
|
$this->db->select('*')->from('shares')->order_by('lastaccess', 'desc')->where(array('user_id' => $this->session->userdata('user_id')));
|
||||||
$this->db->join('projects', 'projects.id = shares.project_id');
|
$this->db->join('projects', 'projects.id = shares.project_id');
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user