Пример #1
0
 public function getPrefsEvents()
 {
     /* Events settings */
     $this->addPrettyName('events', _("Events settings"));
     $c = new ConfigElement_list('mail_to', _('Email addresses to send alerts to'), _('On system alerts, emails will be sent to these addresses'), NULL, array());
     $this->add($c, 'events');
     $events = Events::loadAll();
     foreach ($events as $event) {
         $list = array();
         $pretty_list = array();
         foreach ($event->getCallbacks() as $cb) {
             if (!$cb['is_internal']) {
                 $list[] = $cb['name'];
                 $pretty_list[$cb['name']] = $cb['description'];
             }
         }
         if (count($list) == 0) {
             continue;
         }
         $event_name = $event->getPrettyName();
         /* FIXME: descriptions */
         $c = new ConfigElement_multiselect(get_class($event), $event_name, "When {$event_name} is emitted", "When {$event_name} is emitted", array());
         $c->setContentAvailable($pretty_list);
         $this->add($c, 'events', 'active_callbacks');
     }
     $this->addPrettyName('active_callbacks', _('Activated callbacks'));
     unset($events);
 }
Пример #2
0
 public static function configuration()
 {
     $ret = array();
     $c = new ConfigElement_input('filter', '(objectClass=posixGroup)');
     $ret[] = $c;
     $c = new ConfigElement_dictionary('match', array('name' => 'cn', 'description' => 'description'));
     $ret[] = $c;
     $c = new ConfigElement_multiselect('group_match_user', array('group_field'));
     $c->setContentAvailable(array('user_field', 'group_field'));
     $ret[] = $c;
     $c = new ConfigElement_input('user_field', 'member');
     $ret[] = $c;
     $c = new ConfigElement_select('user_field_type', 'group_dn');
     $c->setContentAvailable(array('group_dn', 'group_name'));
     $ret[] = $c;
     $c = new ConfigElement_input('group_field', 'memberUid');
     $ret[] = $c;
     $c = new ConfigElement_select('group_field_type', 'user_login');
     $c->setContentAvailable(array('user_dn', 'user_login'));
     $ret[] = $c;
     $c = new ConfigElement_input('ou', '');
     // optionnal
     $ret[] = $c;
     return $ret;
 }
Пример #3
0
 public function getPrefsEvents()
 {
     /* Events settings */
     $c = new ConfigElement_list('mail_to', array());
     $this->add($c, 'events');
     $events = Events::loadAll();
     foreach ($events as $event) {
         $list = array();
         $pretty_list = array();
         foreach ($event->getCallbacks() as $cb) {
             if (!$cb['is_internal']) {
                 $list[] = $cb['name'];
                 $pretty_list[] = $cb['name'];
             }
         }
         if (count($list) == 0) {
             continue;
         }
         $event_name = $event->getPrettyName();
         /* FIXME: descriptions */
         $c = new ConfigElement_multiselect(get_class($event), array());
         $c->setContentAvailable($pretty_list);
         $this->add($c, 'events', 'active_callbacks');
     }
     unset($events);
 }