ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilECSParticipant.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
34 {
35  protected $json_obj;
36  protected $cid;
37  protected $mid;
38  protected $email;
39  protected $certid;
40  protected $dns;
41  protected $description;
42  protected $participantname;
43  protected $abr;
44  protected $is_self;
45 
46  protected $settings;
47  protected $part_settings;
48 
49 
57  public function __construct($json_obj,$a_cid)
58  {
59  include_once('Services/WebServices/ECS/classes/class.ilECSSettings.php');
60  include_once('Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php');
61 
62  $this->settings = ilECSSettings::_getInstance();
63  $this->part_settings = ilECSParticipantSettings::_getInstance();
64  $this->json_obj = $json_obj;
65  $this->cid = $a_cid;
66  $this->read();
67  }
68 
75  public function getCommunityId()
76  {
77  return $this->cid;
78  }
79 
87  public function getMID()
88  {
89  return $this->mid;
90  }
91 
98  public function getEmail()
99  {
100  return $this->email;
101  }
102 
110  public function getCertId()
111  {
112  return $this->certid;
113  }
114 
122  public function getDNS()
123  {
124  return $this->dns;
125  }
126 
133  public function getDescription()
134  {
135  return $this->description;
136  }
137 
144  public function getParticipantName()
145  {
146  return $this->participantname;
147  }
148 
155  public function getAbbreviation()
156  {
157  return $this->abr;
158  }
159 
167  public function isPublishable()
168  {
169  return $this->isSelf();
170  }
171 
179  public function isSelf()
180  {
181  return (int) $this->getCertId() == (int) $this->settings->getCertSerialNumber();
182  }
183 
184 
191  public function isEnabled()
192  {
193  return (bool) $this->part_settings->isEnabled($this->getMID());
194  }
201  private function read()
202  {
203  global $ilLog;
204 
205  $this->mid = $this->json_obj->mid;
206  $this->email = $this->json_obj->email;
207  $this->certid = hexdec($this->json_obj->certid);
208  $this->dns = $this->json_obj->dns;
209  $this->description = $this->json_obj->description;
210  $this->participantname = $this->json_obj->participantname;
211  $this->abr = $this->json_obj->abr;
212  #$ilLog->write(__METHOD__.': Received certId '.$this->getCertId().' for '.$this->getParticipantName());
213  return true;
214  }
215 }
216 
217 
218 ?>