protected function addCommandButtons()
 {
     if ($this->object->getId() > 0) {
         $this->addCommandButton(ilUserSettingsGUI::CMD_UPDATE, $this->pl->txt('form_button_update'));
     } else {
         $this->addCommandButton(ilUserSettingsGUI::CMD_CREATE, $this->pl->txt('form_button_create'));
     }
     $this->addCommandButton(ilUserSettingsGUI::CMD_CANCEL, $this->pl->txt('form_button_cancel'));
 }
 /**
  *
  * JKN Patch, if naflogin is triggered do the assignments(only triggered when a new user account is created with naf plugin)
  *
  */
 public function handleEvent($a_component, $a_event, $a_parameter)
 {
     if ($a_component == 'Services/Authentication' && ($a_event == 'nafLogin' || $a_event == 'afterLogin')) {
         /**
          * @var $ilUser ilObjUser
          */
         if (is_null($a_parameter['user_obj']) && $a_parameter['username'] !== 'anonymous') {
             $ilUser = new ilObjUser(ilObjUser::getUserIdByLogin($a_parameter['username']));
         } else {
             $ilUser = $a_parameter['user_obj'];
         }
         if ($ilUser instanceof ilObjUser) {
             foreach (ilUserSetting::where(array('status' => ilUserSetting::STATUS_ACTIVE))->get() as $ilUserSetting) {
                 $ilUserSetting->doAssignements($ilUser);
             }
         }
     }
 }
Exemple #3
0
<#1>
<?php 
require_once './Customizing/global/plugins/Services/EventHandling/EventHook/UserDefaults/classes/UDFCheck/class.ilUDFCheck.php';
require_once './Customizing/global/plugins/Services/EventHandling/EventHook/UserDefaults/classes/UserSetting/class.ilUserSetting.php';
ilUDFCheck::installDB();
ilUserSetting::installDB();
?>
<#2>
<?php 
require_once './Customizing/global/plugins/Services/EventHandling/EventHook/UserDefaults/classes/UserSetting/class.ilUserSetting.php';
ilUserSetting::updateDB();
?>
<#3>
<?php 
require_once './Customizing/global/plugins/Services/EventHandling/EventHook/UserDefaults/classes/UserSetting/class.ilUserSetting.php';
ilUserSetting::updateDB();
?>
<#4>
<?php 
require_once './Customizing/global/plugins/Services/EventHandling/EventHook/UserDefaults/classes/UserSetting/class.ilUserSetting.php';
ilUserSetting::updateDB();
?>
<#5>
<?php 
require_once './Customizing/global/plugins/Services/EventHandling/EventHook/UserDefaults/classes/UserSetting/class.ilUserSetting.php';
ilUserSetting::updateDB();
 /**
  * @param array $a_set
  */
 public function fillRow($a_set)
 {
     $ilUserSetting = ilUserSetting::find($a_set['id']);
     $ilUDFCheckGUI = new ilUDFCheckGUI($this->parent_obj);
     foreach ($this->getSelectableColumns() as $k => $v) {
         if ($k == 'actions') {
             $this->ctrl->setParameter($this->parent_obj, ilUserSettingsGUI::IDENTIFIER, $ilUserSetting->getId());
             $this->ctrl->setParameter($ilUDFCheckGUI, ilUserSettingsGUI::IDENTIFIER, $ilUserSetting->getId());
             $current_selection_list = new ilAdvancedSelectionListGUI();
             $current_selection_list->setListTitle($this->pl->txt('set_actions'));
             $current_selection_list->setId('set_actions' . $ilUserSetting->getId());
             $current_selection_list->setUseImages(false);
             $current_selection_list->addItem($this->pl->txt('set_edit'), 'set_edit', $this->ctrl->getLinkTarget($this->parent_obj, ilUserSettingsGUI::CMD_EDIT));
             $current_selection_list->addItem($this->pl->txt('set_udf_checks'), 'set_udf_checks', $this->ctrl->getLinkTarget($ilUDFCheckGUI, ilUDFCheckGUI::CMD_INDEX));
             if ($ilUserSetting->getStatus() == ilUserSetting::STATUS_ACTIVE) {
                 $current_selection_list->addItem($this->pl->txt('set_deactivate'), 'set_deactivate', $this->ctrl->getLinkTarget($this->parent_obj, ilUserSettingsGUI::CMD_DEACTIVATE));
             } else {
                 $current_selection_list->addItem($this->pl->txt('set_activate'), 'set_activate', $this->ctrl->getLinkTarget($this->parent_obj, ilUserSettingsGUI::CMD_ACTIVATE));
             }
             $current_selection_list->addItem($this->pl->txt('set_delete'), 'set_delete', $this->ctrl->getLinkTarget($this->parent_obj, ilUserSettingsGUI::CMD_CONFIRM_DELETE));
             $this->tpl->setCurrentBlock('td');
             $this->tpl->setVariable('VALUE', $current_selection_list->getHTML());
             $this->tpl->parseCurrentBlock();
             continue;
         }
         if ($this->isColumnSelected($k)) {
             if ($a_set[$k]) {
                 $this->tpl->setCurrentBlock('td');
                 $this->tpl->setVariable('VALUE', is_array($a_set[$k]) ? implode(", ", $a_set[$k]) : $a_set[$k]);
                 $this->tpl->parseCurrentBlock();
             } else {
                 $this->tpl->setCurrentBlock('td');
                 $this->tpl->setVariable('VALUE', '&nbsp;');
                 $this->tpl->parseCurrentBlock();
             }
         }
     }
 }