Example #1
0
 public function getCreator()
 {
     $u = new Dase_DBO_User($this->db);
     $u->eid = $this->creator_eid;
     $this->creator = $u->findOne();
     return $this->creator;
 }
Example #2
0
 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;
 }
Example #3
0
 public static function get($db, $id)
 {
     $user = new Dase_DBO_User($db);
     $user->load($id);
     return $user;
 }
Example #4
0
 public function getUserCount()
 {
     $user = new Dase_DBO_User($this->db);
     return $user->findCount();
 }
Example #5
0
 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'));
 }
Example #6
0
 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');
 }