Example #1
0
 function _Comment_delete()
 {
     if (!$this->userdata['rights']['news']) {
         $this->_header("index.php");
     }
     $data = $_SESSION['steps'];
     $nid = param_num("nid");
     $cid = param_num("cid");
     #information message, step 2
     if ($data['deletecom']) {
         #save step
         unset($data['deletecom']);
         $_SESSION['steps'] = $data;
         $this->forms['information']['url'] = $this->backtracking->backlink();
         $this->forms['information']['action'] = "comments";
         $this->forms['information']['title'] = "Kommentar löschen";
         $this->forms['information']['message'] = "Kommentar erfolgreich gelöscht";
         $this->forms['information']['style'] = "green";
         $this->show('message_information', "Kommentar löschen");
     }
     if (!$cid) {
         $this->_header($this->backtracking->backlink());
     }
     $return = getNewsComment($cid);
     if (!$return) {
         $this->_header($this->backtracking->backlink());
     }
     $newsdata = getNews($nid);
     if (!$newsdata) {
         $this->_header($this->backtracking->backlink());
     }
     #deletecom, send
     if ($_REQUEST['send']) {
         if ($_REQUEST['yes_x']) {
             addToLogfile("Kommentar bei <b>" . $newsdata['title'] . "</b> gelöscht", "News", $this->userdata['uid']);
             deleteNewsCom($return['cid']);
             #save step
             $data['deletecom'] = 1;
             $_SESSION['steps'] = $data;
             $this->_header("index.php?action=deletecom&nid=" . $nid . "&send");
         } else {
             $this->_header($this->backtracking->backlink());
         }
     } else {
         $this->forms['information']['url'] = "index.php?nid={$nid}&cid={$cid}";
         $this->forms['information']['action'] = "deletecom";
         $this->forms['information']['title'] = "Kommentar löschen";
         $this->forms['information']['message'] = "Kommentar löschen ? <br><br>" . formatTextData($return['content']);
         $this->forms['information']['style'] = "black";
         $this->show('message_question', "Kommentar löschen");
     }
 }
Example #2
0
 function _logoutUser()
 {
     addToLogfile("Logout", "Login/Logout", $this->userdata['uid']);
     deleteUserOnline($this->userdata['uid']);
     unset($_SESSION['sessionuserdata']);
     setcookie('menuitems');
     $this->_header("index.php");
     exit;
 }
Example #3
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");
     }
 }
Example #4
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");
 }