Example #1
0
 public function updateFields()
 {
     $shibConfig = shibConfig::getInstance();
     if ($shibConfig->getUpdateFirstname()) {
         $this->setFirstname($this->shibServerData->getFirstname());
     }
     if ($shibConfig->getUpdateLastname()) {
         $this->setLastname($this->shibServerData->getLastname());
     }
     if ($shibConfig->getUpdateGender()) {
         $this->setGender($this->shibServerData->getGender());
     }
     if ($shibConfig->getUpdateTitle()) {
         $this->setTitle($this->shibServerData->getTitle());
     }
     if ($shibConfig->getUpdateInstitution()) {
         $this->setInstitution($this->shibServerData->getInstitution());
     }
     if ($shibConfig->getUpdateDepartment()) {
         $this->setDepartment($this->shibServerData->getDepartment());
     }
     if ($shibConfig->getUpdateStreet()) {
         $this->setStreet($this->shibServerData->getStreet());
     }
     if ($shibConfig->getUpdateZipcode()) {
         $this->setZipcode($this->shibServerData->getZipcode());
     }
     if ($shibConfig->getUpdateCountry()) {
         $this->setCountry($this->shibServerData->getCountry());
     }
     if ($shibConfig->getUpdatePhoneOffice()) {
         $this->setPhoneOffice($this->shibServerData->getPhoneOffice());
     }
     if ($shibConfig->getUpdatePhoneHome()) {
         $this->setPhoneHome($this->shibServerData->getPhoneHome());
     }
     if ($shibConfig->getUpdatePhoneMobile()) {
         $this->setPhoneMobile($this->shibServerData->getPhoneMobile());
     }
     if ($shibConfig->getUpdateFax()) {
         $this->setFax($this->shibServerData->getFax());
     }
     if ($shibConfig->getUpdateMatriculation()) {
         $this->setMatriculation($this->shibServerData->getMatriculation());
     }
     if ($shibConfig->getUpdateEmail()) {
         $this->setEmail($this->shibServerData->getEmail());
     }
     if ($shibConfig->getUpdateHobby()) {
         $this->setHobby($this->shibServerData->getHobby());
     }
     if ($shibConfig->getUpdateLanguage()) {
         $this->setLanguage($this->shibServerData->getLanguage());
     }
     $this->setDescription($this->getEmail());
 }
 /**
  * @param array $data
  */
 protected function __construct(array $data)
 {
     $shibConfig = shibConfig::getInstance();
     foreach (array_keys(get_class_vars('shibConfig')) as $field) {
         $str = $shibConfig->getValueByKey($field);
         if ($str !== NULL) {
             $this->{$field} = $data[$str];
         }
     }
 }
 /**
  * @param $a_usr_id
  * @param $a_data
  *
  * @return bool
  */
 public static function doAssignments($a_usr_id, $a_data)
 {
     global $ilDB, $rbacadmin, $ilLog;
     $query = "SELECT rule_id FROM shib_role_assignment ";
     $num_matches = 0;
     $res = $ilDB->query($query);
     while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
         $rule = new ilShibbolethRoleAssignmentRule($row->rule_id);
         if ($rule->doesMatch($a_data)) {
             $num_matches++;
             $ilLog->write(__METHOD__ . ': Assigned to role ' . ilObject::_lookupTitle($rule->getRoleId()));
             $rbacadmin->assignUser($rule->getRoleId(), $a_usr_id);
         }
     }
     // Assign to default if no matching found
     if (!$num_matches) {
         $default_role = shibConfig::getInstance()->getUserDefaultRole();
         $ilLog->write(__METHOD__ . ': Assigned to default role ' . ilObject::_lookupTitle($default_role));
         $rbacadmin->assignUser($default_role, $a_usr_id);
     }
     return true;
 }
Example #4
0
 /**
  * @return shibConfig
  */
 public static function getInstance()
 {
     if (!isset(self::$cache)) {
         self::$cache = new self();
     }
     return self::$cache;
 }