public function getCreator() { $u = new Dase_DBO_User($this->db); $u->eid = $this->creator_eid; $this->creator = $u->findOne(); return $this->creator; }
public function getUsers() { $esus = new Dase_DBO_ExerciseSetUser($this->db); $esus->set_id = $this->id; foreach ($esus->findAll(1) as $esu) { $u = new Dase_DBO_User($this->db); $u->load($esu->user_id); $this->users[] = $u; } return $this->users; }
public static function get($db, $id) { $user = new Dase_DBO_User($db); $user->load($id); return $user; }
public function getUserCount() { $user = new Dase_DBO_User($this->db); return $user->findCount(); }
public function getSet($r) { $t = new Dase_Template($r); $t->init($this); $set = new Dase_DBO_ExerciseSet($this->db); $set->load($r->get('id')); if ($set->creator_eid != $this->user->eid) { $r->renderError('401'); } $set->getUsers(); $set->getExercises(); $t->assign('set', $set); $this->user->getSets(); $instructors = new Dase_DBO_User($this->db); $instructors->is_instructor = true; $t->assign('instructors', $instructors->findAll(1)); $r->renderResponse($t->fetch('admin_set.tpl')); }
public function putIsAdmin($r) { $user = new Dase_DBO_User($this->db); $user->load($r->get('id')); $user->is_admin = 1; $user->update(); $r->renderResponse('added privileges'); }