Actually check which user is logged in

This commit is contained in:
Karsten Heiken
2011-04-22 01:07:05 +02:00
parent 78b7dd808a
commit 32478703f6
2 changed files with 4 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ class Project extends CI_Model {
* @return array The user's projects.
*/
public function getOwn() {
$query = $this->db->where(array('owner' => '215cd70f310ae6ae'))
$query = $this->db->where(array('owner' => $this->session->user_data('id')))
->order_by('lastaccess', 'desc')
->get('projects');
$projects = $query->result_array();
@@ -38,7 +38,7 @@ class Project extends CI_Model {
* @return array The shared projects.
*/
public function getShared() {
$this->db->select('*')->from('shares')->order_by('lastaccess', 'desc')->where(array('user_id' => '215cd70f310ae6ae'));
$this->db->select('*')->from('shares')->order_by('lastaccess', 'desc')->where(array('user_id' => $this->session->user_data('id')));
$this->db->join('projects', 'projects.id = shares.project_id');
$query = $this->db->get();