Exemplo n.º 1
0
 public function add_member_action()
 {
     CSRFProtection::verifyRequest();
     $mp = MultiPersonSearch::load('settings_add_deputy');
     $msg = array('error' => array(), 'success' => array());
     foreach ($mp->getAddedUsers() as $_user_id) {
         if (isDeputy($_user_id, $this->user->user_id)) {
             $msg['error'][] = sprintf(_('%s ist bereits als Vertretung eingetragen.'), get_fullname($_user_id, 'full'));
         } else {
             if ($_user_id == $this->user->user_id) {
                 $msg['error'][] = _('Sie können sich nicht als Ihre eigene Vertretung eintragen!');
             } else {
                 if (!addDeputy($_user_id, $this->user->user_id)) {
                     $msg['error'][] = _('Fehler beim Eintragen der Vertretung!');
                 } else {
                     $msg['success'][] = sprintf(_('%s wurde als Vertretung eingetragen.'), get_fullname($_user_id, 'full'));
                 }
             }
         }
     }
     // only show an error messagebox once.
     if (!empty($msg['error'])) {
         PageLayout::postMessage(MessageBox::error(_('Die gewünschte Operation konnte nicht ausgeführt werden.'), $msg['error']));
     }
     if (!empty($msg['success'])) {
         PageLayout::postMessage(MessageBox::success(_('Die gewünschten Personen wurden als Ihre Vertretung eingetragen!'), $msg['success']));
     }
     $this->redirect('settings/deputies/index');
 }
Exemplo n.º 2
0
 function deleteGroup_action()
 {
     if (Request::submitted('delete')) {
         CSRFProtection::verifyRequest();
         $this->group->delete();
         $this->redirect('contact/index');
     }
 }
Exemplo n.º 3
0
 /**
  * Deletes a cycle
  *
  * @param String $cycle_id Id of the cycle to be deleted
  */
 public function deleteCycle_action($cycle_id)
 {
     CSRFProtection::verifyRequest();
     $cycle = SeminarCycleDate::find($cycle_id);
     if ($cycle !== null && $cycle->delete()) {
         $this->course->createMessage(sprintf(_('Der regelmäßige Eintrag "%s" wurde gelöscht.'), '<b>' . $cycle->toString() . '</b>'));
     }
     $this->displayMessages();
     $this->redirect('course/timesrooms/index');
 }