Subversion Repositories personal-webbase

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgef&uuml;hrt werden.');
  4.  
  5. if ($aktion == 'edit')
  6. {
  7.         if (!url_protokoll_vorhanden($fserver)) $url = 'https://'.$fserver;
  8.  
  9.         $res = db_query("SELECT `user_cnid` FROM `".$WBConfig->getMySQLPrefix()."folders` WHERE `id` = '".db_escape($folder)."'");
  10.         $row = db_fetch($res);
  11.         if ($row['user_cnid'] != $benutzer['id'])
  12.                 $folder = 0;
  13.  
  14.         db_query("UPDATE `".$WBConfig->getMySQLPrefix()."confixx` SET `folder_cnid` = '".db_escape($folder)."', `server` = '".db_escape($fserver)."', `username` = '".db_escape($fusername)."', `password` = '".db_escape($fpassword)."' WHERE `id` = '".db_escape($id)."' AND `user_cnid` = '".$benutzer['id']."'");
  15.         if ($danach == 'A') wb_redirect_now($_SERVER['PHP_SELF'].'?seite=main&modul='.$modul);
  16.         if ($danach == 'B') wb_redirect_now($_SERVER['PHP_SELF'].'?seite=edit&modul='.$modul.'&aktion=new&danach='.$danach);
  17.         if ($danach == 'C') wb_redirect_now($_SERVER['PHP_SELF'].'?seite=edit&modul='.$modul.'&aktion=new&folder='.$folder.'&danach='.$danach);
  18. }
  19.  
  20. if ($aktion == 'new')
  21. {
  22.         if (!url_protokoll_vorhanden($fserver)) $url = 'https://'.$fserver;
  23.  
  24.         $res = db_query("SELECT `user_cnid` FROM `".$WBConfig->getMySQLPrefix()."folders` WHERE `id` = '".db_escape($folder)."'");
  25.         $row = db_fetch($res);
  26.         if ($row['user_cnid'] != $benutzer['id'])
  27.                 $folder = 0;
  28.  
  29.         db_query("INSERT INTO `".$WBConfig->getMySQLPrefix()."confixx` (`folder_cnid`, `server`, `username`, `password`, `user_cnid`) VALUES ('".db_escape($folder)."', '".db_escape($fserver)."', '".db_escape($fusername)."', '".db_escape($fpassword)."', '".$benutzer['id']."')");
  30.         if ($danach == 'A') wb_redirect_now($_SERVER['PHP_SELF'].'?seite=main&modul='.$modul);
  31.         if ($danach == 'B') wb_redirect_now($_SERVER['PHP_SELF'].'?seite=edit&modul='.$modul.'&aktion=new&danach='.$danach);
  32.         if ($danach == 'C') wb_redirect_now($_SERVER['PHP_SELF'].'?seite=edit&modul='.$modul.'&aktion=new&folder='.$folder.'&danach='.$danach);
  33. }
  34.  
  35. if ($aktion == 'delete')
  36. {
  37.         db_query("DELETE FROM `".$WBConfig->getMySQLPrefix()."confixx` WHERE `id` = '".db_escape($id)."' AND `user_cnid` = '".$benutzer['id']."'");
  38.         if (db_affected_rows() > 0)
  39.                 db_query("OPTIMIZE TABLE `".$WBConfig->getMySQLPrefix()."confixx`");
  40.  
  41.         wb_redirect_now($_SERVER['PHP_SELF'].'?seite=main&modul='.$modul);
  42. }
  43.  
  44. ?>