Beispiel #1
0
 /**
  \brief IRC bot löschen
 
  Löscht einen IRC Bot
 */
 function Bot_delete()
 {
     if (!$this->userdata['rights']['bots']) {
         #no permission
         $this->_header("", "no permission");
     }
     $data = $_SESSION['steps'];
     #information message, step 2
     if ($data['deletebot']) {
         #save step
         unset($data['deletebot']);
         $_SESSION['steps'] = $data;
         $name = param_str("name");
         $this->forms['information']['url'] = $this->backtracking->backlink();
         $this->forms['information']['title'] = "IRC Bot löschen";
         $this->forms['information']['message'] = "Bot '{$name}' erfolgreich gelöscht";
         $this->forms['information']['style'] = "green";
         $this->show('message_information', "IRC Bot löschen");
     }
     $id = param_num("id");
     if (!$id) {
         $this->_header();
     }
     $bot = bot_get($id);
     if (!$bot) {
         $this->_header();
     }
     #deletenews, send
     if ($_REQUEST['send']) {
         if ($_REQUEST['yes_x']) {
             addToLogfile("Bot <b>" . $bot['name'] . "</b> gelöscht", "Bots", $this->userdata['uid']);
             bot_delete($id);
             #save step
             $data['deletebot'] = 1;
             $_SESSION['steps'] = $data;
             $this->_header("admin.php?action=deletebot&name=" . $bot['name'] . "&send");
         } else {
             $this->_header();
         }
     } else {
         $this->forms['information']['url'] = "admin.php?id=" . $bot['botid'];
         $this->forms['information']['action'] = "deletebot";
         $this->forms['information']['title'] = "IRC Bot löschen";
         $this->forms['information']['message'] = "Bot '<b>" . $bot['name'] . "</b>' löschen ?";
         $this->forms['information']['style'] = "red";
         $this->show('message_question', "IRC Bot löschen");
     }
 }
Beispiel #2
0
 function _Comment_add()
 {
     $nid = param_num("nid");
     if (!$nid) {
         $this->_header("index.php");
     }
     $newsdata = getNews($nid);
     if (!$newsdata) {
         $this->_header("index.php");
     }
     $comrows = 6;
     $data = $_SESSION['steps'];
     #information message, step 2
     if ($data['addcom']) {
         #save step
         unset($data['addcom']);
         $_SESSION['steps'] = $data;
         $pages = getNewsCommentsPages($nid, $comrows);
         $this->forms['information']['url'] = $this->backtracking->backlink();
         $this->forms['information']['title'] = "Kommentar hinzufügen";
         $this->forms['information']['message'] = "Kommentar hinzugefügt";
         $this->forms['information']['style'] = "green";
         $this->show('message_information', "Kommentar hinzufügen");
     }
     #formular send
     if ($_REQUEST['send']) {
         if ($_REQUEST['next_x']) {
             $items['message'] = param_str("message", true);
             $errors = false;
             #check if empty
             foreach ($items as $key => $value) {
                 if (!$value) {
                     $this->forms['addcom']['fields'][$key]['error'] = 'Feld darf nicht leer sein!';
                     $this->forms['addcom']['fields'][$key]['bgrd'] = '_error';
                     $errors = true;
                 } else {
                     $this->forms['addcom']['fields'][$key]['value'] = $value;
                 }
             }
             #optional parameters
             if (!$errors) {
                 #save step
                 $data['addcom'] = 1;
                 $_SESSION['steps'] = $data;
                 $id = addcom($nid, editPostdata($items['message']), $this->userdata['uid']);
                 addToLogfile("Kommentar zu News <b>" . $newsdata['title'] . "</b> hinzugefügt", "News", $this->userdata['uid']);
                 $this->_header("index.php?action=addcom&nid=" . $nid . "&send");
             }
         } else {
             $this->_header($this->backtracking->backlink());
         }
     }
     $this->forms['addcom']['name'] = $return['name'];
     $this->forms['addcom']['url'] = "index.php?nid=" . $nid;
     $this->forms['addcom']['action'] = 'addcom';
     $this->show('com_add_form', "Kommentar hinzufügen");
 }
