Fix getAccessible() in project model

This commit is contained in:
Eike Foken
2011-09-16 15:18:05 +02:00
parent 875f2f754b
commit 9e58475a32

View File

@@ -98,7 +98,11 @@ class Project extends CI_Model {
* @param string $userId * @param string $userId
* @return array All accessible projects * @return array All accessible projects
*/ */
public function getAccessible($userId) { public function getAccessible($userId = '') {
if (empty($userId)) {
$userId = $this->session->userdata('user_id');
}
$shares = array(); $shares = array();
$query = $this->db->get_where('shares', array('user_id' => $userId)); $query = $this->db->get_where('shares', array('user_id' => $userId));
foreach ($query->result_array() as $share) { foreach ($query->result_array() as $share) {