Beispiel #3
0
 function UserSettings()
 {
     $data = $_SESSION['steps'];
     #information message, step 2
     if ($data['usersettings']) {
         #save step
         unset($data['usersettings']);
         $_SESSION['steps'] = $data;
         $this->forms['information']['action'] = "";
         $this->forms['information']['url'] = $this->backtracking->backlink();
         $this->forms['information']['title'] = "Benutzerdaten &auml;ndern";
         $this->forms['information']['message'] = "&Auml;nderung erfolgreich";
         $this->forms['information']['style'] = "green";
         $this->show('message_information', "Benutzerdaten &auml;ndern");
     }
     #formular send
     if ($_REQUEST['step']) {
         $items['email']['value'] = param_str("email", true);
         $items['nick']['value'] = param_str("nick", true);
         $items['login']['value'] = param_str("login", true);
         $items['svs']['value'] = param_num("svs", 0);
         $items['fleettype']['value'] = param_num("fleettype", 1);
         $items['scantype']['value'] = param_num("scantype", 0);
         $items['timeview']['value'] = param_num("timeview", 0);
         if (!$items['email']['value']) {
             $errors[] = "Email fehlt!";
             $items['email']['bgrd'] = "_error";
         }
         if (!$items['nick']['value']) {
             $errors[] = "GN Nickname fehlt!";
             $items['nick']['bgrd'] = "_error";
         }
         if (!$items['login']['value']) {
             $errors[] = "Login fehlt!";
             $items['login']['bgrd'] = "_error";
         }
         if ($_POST['emailvisible']) {
             $items['emailvisible']['value'] = 1;
         } else {
             $items['emailvisible']['value'] = 0;
         }
         #optional parameters
         $items['phone']['value'] = param_str("phone", true);
         #check nickname
         if ($items['nick']['value'] && strtolower($items['nick']['value']) != strtolower($this->userdata['nick']) && getUserByNick($items['nick']['value'])) {
             $errors[] = "Nickname existiert bereits";
             $items['nick']['bgrd'] = "_error";
         }
         #check login
         if ($items['login']['value'] && strtolower($items['login']['value']) != strtolower($this->userdata['login']) && getUserByLogin($items['login']['value'])) {
             $errors[] = "Login bereits vergeben";
             $items['login']['bgrd'] = "_error";
         }
         if (!$errors) {
             #save step
             $data['usersettings'] = 1;
             $_SESSION['steps'] = $data;
             addToLogfile("Benutzereinstellungen geändert", "User", $this->userdata['uid']);
             updateUser($this->userdata['uid'], $items['nick']['value'], $items['login']['value'], $items['email']['value'], $items['emailvisible']['value'], $items['phone']['value'], $items['scantype']['value'], $items['svs']['value'], $items['timeview']['value'], $items['fleettype']['value']);
             $this->_header("user.php?action=settings&send");
         }
     } else {
         $items['login']['value'] = $this->userdata['login'];
         $items['nick']['value'] = $this->userdata['nick'];
         $items['email']['value'] = $this->userdata['email'];
         $items['emailvisible']['value'] = $this->userdata['emailvisible'];
         $items['phone']['value'] = $this->userdata['phone'];
         $items['scantype']['value'] = $this->userdata['scantype'];
         $items['svs']['value'] = $this->userdata['svs'];
         $items['timeview']['value'] = $this->userdata['timeview'];
         $items['fleettype']['value'] = $this->userdata['fleettype'];
     }
     if (!$items['phone']['value']) {
         $items['phone']['bgrd'] = "_optional";
     }
     $this->template->assign("scantype" . $items['scantype']['value'], "checked");
     $this->template->assign("timeview" . $items['timeview']['value'], "checked");
     $this->template->assign("fleettype" . $items['fleettype']['value'], "checked");
     $this->template->assign("errors", $errors);
     $this->template->assign("items", $items);
     $this->show('user_settings_form', "Benutzerdaten &auml;ndern");
 }