From d194783e8f2aa2e9e27e34572cda6f796930ac37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Wed, 14 Sep 2011 22:54:36 +0200 Subject: [PATCH] cleanup from old files --- includes_old/error_handler.php | 125 -- includes_old/funktion_SendMessenges.php | 14 - includes_old/funktion_cron.php | 131 -- includes_old/funktion_db.php | 145 -- includes_old/funktion_db_list.php | 62 - includes_old/funktion_jabber.php | 1853 ------------------ includes_old/funktion_modem.php | 34 - includes_old/funktion_schichtplan_beamer.php | 180 -- includes_old/header.php | 102 - www-ssl_old/ShowUserPicture.php | 56 - www-ssl_old/admin/UserPicture.php | 132 -- www-ssl_old/admin/aktiv.php | 105 - www-ssl_old/admin/dect.php | 69 - www-ssl_old/admin/free.php | 98 - www-ssl_old/admin/free_DECT.php | 65 - www-ssl_old/admin/schichtplan.1.php | 5 - www-ssl_old/admin/schichtplan.php | 362 ---- www-ssl_old/admin/schichtplan_druck.1.php | 5 - www-ssl_old/admin/schichtplan_druck.php | 119 -- www-ssl_old/admin/shiftadd.php | 350 ---- www-ssl_old/admin/tshirt.php | 62 - www-ssl_old/admin/userArrived.php | 53 - www-ssl_old/nonpublic/myschichtplan_ical.php | 51 - www-ssl_old/nonpublic/schichtplan.1.php | 20 - www-ssl_old/nonpublic/schichtplan.2.php | 22 - www-ssl_old/nonpublic/schichtplan.php | 220 --- www-ssl_old/nonpublic/schichtplan_beamer.php | 59 - 27 files changed, 4499 deletions(-) delete mode 100644 includes_old/error_handler.php delete mode 100644 includes_old/funktion_SendMessenges.php delete mode 100644 includes_old/funktion_cron.php delete mode 100644 includes_old/funktion_db.php delete mode 100644 includes_old/funktion_db_list.php delete mode 100644 includes_old/funktion_jabber.php delete mode 100644 includes_old/funktion_modem.php delete mode 100644 includes_old/funktion_schichtplan_beamer.php delete mode 100644 includes_old/header.php delete mode 100644 www-ssl_old/ShowUserPicture.php delete mode 100644 www-ssl_old/admin/UserPicture.php delete mode 100644 www-ssl_old/admin/aktiv.php delete mode 100644 www-ssl_old/admin/dect.php delete mode 100644 www-ssl_old/admin/free.php delete mode 100644 www-ssl_old/admin/free_DECT.php delete mode 100644 www-ssl_old/admin/schichtplan.1.php delete mode 100644 www-ssl_old/admin/schichtplan.php delete mode 100644 www-ssl_old/admin/schichtplan_druck.1.php delete mode 100644 www-ssl_old/admin/schichtplan_druck.php delete mode 100644 www-ssl_old/admin/shiftadd.php delete mode 100644 www-ssl_old/admin/tshirt.php delete mode 100644 www-ssl_old/admin/userArrived.php delete mode 100644 www-ssl_old/nonpublic/myschichtplan_ical.php delete mode 100644 www-ssl_old/nonpublic/schichtplan.1.php delete mode 100644 www-ssl_old/nonpublic/schichtplan.2.php delete mode 100644 www-ssl_old/nonpublic/schichtplan.php delete mode 100644 www-ssl_old/nonpublic/schichtplan_beamer.php diff --git a/includes_old/error_handler.php b/includes_old/error_handler.php deleted file mode 100644 index 42e561fc..00000000 --- a/includes_old/error_handler.php +++ /dev/null @@ -1,125 +0,0 @@ - $v) - if((strpos( "0$k", "sql") > 0) || (strpos( "0$k", "SQL") > 0)) - $Temp .= "Error Context: $k = $v\n"; - - if((strpos( "0$error_string", "MySQL") > 0)) - $Temp .= "Error MySQL: ". mysql_error($con). "\n"; - - // Uebergeben des arrays - array_push($error_messages, "Error Number: " . $error_number . "\n". - "Error String: " . $error_string . "\n". - "Error File: " . $error_file . "\n". - "Error Line: " . $error_line . "\n". - (strlen($Temp)? "$Temp": "")); - } - - // register error handler - set_error_handler("Error_Handler"); - - error_reporting(E_ALL); - - if($debug) { - ini_set("display_errors", "On"); - ini_set("display_startup_errors", "On"); - ini_set("html_errors", "On"); - } - - // send errors - function send_errors() { - global $error_messages; - - if(!$error_messages) - return; - - $message = ""; - foreach($error_messages as $value) - $message .= $value."\n"; - - $message .= "\n"; - - if(isset($_POST)) { - foreach ($_POST as $k => $v) - $message .= "_POST: $k = ". ( $k!="password"? $v : "???..."). "\n"; - - $message .= "\n"; - } - - if(isset($_GET)) { - foreach ($_GET as $k => $v) - $message .= "_GET: $k = $v\n"; - - $message .= "\n"; - } - - $message .= "\n\n"; - - if( isset( $_SESSION)) - { - foreach ($_SESSION as $k => $v ) - $message .= "_SESSION: $k = $v\n"; - $message .= "\n"; - } - - if( isset( $_SESSION['CVS'])) - { - foreach ($_SESSION['CVS'] as $k => $v ) - if( strlen($k)>3 ) - $message .= "_SESSION['CVS']: $k = $v\n"; - $message .= "\n"; - } - - foreach ($_SERVER as $k => $v ) - if( strpos( "0$k", "SERVER_")==0) - $message .= "_SERVER: $k = $v\n"; - - send_message($message); - - // display error messages on screen too for developers - if ($_SESSION['CVS']['admin/debug.php']=='Y') - { - echo "
\n".$message."
"; - } - -} - - register_shutdown_function("send_errors"); - - // send jabber message and email - function send_message(&$message) - { - chdir(dirname(__FILE__)); - require_once('../config/config_jabber.php'); - - if (isset($jabber_recipient) && count($jabber_recipient)) { - $jabber = new Jabber($server, $port, $username, $password, $resource); - if ($jabber->Connect() && $jabber->SendAuth()) { - foreach($jabber_recipient as $value) - { - $jabber->SendMessage($value, "normal", NULL, array("body" => $message, "subject" => "Error in Pentabarf"), NULL); - } - $jabber->Disconnect(); - } else { - array_push($message, "Couldn't connect to Jabber Server."); - } - } - - if (isset($mail_recipient) && count($mail_recipient)) { - foreach($mail_recipient as $to) { - mail($to, isset($mail_subject) ? $mail_subject : "Pentabarf Error", $message); - } - } - } - -?> diff --git a/includes_old/funktion_SendMessenges.php b/includes_old/funktion_SendMessenges.php deleted file mode 100644 index b6de67cc..00000000 --- a/includes_old/funktion_SendMessenges.php +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/includes_old/funktion_cron.php b/includes_old/funktion_cron.php deleted file mode 100644 index 3a0e984b..00000000 --- a/includes_old/funktion_cron.php +++ /dev/null @@ -1,131 +0,0 @@ - $v) { - $o.= "$k=" . urlencode(utf8_encode($v)) . "&"; - } - - $post_data = substr($o, 0, -1); - - $ch = curl_init(); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - $result = curl_exec($ch); - echo curl_error($ch); - curl_close($ch); - } else { - // IAX file Schareiebn - $CallFile = $Tempdir. "/call_". date("Ymd_His"). "_$DECTnumber"; - - if($DebugDECT) - echo "IAX create file for dialing Number $DECTnumber\n"; - - $file = fopen( $CallFile, 'w'); - - if($file != false) { - fputs($file, "Channel: SIP/$DECTnumber@$IAXserver\n"); - fputs($file, "Callerid: Engelserver\n"); - fputs($file, "Extension: s\n"); - fputs($file, "MaxRetries: 1\n"); - fputs($file, "RetryTime: 10\n"); - fputs($file, "SetVar: msg=$Message\n"); - fclose($file); - system("chmod 777 " . $CallFile); - system("mv " . $CallFile . " " . $AsteriskOutputDir); - } else - echo "error: $CallFile not created"; - } - } else - if($DebugDECT) - echo "IAX is disable\n"; - } - - function DialNumberModem($DECTnumber, $Time) { - global $AnrufDelay; - - // Parameter verarbeiten - $TimeH = substr($Time, 11, 2); - $TimeM = substr($Time, 14, 2); - $TimeM = substr($Time, 14, 2) + $AnrufDelay; - - if($TimeM < 0) { - $TimeM += 60; - $TimeH -= 1; - } - - if($TimeH < 0) - $TimeH += 24; - - if(strlen( $TimeH) == 1) - $TimeH = "0" . $TimeH; - - SetWackeup($DECTnumber, $TimeH, $TimeM); - } -?> diff --git a/includes_old/funktion_db.php b/includes_old/funktion_db.php deleted file mode 100644 index ffd7d6a2..00000000 --- a/includes_old/funktion_db.php +++ /dev/null @@ -1,145 +0,0 @@ -"; - $Diff .= ""; - - for ($m = 0 ; $m < $Anzahl_Felder ; $m++) - $Diff .= "". mysql_field_name($Erg, $m). ""; - - $Diff .= ""; - - for ($n = 0 ; $n < $Zeilen ; $n++) { - $Diff .= ""; - - for ($m = 0 ; $m < $Anzahl_Felder ; $m++) - $Diff .= "".mysql_result($Erg, $n, $m). ""; - - $Diff .= ""; - } - - $Diff .= ""; - return $Diff; - } - - function db_querry_getDatenAssocArray($SQL) { - global $con; - - $Erg = mysql_query($SQL, $con); - echo mysql_error($con); - - $Daten = array(); - - for( $i=0; $i $Data1) { - if(isset( $Daten2[$DataKey])) { - $Data2 = $Daten2[$DataKey]; - - foreach($Data1 as $key => $value) - if( $value != $Data2[$key]) { - $Gefunden = true; - $Diff .= "\n$key\n$value\n" . $Data2[$key] . "\n"; - } - } else - foreach($Data1 as $key => $value) { - $Gefunden = true; - $Diff .= "\n$key\n$value\n\n"; - } - } - - $Diff .= "\n"; - - if($Gefunden) - return $Diff; - else - return "\nno changes Fount\n"; - } - - function db_query( $SQL, $comment) { - global $con, $Page; - $Diff = ""; - - // commed anlyse udn daten sicherung - if(strpos("#$SQL", "UPDATE") > 0) { - // Tabellen name ermitteln - $Table_Start = strpos( $SQL, "`"); - $Table_End = strpos( $SQL, "`", $Table_Start+1); - $Table = substr( $SQL, $Table_Start, ($Table_End-$Table_Start+1)); - - //SecureTest - if( $Table_Start == 0 || $Table_End == 0) die("

funktion_db ERROR SQL: '$SQL' nicht OK

"); - - //WHERE ermitteln - $Where_Start = strpos( $SQL, "WHERE"); - $Where = substr( $SQL, $Where_Start); - if( $Where_Start == 0) $Where = ";"; - - if( strlen( $Where) < 2) - { - $Diff = "can't show, too mutch data (no filter was set)"; - $querry_erg = mysql_query($SQL, $con); - } - else - { - $Daten1 = db_querry_getDatenAssocArray( "SELECT * FROM $Table $Where"); - $querry_erg = mysql_query($SQL, $con); - $Daten2 = db_querry_getDatenAssocArray( "SELECT * FROM $Table $Where"); - $Diff = db_querry_diffDaten($Daten1, $Daten2); - } - } - elseif( strpos( "#$SQL", "DELETE") > 0) - { - $TableWhere = substr( $SQL, 6); - $Diff .= Ausgabe_Daten( "SELECT * $TableWhere"); - - //execute command - $querry_erg = mysql_query($SQL, $con); - } - elseif( strpos( "#$SQL", "INSERT") > 0) - { - //execute command - $querry_erg = mysql_query($SQL, $con); - } - else - { - //execute command - $querry_erg = mysql_query($SQL, $con); - } - - $SQLCommand = "SQL:
". htmlentities( $SQL, ENT_QUOTES); - if( strlen($Diff) > 0) - $SQLCommand .= "

Diff:
$Diff"; - - $Commend = htmlentities( ($Page["Name"]. ": ". $comment), ENT_QUOTES); - //LOG commands in DB - $SQL_SEC = "INSERT INTO `ChangeLog` ( `UID` , `SQLCommad` , `Commend` ) ". - " VALUES ( '". $_SESSION['UID']. "', ". - "'". mysql_escape_string( $SQLCommand). "', ". - "'". mysql_escape_string( $Commend). "' );"; - $erg = mysql_query($SQL_SEC, $con); - echo mysql_error($con); - return $querry_erg; - }//function db_query( -} - -?> diff --git a/includes_old/funktion_db_list.php b/includes_old/funktion_db_list.php deleted file mode 100644 index 35bb7255..00000000 --- a/includes_old/funktion_db_list.php +++ /dev/null @@ -1,62 +0,0 @@ -"; - $html .= "DB: $Table_Name"; - - $html .= ""; - for ($m = 0; $m < $Anzahl_Felder; $m++) { - $html .= "" . mysql_field_name($Erg, $m) . ""; - } - $html .= ""; - - for ($n = 0; $n < $Zeilen; $n++) { - $html .= ""; - for ($m = 0; $m < $Anzahl_Felder; $m++) { - $html .= "" . mysql_result($Erg, $n, $m) . ""; - } - $html .= ""; - } - $html .= ""; - return $html; -} - -function funktion_db_element_list_2row($TopicName, $SQL) { - $html = ""; - $html .= "\n"; - $html .= ""; - # $html .= "\n"; - - $Erg = sql_query($SQL); - - $html .= ""; - for ($m = 0; $m < mysql_num_fields($Erg); $m++) { - $html .= ""; - } - $html .= ""; - - for ($n = 0; $n < mysql_num_rows($Erg); $n++) { - $html .= ""; - for ($m = 0; $m < mysql_num_fields($Erg); $m++) { - $html .= ""; - } - $html .= ""; - } - $html .= "
$TopicName

$TopicName

" . mysql_field_name($Erg, $m) . "
" . mysql_result($Erg, $n, $m) . "
\n"; - return $html; -} -?> diff --git a/includes_old/funktion_jabber.php b/includes_old/funktion_jabber.php deleted file mode 100644 index 9c699d70..00000000 --- a/includes_old/funktion_jabber.php +++ /dev/null @@ -1,1853 +0,0 @@ -server = $server; - $this->port = $port; - - $this->username = $username; - $this->password = $password; - $this->resource = $resource; - - $this->enable_logging = FALSE; - $this->log_array = array(); - $this->log_filename = ''; - $this->log_filehandler = FALSE; - - $this->packet_queue = array(); - $this->subscription_queue = array(); - - $this->iq_sleep_timer = 1; - $this->delay_disconnect = 1; - - $this->returned_keep_alive = TRUE; - $this->txnid = 0; - - $this->iq_version_name = "Class.Jabber.PHP -- http://cjphp.netflint.net -- by Nathan 'Fritzy' Fritz, fritz@netflint.net"; - $this->iq_version_version = "0.4"; - $this->iq_version_os = $_SERVER['SERVER_SOFTWARE']; - - $this->connection_class = "CJP_StandardConnector"; - - $this->error_codes = array(400 => "Bad Request", - 401 => "Unauthorized", - 402 => "Payment Required", - 403 => "Forbidden", - 404 => "Not Found", - 405 => "Not Allowed", - 406 => "Not Acceptable", - 407 => "Registration Required", - 408 => "Request Timeout", - 409 => "Conflict", - 500 => "Internal Server Error", - 501 => "Not Implemented", - 502 => "Remove Server Error", - 503 => "Service Unavailable", - 504 => "Remove Server Timeout", - 510 => "Disconnected"); - } - - - - function Connect() - { - $this->_create_logfile(); - - $this->CONNECTOR = new $this->connection_class; - - if ($this->CONNECTOR->OpenSocket($this->server, $this->port)) - { - $this->SendPacket("\n"); - $this->SendPacket("\n"); - - sleep(2); - - if ($this->_check_connected()) - { - $this->connected = TRUE; // Nathan Fritz - return TRUE; - } - else - { - $this->AddToLog("ERROR: Connect() #1"); - return FALSE; - } - } - else - { - $this->AddToLog("ERROR: Connect() #2"); - return FALSE; - } - } - - - - function Disconnect() - { - if (is_int($this->delay_disconnect)) - { - sleep($this->delay_disconnect); - } - - $this->SendPacket(""); - $this->CONNECTOR->CloseSocket(); - - $this->_close_logfile(); - $this->PrintLog(); - } - - - - function SendAuth() - { - $this->auth_id = "auth_" . md5(time() . $_SERVER['REMOTE_ADDR']); - - $this->resource = ($this->resource != NULL) ? $this->resource : ("Class.Jabber.PHP " . md5($this->auth_id)); - $this->jid = "{$this->username}@{$this->server}/{$this->resource}"; - - // request available authentication methods - $payload = "{$this->username}"; - $packet = $this->SendIq(NULL, 'get', $this->auth_id, "jabber:iq:auth", $payload); - - // was a result returned? - if ($this->GetInfoFromIqType($packet) == 'result' && $this->GetInfoFromIqId($packet) == $this->auth_id) - { - // yes, now check for auth method availability in descending order (best to worst) - - if (!function_exists('mhash')) - { - $this->AddToLog("ATTENTION: SendAuth() - mhash() is not available; screw 0k and digest method, we need to go with plaintext auth"); - } - - // auth_0k - if (function_exists('mhash') && isset($packet['iq']['#']['query'][0]['#']['sequence'][0]["#"]) && isset($packet['iq']['#']['query'][0]['#']['token'][0]["#"])) - { - return $this->_sendauth_0k($packet['iq']['#']['query'][0]['#']['token'][0]["#"], $packet['iq']['#']['query'][0]['#']['sequence'][0]["#"]); - } - // digest - elseif (function_exists('mhash') && isset($packet['iq']['#']['query'][0]['#']['digest'])) - { - return $this->_sendauth_digest(); - } - // plain text - elseif ($packet['iq']['#']['query'][0]['#']['password']) - { - return $this->_sendauth_plaintext(); - } - // dude, you're fucked - { - $this->AddToLog("ERROR: SendAuth() #2 - No auth method available!"); - return FALSE; - } - } - else - { - // no result returned - $this->AddToLog("ERROR: SendAuth() #1"); - return FALSE; - } - } - - - - function AccountRegistration($reg_email = NULL, $reg_name = NULL) - { - $packet = $this->SendIq($this->server, 'get', 'reg_01', 'jabber:iq:register'); - - if ($packet) - { - $key = $this->GetInfoFromIqKey($packet); // just in case a key was passed back from the server - unset($packet); - - $payload = "{$this->username} - {$this->password} - $reg_email - $reg_name\n"; - - $payload .= ($key) ? "$key\n" : ''; - - $packet = $this->SendIq($this->server, 'set', "reg_01", "jabber:iq:register", $payload); - - if ($this->GetInfoFromIqType($packet) == 'result') - { - if (isset($packet['iq']['#']['query'][0]['#']['registered'][0]['#'])) - { - $return_code = 1; - } - else - { - $return_code = 2; - } - - if ($this->resource) - { - $this->jid = "{$this->username}@{$this->server}/{$this->resource}"; - } - else - { - $this->jid = "{$this->username}@{$this->server}"; - } - - } - elseif ($this->GetInfoFromIqType($packet) == 'error' && isset($packet['iq']['#']['error'][0]['#'])) - { - // "conflict" error, i.e. already registered - if ($packet['iq']['#']['error'][0]['@']['code'] == '409') - { - $return_code = 1; - } - else - { - $return_code = "Error " . $packet['iq']['#']['error'][0]['@']['code'] . ": " . $packet['iq']['#']['error'][0]['#']; - } - } - - return $return_code; - - } - else - { - return 3; - } - } - - - - function SendPacket($xml) - { - $xml = trim($xml); - - if ($this->CONNECTOR->WriteToSocket($xml)) - { - $this->AddToLog("SEND: $xml"); - return TRUE; - } - else - { - $this->AddToLog('ERROR: SendPacket() #1'); - return FALSE; - } - } - - - - function Listen() - { - $incoming = ""; - - while ($line = $this->CONNECTOR->ReadFromSocket(4096)) - { - $incoming .= $line; - } - - $incoming = trim($incoming); - - if ($incoming != "") - { - $this->AddToLog("RECV: $incoming"); - } - - if ($incoming != "") - { - $temp = $this->_split_incoming($incoming); - - for ($a = 0; $a < count($temp); $a++) - { - $this->packet_queue[] = $this->xmlize($temp[$a]); - } - } - - return TRUE; - } - - - - function StripJID($jid = NULL) - { - preg_match("/(.*)\/(.*)/Ui", $jid, $temp); - return ($temp[1] != "") ? $temp[1] : $jid; - } - - - - function SendMessage($to, $type = "normal", $id = NULL, $content = NULL, $payload = NULL) - { - if ($to && is_array($content)) - { - if (!$id) - { - $id = $type . "_" . time(); - } - - $content = $this->_array_htmlspecialchars($content); - - $xml = "\n"; - - if (isset($content['subject'])) - { - $xml .= "" . $content['subject'] . "\n"; - } - - if (isset($content['thread'])) - { - $xml .= "" . $content['thread'] . "\n"; - } - - $xml .= "" . $content['body'] . "\n"; - $xml .= $payload; - $xml .= "\n"; - - - if ($this->SendPacket($xml)) - { - return TRUE; - } - else - { - $this->AddToLog("ERROR: SendMessage() #1"); - return FALSE; - } - } - else - { - $this->AddToLog("ERROR: SendMessage() #2"); - return FALSE; - } - } - - - - function SendPresence($type = NULL, $to = NULL, $status = NULL, $show = NULL, $priority = NULL) - { - $xml = "\n" : " />\n"; - - $xml .= ($status) ? " $status\n" : ''; - $xml .= ($show) ? " $show\n" : ''; - $xml .= ($priority) ? " $priority\n" : ''; - - $xml .= ($status || $show || $priority) ? "\n" : ''; - - if ($this->SendPacket($xml)) - { - return TRUE; - } - else - { - $this->AddToLog("ERROR: SendPresence() #1"); - return FALSE; - } - } - - - - function SendError($to, $id = NULL, $error_number, $error_message = NULL) - { - $xml = "error_codes[$error_number]; - $xml .= "\n"; - $xml .= ""; - - $this->SendPacket($xml); - } - - - - function RosterUpdate() - { - $roster_request_id = "roster_" . time(); - - $incoming_array = $this->SendIq(NULL, 'get', $roster_request_id, "jabber:iq:roster"); - - if (is_array($incoming_array)) - { - if ($incoming_array['iq']['@']['type'] == 'result' - && $incoming_array['iq']['@']['id'] == $roster_request_id - && $incoming_array['iq']['#']['query']['0']['@']['xmlns'] == "jabber:iq:roster") - { - $number_of_contacts = count($incoming_array['iq']['#']['query'][0]['#']['item']); - $this->roster = array(); - - for ($a = 0; $a < $number_of_contacts; $a++) - { - $this->roster[$a] = array( "jid" => strtolower($incoming_array['iq']['#']['query'][0]['#']['item'][$a]['@']['jid']), - "name" => $incoming_array['iq']['#']['query'][0]['#']['item'][$a]['@']['name'], - "subscription" => $incoming_array['iq']['#']['query'][0]['#']['item'][$a]['@']['subscription'], - "group" => $incoming_array['iq']['#']['query'][0]['#']['item'][$a]['#']['group'][0]['#'] - ); - } - - return TRUE; - } - else - { - $this->AddToLog("ERROR: RosterUpdate() #1"); - return FALSE; - } - } - else - { - $this->AddToLog("ERROR: RosterUpdate() #2"); - return FALSE; - } - } - - - - function RosterAddUser($jid = NULL, $id = NULL, $name = NULL) - { - $id = ($id) ? $id : "adduser_" . time(); - - if ($jid) - { - $payload = " SendIq(NULL, 'set', $id, "jabber:iq:roster", $payload); - - if ($this->GetInfoFromIqType($packet) == 'result') - { - $this->RosterUpdate(); - return TRUE; - } - else - { - $this->AddToLog("ERROR: RosterAddUser() #2"); - return FALSE; - } - } - else - { - $this->AddToLog("ERROR: RosterAddUser() #1"); - return FALSE; - } - } - - - - function RosterRemoveUser($jid = NULL, $id = NULL) - { - $id = ($id) ? $id : 'deluser_' . time(); - - if ($jid && $id) - { - $packet = $this->SendIq(NULL, 'set', $id, "jabber:iq:roster", ""); - - if ($this->GetInfoFromIqType($packet) == 'result') - { - $this->RosterUpdate(); - return TRUE; - } - else - { - $this->AddToLog("ERROR: RosterRemoveUser() #2"); - return FALSE; - } - } - else - { - $this->AddToLog("ERROR: RosterRemoveUser() #1"); - return FALSE; - } - } - - - - function RosterExistsJID($jid = NULL) - { - if ($jid) - { - if ($this->roster) - { - for ($a = 0; $a < count($this->roster); $a++) - { - if ($this->roster[$a]['jid'] == strtolower($jid)) - { - return $a; - } - } - } - else - { - $this->AddToLog("ERROR: RosterExistsJID() #2"); - return FALSE; - } - } - else - { - $this->AddToLog("ERROR: RosterExistsJID() #1"); - return FALSE; - } - } - - - - function GetFirstFromQueue() - { - return array_shift($this->packet_queue); - } - - - - function GetFromQueueById($packet_type, $id) - { - $found_message = FALSE; - - foreach ($this->packet_queue as $key => $value) - { - if ($value[$packet_type]['@']['id'] == $id) - { - $found_message = $value; - unset($this->packet_queue[$key]); - - break; - } - } - - return (is_array($found_message)) ? $found_message : FALSE; - } - - - - function CallHandler($packet = NULL) - { - $packet_type = $this->_get_packet_type($packet); - - if ($packet_type == "message") - { - $type = $packet['message']['@']['type']; - $type = ($type != "") ? $type : "normal"; - $funcmeth = "Handler_message_$type"; - } - elseif ($packet_type == "iq") - { - $namespace = $packet['iq']['#']['query'][0]['@']['xmlns']; - $namespace = str_replace(":", "_", $namespace); - $funcmeth = "Handler_iq_$namespace"; - } - elseif ($packet_type == "presence") - { - $type = $packet['presence']['@']['type']; - $type = ($type != "") ? $type : "available"; - $funcmeth = "Handler_presence_$type"; - } - - - if ($funcmeth != '') - { - if (function_exists($funcmeth)) - { - call_user_func($funcmeth, $packet); - } - elseif (method_exists($this, $funcmeth)) - { - call_user_func(array(&$this, $funcmeth), $packet); - } - else - { - $this->Handler_NOT_IMPLEMENTED($packet); - $this->AddToLog("ERROR: CallHandler() #1 - neither method nor function $funcmeth() available"); - } - } - } - - - - function CruiseControl($seconds = -1) - { - $count = 0; - - while ($count != $seconds) - { - $this->Listen(); - - do { - $packet = $this->GetFirstFromQueue(); - - if ($packet) { - $this->CallHandler($packet); - } - - } while (count($this->packet_queue) > 1); - - $count += 0.25; - usleep(250000); - - if ($this->last_ping_time + 180 < time()) - { - // Modified by Nathan Fritz - if ($this->returned_keep_alive == FALSE) - { - $this->connected = FALSE; - $this->AddToLog('EVENT: Disconnected'); - } - if ($this->returned_keep_alive == TRUE) - { - $this->connected = TRUE; - } - - $this->returned_keep_alive = FALSE; - $this->keep_alive_id = 'keep_alive_' . time(); - //$this->SendPacket("", 'CruiseControl'); - $this->SendPacket(""); - // ** - - $this->last_ping_time = time(); - } - } - - return TRUE; - } - - - - function SubscriptionAcceptRequest($to = NULL) - { - return ($to) ? $this->SendPresence("subscribed", $to) : FALSE; - } - - - - function SubscriptionDenyRequest($to = NULL) - { - return ($to) ? $this->SendPresence("unsubscribed", $to) : FALSE; - } - - - - function Subscribe($to = NULL) - { - return ($to) ? $this->SendPresence("subscribe", $to) : FALSE; - } - - - - function Unsubscribe($to = NULL) - { - return ($to) ? $this->SendPresence("unsubscribe", $to) : FALSE; - } - - - - function SendIq($to = NULL, $type = 'get', $id = NULL, $xmlns = NULL, $payload = NULL, $from = NULL) - { - if (!preg_match("/^(get|set|result|error)$/", $type)) - { - unset($type); - - $this->AddToLog("ERROR: SendIq() #2 - type must be 'get', 'set', 'result' or 'error'"); - return FALSE; - } - elseif ($id && $xmlns) - { - $xml = "SendPacket($xml); - sleep($this->iq_sleep_timer); - $this->Listen(); - - return (preg_match("/^(get|set)$/", $type)) ? $this->GetFromQueueById("iq", $id) : TRUE; - } - else - { - $this->AddToLog("ERROR: SendIq() #1 - to, id and xmlns are mandatory"); - return FALSE; - } - } - - - - // get the transport registration fields - // method written by Steve Blinch, http://www.blitzaffe.com - function TransportRegistrationDetails($transport) - { - $this->txnid++; - $packet = $this->SendIq($transport, 'get', "reg_{$this->txnid}", "jabber:iq:register", NULL, $this->jid); - - if ($packet) - { - $res = array(); - - foreach ($packet['iq']['#']['query'][0]['#'] as $element => $data) - { - if ($element != 'instructions' && $element != 'key') - { - $res[] = $element; - } - } - - return $res; - } - else - { - return 3; - } - } - - - - // register with the transport - // method written by Steve Blinch, http://www.blitzaffe.com - function TransportRegistration($transport, $details) - { - $this->txnid++; - $packet = $this->SendIq($transport, 'get', "reg_{$this->txnid}", "jabber:iq:register", NULL, $this->jid); - - if ($packet) - { - $key = $this->GetInfoFromIqKey($packet); // just in case a key was passed back from the server - unset($packet); - - $payload = ($key) ? "$key\n" : ''; - foreach ($details as $element => $value) - { - $payload .= "<$element>$value\n"; - } - - $packet = $this->SendIq($transport, 'set', "reg_{$this->txnid}", "jabber:iq:register", $payload); - - if ($this->GetInfoFromIqType($packet) == 'result') - { - if (isset($packet['iq']['#']['query'][0]['#']['registered'][0]['#'])) - { - $return_code = 1; - } - else - { - $return_code = 2; - } - } - elseif ($this->GetInfoFromIqType($packet) == 'error') - { - if (isset($packet['iq']['#']['error'][0]['#'])) - { - $return_code = "Error " . $packet['iq']['#']['error'][0]['@']['code'] . ": " . $packet['iq']['#']['error'][0]['#']; - $this->AddToLog('ERROR: TransportRegistration()'); - } - } - - return $return_code; - } - else - { - return 3; - } - } - - - - function GetvCard($jid = NULL, $id = NULL) - { - if (!$id) - { - $id = "vCard_" . md5(time() . $_SERVER['REMOTE_ADDR']); - } - - if ($jid) - { - $xml = " - - "; - - $this->SendPacket($xml); - sleep($this->iq_sleep_timer); - $this->Listen(); - - return $this->GetFromQueueById("iq", $id); - } - else - { - $this->AddToLog("ERROR: GetvCard() #1 - to and id are mandatory"); - return FALSE; - } - } - - - - function PrintLog() - { - if ($this->enable_logging) - { - if ($this->log_filehandler) - { - echo "

Logging enabled, logged events have been written to the file {$this->log_filename}.

\n"; - } - else - { - echo "

Logging enabled, logged events below:

\n"; - echo "
\n";
-        echo (count($this->log_array) > 0) ? implode("\n\n\n", $this->log_array) : "No logged events.";
-        echo "
\n"; - } - } - } - - - - // ====================================================================== - // private methods - // ====================================================================== - - - - function _sendauth_0k($zerok_token, $zerok_sequence) - { - // initial hash of password - $zerok_hash = mhash(MHASH_SHA1, $this->password); - $zerok_hash = bin2hex($zerok_hash); - - // sequence 0: hash of hashed-password and token - $zerok_hash = mhash(MHASH_SHA1, $zerok_hash . $zerok_token); - $zerok_hash = bin2hex($zerok_hash); - - // repeat as often as needed - for ($a = 0; $a < $zerok_sequence; $a++) - { - $zerok_hash = mhash(MHASH_SHA1, $zerok_hash); - $zerok_hash = bin2hex($zerok_hash); - } - - $payload = "{$this->username} - $zerok_hash - {$this->resource}"; - - $packet = $this->SendIq(NULL, 'set', $this->auth_id, "jabber:iq:auth", $payload); - - // was a result returned? - if ($this->GetInfoFromIqType($packet) == 'result' && $this->GetInfoFromIqId($packet) == $this->auth_id) - { - return TRUE; - } - else - { - $this->AddToLog("ERROR: _sendauth_0k() #1"); - return FALSE; - } - } - - - - function _sendauth_digest() - { - $payload = "{$this->username} - {$this->resource} - " . bin2hex(mhash(MHASH_SHA1, $this->stream_id . $this->password)) . ""; - - $packet = $this->SendIq(NULL, 'set', $this->auth_id, "jabber:iq:auth", $payload); - - // was a result returned? - if ($this->GetInfoFromIqType($packet) == 'result' && $this->GetInfoFromIqId($packet) == $this->auth_id) - { - return TRUE; - } - else - { - $this->AddToLog("ERROR: _sendauth_digest() #1"); - return FALSE; - } - } - - - - function _sendauth_plaintext() - { - $payload = "{$this->username} - {$this->password} - {$this->resource}"; - - $packet = $this->SendIq(NULL, 'set', $this->auth_id, "jabber:iq:auth", $payload); - - // was a result returned? - if ($this->GetInfoFromIqType($packet) == 'result' && $this->GetInfoFromIqId($packet) == $this->auth_id) - { - return TRUE; - } - else - { - $this->AddToLog("ERROR: _sendauth_plaintext() #1"); - return FALSE; - } - } - - - - function _listen_incoming() - { - $incoming = ""; - - while ($line = $this->CONNECTOR->ReadFromSocket(4096)) - { - $incoming .= $line; - } - - $incoming = trim($incoming); - - if ($incoming != "") - { - $this->AddToLog("RECV: $incoming"); - } - - return $this->xmlize($incoming); - } - - - - function _check_connected() - { - $incoming_array = $this->_listen_incoming(); - - if (is_array($incoming_array)) - { - if ($incoming_array["stream:stream"]['@']['from'] == $this->server - && $incoming_array["stream:stream"]['@']['xmlns'] == "jabber:client" - && $incoming_array["stream:stream"]['@']["xmlns:stream"] == "http://etherx.jabber.org/streams") - { - $this->stream_id = $incoming_array["stream:stream"]['@']['id']; - - return TRUE; - } - else - { - $this->AddToLog("ERROR: _check_connected() #1"); - return FALSE; - } - } - else - { - $this->AddToLog("ERROR: _check_connected() #2"); - return FALSE; - } - } - - - - function _get_packet_type($packet = NULL) - { - if (is_array($packet)) - { - reset($packet); - $packet_type = key($packet); - } - - return ($packet_type) ? $packet_type : FALSE; - } - - - - function _split_incoming($incoming) - { - $temp = preg_split("/<(message|iq|presence|stream)/", $incoming, -1, PREG_SPLIT_DELIM_CAPTURE); - $array = array(); - - for ($a = 1; $a < count($temp); $a = $a + 2) - { - $array[] = "<" . $temp[$a] . $temp[($a + 1)]; - } - - return $array; - } - - - - function _create_logfile() - { - if ($this->log_filename != '' && $this->enable_logging) - { - $this->log_filehandler = fopen($this->log_filename, 'w'); - } - } - - - - function AddToLog($string) - { - if ($this->enable_logging) - { - if ($this->log_filehandler) - { - #fwrite($this->log_filehandler, $string . "\n\n"); - print "$string \n\n"; - } - else - { - $this->log_array[] = htmlspecialchars($string); - } - } - } - - - - function _close_logfile() - { - if ($this->log_filehandler) - { - fclose($this->log_filehandler); - } - } - - - - // _array_htmlspecialchars() - // applies htmlspecialchars() to all values in an array - - function _array_htmlspecialchars($array) - { - if (is_array($array)) - { - foreach ($array as $k => $v) - { - if (is_array($v)) - { - $v = $this->_array_htmlspecialchars($v); - } - else - { - $v = htmlspecialchars($v); - } - } - } - - return $array; - } - - - - // ====================================================================== - // parsers - // ====================================================================== - - - - function GetInfoFromMessageFrom($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['@']['from'] : FALSE; - } - - - - function GetInfoFromMessageType($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['@']['type'] : FALSE; - } - - - - function GetInfoFromMessageId($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['@']['id'] : FALSE; - } - - - - function GetInfoFromMessageThread($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['#']['thread'][0]['#'] : FALSE; - } - - - - function GetInfoFromMessageSubject($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['#']['subject'][0]['#'] : FALSE; - } - - - - function GetInfoFromMessageBody($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['#']['body'][0]['#'] : FALSE; - } - - function GetInfoFromMessageXMLNS($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['#']['x'] : FALSE; - } - - - - function GetInfoFromMessageError($packet = NULL) - { - $error = preg_replace("/^\/$/", "", ($packet['message']['#']['error'][0]['@']['code'] . "/" . $packet['message']['#']['error'][0]['#'])); - return (is_array($packet)) ? $error : FALSE; - } - - - - // ====================================================================== - // parsers - // ====================================================================== - - - - function GetInfoFromIqFrom($packet = NULL) - { - return (is_array($packet)) ? $packet['iq']['@']['from'] : FALSE; - } - - - - function GetInfoFromIqType($packet = NULL) - { - return (is_array($packet)) ? $packet['iq']['@']['type'] : FALSE; - } - - - - function GetInfoFromIqId($packet = NULL) - { - return (is_array($packet)) ? $packet['iq']['@']['id'] : FALSE; - } - - - - function GetInfoFromIqKey($packet = NULL) - { - return (is_array($packet)) ? $packet['iq']['#']['query'][0]['#']['key'][0]['#'] : FALSE; - } - - - - function GetInfoFromIqError($packet = NULL) - { - $error = preg_replace("/^\/$/", "", ($packet['iq']['#']['error'][0]['@']['code'] . "/" . $packet['iq']['#']['error'][0]['#'])); - return (is_array($packet)) ? $error : FALSE; - } - - - - // ====================================================================== - // parsers - // ====================================================================== - - - - function GetInfoFromPresenceFrom($packet = NULL) - { - return (is_array($packet)) ? $packet['presence']['@']['from'] : FALSE; - } - - - - function GetInfoFromPresenceType($packet = NULL) - { - return (is_array($packet)) ? $packet['presence']['@']['type'] : FALSE; - } - - - - function GetInfoFromPresenceStatus($packet = NULL) - { - return (is_array($packet)) ? $packet['presence']['#']['status'][0]['#'] : FALSE; - } - - - - function GetInfoFromPresenceShow($packet = NULL) - { - return (is_array($packet)) ? $packet['presence']['#']['show'][0]['#'] : FALSE; - } - - - - function GetInfoFromPresencePriority($packet = NULL) - { - return (is_array($packet)) ? $packet['presence']['#']['priority'][0]['#'] : FALSE; - } - - - - // ====================================================================== - // handlers - // ====================================================================== - - - - function Handler_message_normal($packet) - { - $from = $packet['message']['@']['from']; - $this->AddToLog("EVENT: Message (type normal) from $from"); - } - - - - function Handler_message_chat($packet) - { - $from = $packet['message']['@']['from']; - $this->AddToLog("EVENT: Message (type chat) from $from"); - } - - - - function Handler_message_groupchat($packet) - { - $from = $packet['message']['@']['from']; - $this->AddToLog("EVENT: Message (type groupchat) from $from"); - } - - - - function Handler_message_headline($packet) - { - $from = $packet['message']['@']['from']; - $this->AddToLog("EVENT: Message (type headline) from $from"); - } - - - - function Handler_message_error($packet) - { - $from = $packet['message']['@']['from']; - $this->AddToLog("EVENT: Message (type error) from $from"); - } - - - - // ====================================================================== - // handlers - // ====================================================================== - - - - // application version updates - function Handler_iq_jabber_iq_autoupdate($packet) - { - $from = $this->GetInfoFromIqFrom($packet); - $id = $this->GetInfoFromIqId($packet); - - $this->SendError($from, $id, 501); - $this->AddToLog("EVENT: jabber:iq:autoupdate from $from"); - } - - - - // interactive server component properties - function Handler_iq_jabber_iq_agent($packet) - { - $from = $this->GetInfoFromIqFrom($packet); - $id = $this->GetInfoFromIqId($packet); - - $this->SendError($from, $id, 501); - $this->AddToLog("EVENT: jabber:iq:agent from $from"); - } - - - - // method to query interactive server components - function Handler_iq_jabber_iq_agents($packet) - { - $from = $this->GetInfoFromIqFrom($packet); - $id = $this->GetInfoFromIqId($packet); - - $this->SendError($from, $id, 501); - $this->AddToLog("EVENT: jabber:iq:agents from $from"); - } - - - - // simple client authentication - function Handler_iq_jabber_iq_auth($packet) - { - $from = $this->GetInfoFromIqFrom($packet); - $id = $this->GetInfoFromIqId($packet); - - $this->SendError($from, $id, 501); - $this->AddToLog("EVENT: jabber:iq:auth from $from"); - } - - - - // out of band data - function Handler_iq_jabber_iq_oob($packet) - { - $from = $this->GetInfoFromIqFrom($packet); - $id = $this->GetInfoFromIqId($packet); - - $this->SendError($from, $id, 501); - $this->AddToLog("EVENT: jabber:iq:oob from $from"); - } - - - - // method to store private data on the server - function Handler_iq_jabber_iq_private($packet) - { - $from = $this->GetInfoFromIqFrom($packet); - $id = $this->GetInfoFromIqId($packet); - - $this->SendError($from, $id, 501); - $this->AddToLog("EVENT: jabber:iq:private from $from"); - } - - - - // method for interactive registration - function Handler_iq_jabber_iq_register($packet) - { - $from = $this->GetInfoFromIqFrom($packet); - $id = $this->GetInfoFromIqId($packet); - - $this->SendError($from, $id, 501); - $this->AddToLog("EVENT: jabber:iq:register from $from"); - } - - - - // client roster management - function Handler_iq_jabber_iq_roster($packet) - { - $from = $this->GetInfoFromIqFrom($packet); - $id = $this->GetInfoFromIqId($packet); - - $this->SendError($from, $id, 501); - $this->AddToLog("EVENT: jabber:iq:roster from $from"); - } - - - - // method for searching a user database - function Handler_iq_jabber_iq_search($packet) - { - $from = $this->GetInfoFromIqFrom($packet); - $id = $this->GetInfoFromIqId($packet); - - $this->SendError($from, $id, 501); - $this->AddToLog("EVENT: jabber:iq:search from $from"); - } - - - - // method for requesting the current time - function Handler_iq_jabber_iq_time($packet) - { - if ($this->keep_alive_id == $this->GetInfoFromIqId($packet)) - { - $this->returned_keep_alive = TRUE; - $this->connected = TRUE; - $this->AddToLog('EVENT: Keep-Alive returned, connection alive.'); - } - $type = $this->GetInfoFromIqType($packet); - $from = $this->GetInfoFromIqFrom($packet); - $id = $this->GetInfoFromIqId($packet); - $id = ($id != "") ? $id : "time_" . time(); - - if ($type == 'get') - { - $payload = "" . gmdate("Ydm\TH:i:s") . " - " . date("T") . " - " . date("Y/d/m h:i:s A") . ""; - - $this->SendIq($from, 'result', $id, "jabber:iq:time", $payload); - } - - $this->AddToLog("EVENT: jabber:iq:time (type $type) from $from"); - } - - - - // method for requesting version - function Handler_iq_jabber_iq_version($packet) - { - $type = $this->GetInfoFromIqType($packet); - $from = $this->GetInfoFromIqFrom($packet); - $id = $this->GetInfoFromIqId($packet); - $id = ($id != "") ? $id : "version_" . time(); - - if ($type == 'get') - { - $payload = "{$this->iq_version_name} - {$this->iq_version_os} - {$this->iq_version_version}"; - - #$this->SendIq($from, 'result', $id, "jabber:iq:version", $payload); - } - - $this->AddToLog("EVENT: jabber:iq:version (type $type) from $from -- DISABLED"); - } - - - - // keepalive method, added by Nathan Fritz - /* - function Handler_jabber_iq_time($packet) - { - if ($this->keep_alive_id == $this->GetInfoFromIqId($packet)) - { - $this->returned_keep_alive = TRUE; - $this->connected = TRUE; - $this->AddToLog('EVENT: Keep-Alive returned, connection alive.'); - } - } - */ - - - // ====================================================================== - // handlers - // ====================================================================== - - - - function Handler_presence_available($packet) - { - $from = $this->GetInfoFromPresenceFrom($packet); - - $show_status = $this->GetInfoFromPresenceStatus($packet) . " / " . $this->GetInfoFromPresenceShow($packet); - $show_status = ($show_status != " / ") ? " ($addendum)" : ''; - - $this->AddToLog("EVENT: Presence (type: available) - $from is available $show_status"); - } - - - - function Handler_presence_unavailable($packet) - { - $from = $this->GetInfoFromPresenceFrom($packet); - - $show_status = $this->GetInfoFromPresenceStatus($packet) . " / " . $this->GetInfoFromPresenceShow($packet); - $show_status = ($show_status != " / ") ? " ($addendum)" : ''; - - $this->AddToLog("EVENT: Presence (type: unavailable) - $from is unavailable $show_status"); - } - - - - function Handler_presence_subscribe($packet) - { - $from = $this->GetInfoFromPresenceFrom($packet); - $this->SubscriptionAcceptRequest($from); - $this->RosterUpdate(); - - $this->log_array[] = "Presence: (type: subscribe) - Subscription request from $from, was added to \$this->subscription_queue, roster updated"; - } - - - - function Handler_presence_subscribed($packet) - { - $from = $this->GetInfoFromPresenceFrom($packet); - $this->RosterUpdate(); - - $this->AddToLog("EVENT: Presence (type: subscribed) - Subscription allowed by $from, roster updated"); - } - - - - function Handler_presence_unsubscribe($packet) - { - $from = $this->GetInfoFromPresenceFrom($packet); - $this->SendPresence("unsubscribed", $from); - $this->RosterUpdate(); - - $this->AddToLog("EVENT: Presence (type: unsubscribe) - Request to unsubscribe from $from, was automatically approved, roster updated"); - } - - - - function Handler_presence_unsubscribed($packet) - { - $from = $this->GetInfoFromPresenceFrom($packet); - $this->RosterUpdate(); - - $this->AddToLog("EVENT: Presence (type: unsubscribed) - Unsubscribed from $from's presence"); - } - - - - // Added By Nathan Fritz - function Handler_presence_error($packet) - { - $from = $this->GetInfoFromPresenceFrom($packet); - $this->AddToLog("EVENT: Presence (type: error) - Error in $from's presence"); - } - - - - // ====================================================================== - // Generic handlers - // ====================================================================== - - - - // Generic handler for unsupported requests - function Handler_NOT_IMPLEMENTED($packet) - { - $packet_type = $this->_get_packet_type($packet); - $from = call_user_func(array(&$this, "GetInfoFrom" . ucfirst($packet_type) . "From"), $packet); - $id = call_user_func(array(&$this, "GetInfoFrom" . ucfirst($packet_type) . "Id"), $packet); - - $this->SendError($from, $id, 501); - $this->AddToLog("EVENT: Unrecognized <$packet_type/> from $from"); - } - - - - // ====================================================================== - // Third party code - // m@d pr0ps to the coders ;) - // ====================================================================== - - - - // xmlize() - // (c) Hans Anderson / http://www.hansanderson.com/php/xml/ - - function xmlize($data) - { - $vals = $index = $array = array(); - $parser = xml_parser_create('utf-8'); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); - xml_parse_into_struct($parser, $data, $vals, $index); - xml_parser_free($parser); - - $i = 0; - - $tagname = $vals[$i]['tag']; - $array[$tagname]['@'] = $vals[$i]['attributes']; - $array[$tagname]['#'] = $this->_xml_depth($vals, $i); - - return $array; - } - - - - // _xml_depth() - // (c) Hans Anderson / http://www.hansanderson.com/php/xml/ - - function _xml_depth($vals, &$i) - { - $children = array(); - - if (isset($vals[$i]['value'])) - { - array_push($children, trim($vals[$i]['value'])); - } - - while (++$i < count($vals)) - { - switch ($vals[$i]['type']) - { - case 'cdata': - array_push($children, trim($vals[$i]['value'])); - break; - - case 'complete': - $tagname = $vals[$i]['tag']; - $size = isset($children[$tagname]) ? sizeof($children[$tagname]) : 0; - $children[$tagname][$size]['#'] = isset($vals[$i]['value']) ? trim($vals[$i]['value']) : ""; - if (isset($vals[$i]['attributes'])) - { - $children[$tagname][$size]['@'] = $vals[$i]['attributes']; - } - break; - - case 'open': - $tagname = $vals[$i]['tag']; - $size = isset($children[$tagname]) ? sizeof($children[$tagname]) : 0; - if ($vals[$i]['attributes']) - { - $children[$tagname][$size]['@'] = $vals[$i]['attributes']; - $children[$tagname][$size]['#'] = $this->_xml_depth($vals, $i); - } - else - { - $children[$tagname][$size]['#'] = $this->_xml_depth($vals, $i); - } - break; - - case 'close': - return $children; - break; - } - } - - return $children; - } - - - - // TraverseXMLize() - // (c) acebone@f2s.com, a HUGE help! - - function TraverseXMLize($array, $arrName = "array", $level = 0) - { - if ($level == 0) - { - echo "
";
-    }
-
-    while (list($key, $val) = @each($array))
-    {
-      if (is_array($val))
-      {
-        $this->TraverseXMLize($val, $arrName . "[" . $key . "]", $level + 1);
-      }
-      else
-      {
-        echo '$' . $arrName . '[' . $key . '] = "' . $val . "\"\n";
-      }
-    }
-
-    if ($level == 0)
-    {
-      echo "
"; - } - } -} - - - -class MakeXML extends Jabber -{ - - function MakeXML() - { - $nodes = array(); - } - - - - function AddPacketDetails($string, $value = NULL) - { - if (preg_match("/\(([0-9]*)\)$/i", $string)) - { - $string .= "/[\"#\"]"; - } - - $temp = @explode("/", $string); - - for ($a = 0; $a < count($temp); $a++) - { - $temp[$a] = preg_replace("/^[@]{1}([a-z0-9_]*)$/i", "[\"@\"][\"\\1\"]", $temp[$a]); - $temp[$a] = preg_replace("/^([a-z0-9_]*)\(([0-9]*)\)$/i", "[\"\\1\"][\\2]", $temp[$a]); - $temp[$a] = preg_replace("/^([a-z0-9_]*)$/i", "[\"\\1\"]", $temp[$a]); - } - - $node = implode("", $temp); - - // Yeahyeahyeah, I know it's ugly... get over it. ;) - echo "\$this->nodes$node = \"" . htmlspecialchars($value) . "\";
"; - eval("\$this->nodes$node = \"" . htmlspecialchars($value) . "\";"); - } - - - - function BuildPacket($array = NULL) - { - - if (!$array) - { - $array = $this->nodes; - } - - if (is_array($array)) - { - array_multisort($array, SORT_ASC, SORT_STRING); - - foreach ($array as $key => $value) - { - if (is_array($value) && $key == "@") - { - foreach ($value as $subkey => $subvalue) - { - $subvalue = htmlspecialchars($subvalue); - $text .= " $subkey='$subvalue'"; - } - - $text .= ">\n"; - - } - elseif ($key == "#") - { - $text .= htmlspecialchars($value); - } - elseif (is_array($value)) - { - for ($a = 0; $a < count($value); $a++) - { - $text .= "<$key"; - - if (!$this->_preg_grep_keys("/^@/", $value[$a])) - { - $text .= ">"; - } - - $text .= $this->BuildPacket($value[$a]); - - $text .= "\n"; - } - } - else - { - $value = htmlspecialchars($value); - $text .= "<$key>$value\n"; - } - } - - return $text; - } - } - - - - function _preg_grep_keys($pattern, $array) - { - while (list($key, $val) = each($array)) - { - if (preg_match($pattern, $key)) - { - $newarray[$key] = $val; - } - } - return (is_array($newarray)) ? $newarray : FALSE; - } -} - - - -class CJP_StandardConnector -{ - function OpenSocket($server, $port) - { - if ($this->active_socket = fsockopen($server, $port)) - { - socket_set_blocking($this->active_socket, 0); - socket_set_timeout($this->active_socket, 31536000); - - return TRUE; - } - else - { - return FALSE; - } - } - - - - function CloseSocket() - { - return fclose($this->active_socket); - } - - - - function WriteToSocket($data) - { - return fwrite($this->active_socket, $data); - } - - - - function ReadFromSocket($chunksize) - { - set_magic_quotes_runtime(0); - $buffer = fread($this->active_socket, $chunksize); - set_magic_quotes_runtime(get_magic_quotes_gpc()); - - return $buffer; - } -} - - - -?> diff --git a/includes_old/funktion_modem.php b/includes_old/funktion_modem.php deleted file mode 100644 index 8e93ebf4..00000000 --- a/includes_old/funktion_modem.php +++ /dev/null @@ -1,34 +0,0 @@ -$Number' was called
\n"; - - $fp = fopen( $ModemDev, "w"); - sleep(1); - fwrite( $fp, "+++"); - sleep(1); - fwrite( $fp, "ATZ\n"); - sleep(1); - fwrite( $fp, "ATX1\n"); - sleep(1); - fwrite( $fp, "ATD $Number \n"); - sleep(8); - fclose($fp); - sleep(1); - } - else - echo "Modem is Disable, number: '$Number' was not called
\n"; -} - - -function SetWackeup( $Number, $TimeH, $TimeM) -{ - global $WakeupNumber; - DialNumber( "$WakeupNumber$TimeH$TimeM$Number"); -} - -?> diff --git a/includes_old/funktion_schichtplan_beamer.php b/includes_old/funktion_schichtplan_beamer.php deleted file mode 100644 index 85c5ffe8..00000000 --- a/includes_old/funktion_schichtplan_beamer.php +++ /dev/null @@ -1,180 +0,0 @@ -\n"; - - $Out.= "\n". - "\n". - "\n". - "\n"; - - /////////////////////////////////////////////////////////////////// - // SQL abfrage für die benötigten schichten - /////////////////////////////////////////////////////////////////// - $SQL = "SELECT * FROM `ShiftEntry` WHERE (`SID` = '$SID') ORDER BY `TID`, `UID` DESC ;"; - $Erg = mysql_query($SQL, $con); - - $Anzahl = mysql_num_rows($Erg); - $Feld=-1; - for( $i = 0; $i < $Anzahl; $i++ ) - { - - $Temp_TID = mysql_result($Erg, $i, "TID"); - - // wenn sich der Type ändert wird zumnästen feld geweckselt - if( ($i==0) || ($Temp_TID_old != $Temp_TID) ) - { - $Feld++; - $Temp[$Feld]["free"]=0; - $Temp[$Feld]["Engel"]=array(); - } - - $Temp[$Feld]["TID"] = $Temp_TID; - $Temp[$Feld]["UID"] = mysql_result($Erg, $i, "UID"); - - // ist es eine zu vergeben schicht? - if( $Temp[$Feld]["UID"] == 0 ) - $Temp[$Feld]["free"]++; - else - $Temp[$Feld]["Engel"][] = $Temp[$Feld]["UID"]; - - $Temp_TID_old = $Temp[$Feld]["TID"]; - } // FOR - - - /////////////////////////////////////////////////////////////////// - // Aus gabe der Schicht - /////////////////////////////////////////////////////////////////// - if( isset($Temp) && count($Temp) ) - foreach( $Temp as $TempEntry => $TempValue ) - { - $Out.= "\n"; - - // ausgabe EngelType - $Out.= "". $EngelTypeID[ $TempValue["TID"] ]; - - // ausgabe Eingetragener Engel - if( count($TempValue["Engel"]) > 0 ) - { - if( count($TempValue["Engel"]) == 1 ) - $Out.= " ". trim(Get_Text("inc_schicht_ist")). ":"; - else - $Out.= " ". trim(Get_Text("inc_schicht_sind")). ":"; - $Out.= "\n"; - $Out.= ""; - - foreach( $TempValue["Engel"] as $TempEngelEntry=> $TempEngelID ) - $Out.= UID2Nick( $TempEngelID ). ", "; -// $Out.= UID2Nick( $TempEngelID ). DisplayAvatar( $TempEngelID ). ", "; - $Out = substr( $Out, 0, strlen($Out)-2 ); - } - else - { - $Out.= ":\n"; - $Out.= "\n"; - } - - - // ausgabe benötigter Engel - //////////////////////////// - if( $_SESSION['CVS']["nonpublic/schichtplan_add.php"] == "Y") - { - if ( $TempValue["free"] > 0) - { - if( count($TempValue["Engel"]) > 0) - $Out.= ", "; - $Out.= $TempValue["free"]. "x free "; - } - } - $Out.= "\n"; - $Out.= "\n"; - - } // FOREACH - - $Out.= "\n"; - - return $Out; -} // function Ausgabe_Feld_Inhalt - - - -/*####################################################### -# gibt die engelschischten für einen Ruam aus # -#######################################################*/ -function ausgabe_Zeile( $RID, $Time, &$AnzahlEintraege ) -{ - global $con; - - $SQL = "SELECT `SID`, `Len`, `Man` FROM `Shifts` ". - "WHERE ( (`RID` = '$RID') AND ". - "((`DateE` like '". gmdate("Y-m-d H", $Time+3600). "%') OR ". - " (`DateS` like '". gmdate("Y-m-d H", $Time). "%')) ) ORDER BY `DateS`;"; - - $ErgRoom = mysql_query($SQL, $con); - $Out= ""; - if( mysql_num_rows( $ErgRoom)>0 ) - for( $i=1; $i<=mysql_num_rows( $ErgRoom); $i++ ) - { - $AnzahlEintraege++; - $Out.= ausgabe_Feld_Inhalt( mysql_result( $ErgRoom, $i-1, "SID"), - mysql_result( $ErgRoom, $i-1, "Man")); - if( (mysql_num_rows( $ErgRoom) > 1) && !($i==mysql_num_rows( $ErgRoom)) ) - $Out.= "
"; -// $Out.= "
\n"; - - } - else - $Out.= " "; - - $Out.= "\n"; - - return $Out; -} - -?> diff --git a/includes_old/header.php b/includes_old/header.php deleted file mode 100644 index 9cd2e51d..00000000 --- a/includes_old/header.php +++ /dev/null @@ -1,102 +0,0 @@ -\n"; -?> - - - -<?php echo $title; ?> - Engelsystem - - - - - - - - - - - - - - -\n"; -} - -if (isset ($Page["AutoReload"])) - echo "\n\n"; - -echo "\n"; - -///////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////// B O D Y -///////////////////////////////////////////////////////////////////////////////////////////// -echo "\n"; - -echo '
'; - -//ausgabe new message -if (isset ($_SESSION['CVS']["nonpublic/messages.php"])) { - if ($_SESSION['CVS']["nonpublic/messages.php"] == "Y") { - $SQL = "SELECT `Datum` FROM `Messages` WHERE `RUID`=" . $_SESSION["UID"] . " AND `isRead`='N'"; - $erg = mysql_query($SQL, $con); - if (mysql_num_rows($erg) > 0) - echo "
" . Get_Text("pub_messages_new1") . - " " . mysql_num_rows($erg) . " " . - Get_Text("pub_messages_new2") . "

"; - } -} -?> -
- -
-' . (strlen($header) == 0 ? Get_Text($Page["Name"]) : $header) . ''; -echo '
'; - -if (isset ($_SESSION['UID'])) { - if (isset ($_SESSION['oldurl'])) - $BACKUP_SESSION_OLDURL = $_SESSION['oldurl']; - if (isset ($_SESSION['newurl'])) - $_SESSION['oldurl'] = $_SESSION['newurl']; - $_SESSION['newurl'] = $_SERVER["REQUEST_URI"]; -} - -function SetHeaderGo2Back() { - global $BACKUP_SESSION_OLDURL; - $_SESSION['oldurl'] = $BACKUP_SESSION_OLDURL; -} - -if ($Page["CVS"] != "Y") { - echo "Du besitzt kein Rechte für diesen Bereich.
\n"; - - if (isset ($_SESSION['oldurl'])) - echo "hier gehts zurück...\n"; - else - echo "hier geht's zurück...\n"; - - exit (); -} -?> - - diff --git a/www-ssl_old/ShowUserPicture.php b/www-ssl_old/ShowUserPicture.php deleted file mode 100644 index 5a222c07..00000000 --- a/www-ssl_old/ShowUserPicture.php +++ /dev/null @@ -1,56 +0,0 @@ - diff --git a/www-ssl_old/admin/UserPicture.php b/www-ssl_old/admin/UserPicture.php deleted file mode 100644 index 25f8b54b..00000000 --- a/www-ssl_old/admin/UserPicture.php +++ /dev/null @@ -1,132 +0,0 @@ -\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t(max " . get_cfg_var("post_max_size") . "Byte)
\n"; - echo "\t\n"; - echo "\n"; - break; - case 'sendPicture' : - if (($_FILES["file"]["size"] > 0) && (isset ($_POST["UID"]))) { - if (($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/gif")) { - $data = addslashes(fread(fopen($_FILES["file"]["tmp_name"], "r"), filesize($_FILES["file"]["tmp_name"]))); - - if (GetPicturShow($_POST['UID']) == "") - $SQL = "INSERT INTO `UserPicture` " . - "( `UID`,`Bild`, `ContentType`, `show`) " . - "VALUES ('" . $_POST['UID'] . "', '$data', '" . $_FILES["file"]["type"] . "', 'N')"; - else - $SQL = "UPDATE `UserPicture` SET " . - "`Bild`='$data', " . - "`ContentType`='" . $_FILES["file"]["type"] . "' " . - "WHERE `UID`='" . $_POST['UID'] . "'"; - - echo "Upload Pictur:'" . $_FILES["file"]["name"] . "', " . - "MIME-Type: " . $_FILES["file"]["type"] . ", " . - $_FILES["file"]["size"] . " Byte " . - "for " . UID2Nick($_POST["UID"]); - } else - Print_Text("pub_einstellungen_send_KO"); - } else - Print_Text("pub_einstellungen_send_KO"); - break; - - case 'SetN' : - if (IsSet ($_GET["UID"])) { - echo "Bild von '" . UID2Nick($_GET["UID"]) . "' wurde gesperrt:
"; - $SQL = "UPDATE `UserPicture` SET `show`='N' WHERE `UID`='" . $_GET["UID"] . "'"; - } else - echo "Fehlerhafter Aufruf"; - break; - case 'SetY' : - if (IsSet ($_GET["UID"])) { - echo "Bild von '" . UID2Nick($_GET["UID"]) . "' wurde Freigegeben:
"; - $SQL = "UPDATE `UserPicture` SET `show`='Y' WHERE `UID`='" . $_GET["UID"] . "'"; - } else - echo "Fehlerhafter Aufruf"; - break; - case 'del' : - echo "Wollen Sie das Bild von '" . UID2Nick($_GET["UID"]) . "' wirklich löschen? " . - "Yes"; - break; - case 'delYes' : - if (IsSet ($_GET["UID"])) { - echo "Bild von '" . UID2Nick($_GET["UID"]) . "' wurde gelöscht:
"; - $SQL = "DELETE FROM `UserPicture` WHERE `UID`='" . $_GET["UID"] . "' LIMIT 1"; - } else - echo "Fehlerhafter Aufruf"; - break; - default : - echo "Fehlerhafter Aufruf"; - - } //switch - - // Update ??? - if (IsSet ($SQL)) { - // hier muesste das SQL ausgefuehrt werden... - $Erg = mysql_query($SQL, $con); - if ($Erg == 1) - echo "Änderung wurde gesichert...
"; - else { - echo "Fehler beim speichern... bitte noch ein mal probieren :)"; - echo "

" . mysql_error($con) . "
($SQL)
"; - } - } // Ende Update - echo "
\n
\n
\n\n"; -} //IF IsSet($action) - -//ausgabe der Liste -$Sql = "SELECT * FROM `UserPicture` WHERE `UID`>0;"; -$Erg = mysql_query($Sql, $con); - -echo "Hallo " . $_SESSION['Nick'] . ",
\nhier hast du die Möglichkeit, die Bilder der Engel freizugeben:

\n"; - -echo "\n"; -echo "\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo ""; - -for ($t = 0; $t < mysql_num_rows($Erg); $t++) { - $UIDs = mysql_result($Erg, $t, "UID"); - echo "\t\n"; - - echo "\t\t\n"; - echo "\t\t\n"; - - if (GetPicturShow($UIDs) == "Y") - echo "\t\t\n"; - elseif (GetPicturShow($UIDs) == "N") echo "\t\t\n"; - else - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\n"; -} // ende Auflistung Raeume -echo "
UserBildStatusLöschen
" . UID2Nick(mysql_result($Erg, $t, "UID")) . "" . displayPictur($UIDs, 0) . "sperrenfreigebenERROR: show='" . GetPicturShow($UIDs) . "'del
"; - -echo "
picture upload\n"; - -include ("includes/footer.php"); -?> diff --git a/www-ssl_old/admin/aktiv.php b/www-ssl_old/admin/aktiv.php deleted file mode 100644 index 8db62f98..00000000 --- a/www-ssl_old/admin/aktiv.php +++ /dev/null @@ -1,105 +0,0 @@ -"; -echo Get_Text("pub_aktive_Text1") . "
\n"; -echo Get_Text("pub_aktive_Text2") . "

\n"; - -// auswahlbox -echo Get_Text("pub_aktive_Text31") . "\n"; -echo ""; -echo Get_Text("pub_aktive_Text32") . "

\n"; -echo "\n"; -echo "\n"; -echo "\n"; - -echo "
\n"; -echo "\t
\n"; -echo "
\n"; - -if (Isset ($_POST["ResetActive"])) { - $SQLreset = "UPDATE `User` SET `Aktiv`='0'"; - $ErgReset = db_query($SQLreset, "Reset Active"); - if ($ErgReset != 1) - echo "Fehler beim zuruecksetzen der Activ\n"; - else - echo "Active wurde erfolgreich zurueckgesetzt\n"; -} - -if (IsSet ($_POST["Anzahl"])) - echo "
\n\n" . Get_Text("pub_aktive_Text5_1") . $_POST["Anzahl"] . Get_Text("pub_aktive_Text5_2") . ":"; - -echo "

\n\n"; - -//ausgabe tabelle -echo "\n"; -echo "\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\t\n"; -echo "\n"; - -$SQL = " -SELECT d.UID, d.nr, d.len, d.lenWeight, f.nr AS nrFree, f.len AS lenFree, d.lenWeight - COALESCE(f.len, 0) as lenReal - FROM - (SELECT e.UID, COUNT(s.Len) as nr, SUM(s.Len) as len, SUM( s.Len*(1+(((HOUR(s.DateS)+2)%24)<10 and ((HOUR(s.DateE)+2)%24)<=10)) ) as lenWeight FROM `Shifts` AS s INNER JOIN `ShiftEntry` AS e USING(SID) WHERE NOT UID=0 GROUP BY UID) as d - LEFT JOIN - (SELECT UID, COUNT(Length) AS nr, SUM(Length) AS len FROM `ShiftFreeloader` GROUP BY UID) AS f - USING(UID) - ORDER BY lenReal DESC, nr DESC, UID"; - -$Erg = mysql_query($SQL, $con); -echo mysql_error($con); -$rowcount = mysql_num_rows($Erg); - -$aktivecount = 0; -for ($i = 0; $i < $rowcount; $i++) { - echo "\n\n\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - - echo "\t\t\n"; - echo "\t\n"; -} // ende Auflistung aktive Engel - -echo "
" . Get_Text("pub_aktive_Nick") . "" . Get_Text("pub_aktive_Anzahl") . "" . Get_Text("pub_aktive_Time") . "" . Get_Text("pub_aktive_Time") . " WeightFreeloader " . Get_Text("pub_aktive_Anzahl") . "Freeloader " . Get_Text("pub_aktive_Time") . "" . Get_Text("pub_aktive_Time") . " result" . Get_Text("pub_aktive_Active") . "
" . UID2Nick(mysql_result($Erg, $i, "UID")) . "" . mysql_result($Erg, $i, "nr") . "x" . mysql_result($Erg, $i, "len") . "h" . mysql_result($Erg, $i, "lenWeight") . "h" . mysql_result($Erg, $i, "nrFree") . "x" . mysql_result($Erg, $i, "lenFree") . "h" . mysql_result($Erg, $i, "lenReal") . "h"; - if (IsSet ($_POST["Anzahl"])) { - if ($_POST["Anzahl"] < mysql_result($Erg, $i, "lenReal")) { - $aktivecount++; - if ($_POST["SendType"] == "Show..") - echo "show set"; - else { - $SQL2 = "UPDATE `User` SET `Aktiv`='1' WHERE `UID`='" . mysql_result($Erg, $i, "UID") . "' LIMIT 1"; - $Erg2 = db_query($SQL2, "update Active State"); - if ($Erg2 != 1) - echo "Fehler beim speichern bei Engel " . UID2Nick(mysql_result($Erg, $i, "UID")); - else - echo "write set"; - } - } - } - echo "
"; - -echo "
Anzahl eintraege: $aktivecount / $rowcount (Aktive/Mitschichten)

"; - -include ("includes/footer.php"); -?> - diff --git a/www-ssl_old/admin/dect.php b/www-ssl_old/admin/dect.php deleted file mode 100644 index 4e9f472a..00000000 --- a/www-ssl_old/admin/dect.php +++ /dev/null @@ -1,69 +0,0 @@ -\n"; -echo "\n"; - -echo "\n"; - -echo "\n"; - -echo "\n"; -echo "\n"; -echo ""; -echo "
Numberh:m
\n"; -// Listet alle Nicks auf -echo "\n"; - -echo "\n"; -echo ":"; -echo "
\n"; - -echo ""; - -include ("includes/footer.php"); -?> - diff --git a/www-ssl_old/admin/free.php b/www-ssl_old/admin/free.php deleted file mode 100644 index b45fadcf..00000000 --- a/www-ssl_old/admin/free.php +++ /dev/null @@ -1,98 +0,0 @@ -\n"; - -echo "

\n\nHier findest du alle Engel, welche zur Zeit in keiner Schicht verplant sind:

\n"; - -####################################################### -# Ermitteln freier Engel -# -# auslesen aller Engel und dazugehoerige Schichten -####################################################### - -// $SQL= "SELECT User.Nick, Schichtplan.*, Schichtbelegung. * FROM User LEFT JOIN Schichtplan ON User.UID=Schichtbelegung.UID, Schichtplan.SID LEFT JOIN Schichtbelegung.SID WHERE User.UID = Schichtbelegung.UID AND Schichtplan.SID = Schichtbelegung.SID AND Schichtplan.Date < now() and Schichtplan.EndDate > now() ORDER BY Nick"; - -/* geht nicht ??? unter stabel !! -$SQL= "SELECT User.Nick, Schichtplan.*, Schichtbelegung.* ". - "FROM Schichtplan, User LEFT OUTER ". - "JOIN Schichtbelegung ON User.UID=Schichtbelegung.UID ". - "WHERE Schichtplan.SID = Schichtbelegung.SID AND ". - "Schichtplan.Date < now() and ". - "Schichtplan.EndDate > now() ". - "ORDER BY Nick"; - -$SQL = "SELECT Shifts.*, ShiftEntry.*, User.Nick ". - "FROM User ". - "INNER JOIN (Shifts INNER JOIN ShiftEntry ON Shifts.SID = ShiftEntry.SID) ON User.UID = ShiftEntry.UID ". - "WHERE (Shifts.DateS<=Now() AND Shifts.DateE>=Now() );"; -*/ -$SQL = "SELECT Shifts.*, ShiftEntry.* " . -"FROM `Shifts` INNER JOIN ShiftEntry ON Shifts.SID = ShiftEntry.SID " . -"WHERE (Shifts.DateS<=Now() AND Shifts.DateE>=Now() AND ShiftEntry.UID>0);"; - -//SELECT User.Nick, Schichtplan.*, Schichtbelegung. * FROM User LEFT JOIN Schichtbelegung ON User.UID=Schichtbelegung.UID, Schichtplan LEFT JOIN Schichtbelegung ON Schichtplan.SID = Schichtbelegung.SID WHERE Schichtplan.Date < now() and Schichtplan.EndDate > now() ORDER BY Nick - -//echo "
$SQL
"; - -$Erg = mysql_query($SQL, $con); -$Zeilen = mysql_num_rows($Erg); - -// for ($i = 1; $i < mysql_num_fields($Erg); $i++) -// echo "|".mysql_field_name($Erg, $i); - -echo "\n"; -echo "\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\n"; - -$inuse = ""; -for ($i = 0; $i < $Zeilen; $i++) { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if ($inuse != "") - $inuse .= " OR "; - $inuse .= "(Nick = \"" . UID2Nick(mysql_result($Erg, $i, "UID")) . "\")"; -} -if ($inuse != "") - $inuse = " WHERE NOT (" . - $inuse . ")"; -echo "
NickSchichtOrtVonBis
" . - UID2Nick(mysql_result($Erg, $i, "UID")) . "" . mysql_result($Erg, $i, "RID") . "" . mysql_result($Erg, $i, "DateS") . "" . mysql_result($Erg, $i, "DateE") . "
\n"; - -//########################################################################################################## - -echo "

\n\nhier findest du alle Engel, welche zur Zeit in keiner Schichten verplant sind:

\n"; -echo "\n"; -echo "\t\n\t\t\n\t\t\n\t\n"; - -$SQL = "SELECT Nick, UID, DECT FROM User" . $inuse . ";"; -$Erg = mysql_query($SQL, $con); -$Zeilen = mysql_num_rows($Erg); -for ($i = 0; $i < $Zeilen; $i++) { - echo "\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\n\n"; -} -echo "
NickDECT
" . - mysql_result($Erg, $i, "Nick") . "" . mysql_result($Erg, $i, "DECT") . "
\n"; - -include ("includes/footer.php"); -?> - diff --git a/www-ssl_old/admin/free_DECT.php b/www-ssl_old/admin/free_DECT.php deleted file mode 100644 index 4b4e3085..00000000 --- a/www-ssl_old/admin/free_DECT.php +++ /dev/null @@ -1,65 +0,0 @@ -=Now() AND ShiftEntry.UID>0);"; - -$Erg = mysql_query($SQL, $con); -$Zeilen = mysql_num_rows($Erg); - -$inuse = ""; -for ($i = 0; $i < $Zeilen; $i++) { - if ($inuse != "") - $inuse .= " OR "; - $inuse .= "(UID = \"" . mysql_result($Erg, $i, "UID") . "\")"; -} -if ($inuse != "") { - $inuse = " WHERE (NOT (" . $inuse . ")) AND (DECT!='')"; -} else { - $inuse = " WHERE (DECT!='')"; -} - -//########################################################################################################## - -$SQL = "SELECT * FROM User" . $inuse . ";"; -$Erg = mysql_query($SQL, $con); -$Zeilen = mysql_num_rows($Erg); -for ($i = 0; $i < $Zeilen; $i++) { - // get DECT number - echo mysql_result($Erg, $i, "DECT") . "\t"; - - // get all user rights - $SQL_RIGHT = "SELECT * FROM UserCVS WHERE UID=" . mysql_result($Erg, $i, "UID") . ";"; - $Erg_RIGHT = mysql_query($SQL_RIGHT, $con); - $UserRights = mysql_fetch_array($Erg_RIGHT); - - foreach ($UserRights as $Var => $Value) { - if ((strpos($Var, ".php") === false) AND (strpos($Var, "/") === false) AND (strpos($Var, "UID") === false) AND (is_numeric($Var) === false)) { - echo "\"" . $Var . "\"=" . $Value . "\t"; - } - } - - // get shift types - $SQL_TYPES = "SELECT TID FROM `ShiftEntry` WHERE UID=" . mysql_result($Erg, $i, "UID") . " GROUP BY TID;"; - $Erg_TYPES = mysql_query($SQL_TYPES, $con); - $Zeilen_Typen = mysql_num_rows($Erg_TYPES); - for ($j = 0; $j < $Zeilen_Typen; $j++) { - echo "\"TID_" . TID2Type(mysql_result($Erg_TYPES, $j, "TID")) . "\"=Y\t"; - } - - echo "\n"; - // echo "
"; -} -?> - diff --git a/www-ssl_old/admin/schichtplan.1.php b/www-ssl_old/admin/schichtplan.1.php deleted file mode 100644 index fe8c0384..00000000 --- a/www-ssl_old/admin/schichtplan.1.php +++ /dev/null @@ -1,5 +0,0 @@ -

Schichtplan

- \ No newline at end of file diff --git a/www-ssl_old/admin/schichtplan.php b/www-ssl_old/admin/schichtplan.php deleted file mode 100644 index 70ef5a6a..00000000 --- a/www-ssl_old/admin/schichtplan.php +++ /dev/null @@ -1,362 +0,0 @@ -\n"; - if ($Erg == 1) { - echo "SQL war erfolgreich"; - } else { - echo "SQL Fehler (" . mysql_error($con) . ")"; - } -} - -if (!IsSet ($_GET["action"])) { - echo "Hallo " . $_SESSION['Nick'] . ",
\n"; - echo "hier kannst du Schichten anlegen, ändern oder löschen.

"; - echo "Neue Schicht einplanen

\n\n"; - - echo "
\n"; -?> - - - - - - - - -\n"; - echo "\t\t\n"; - echo "\t\t\n"; - - $sql2 = "SELECT `Name` FROM `Room` WHERE `RID`='" . mysql_result($Erg, $i, "RID") . "'"; - $Erg2 = mysql_query($sql2, $con); - if (mysql_num_rows($Erg2) > 0) - echo "\t\t\n"; - else - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\n"; - } - echo "
DatumRaumDauerÄndern
" . mysql_result($Erg, $i, "DateS") . "" . mysql_result($Erg2, 0, "Name") . "Unbenkannt (RID=" . mysql_result($Erg, $i, "RID") . ")" . mysql_result($Erg, $i, "Len") . " Std. ####
\n"; - - echo "\n"; - echo "\n"; - echo "
\n"; - -} else { - - // aus sicherheitzgr�nden wegen sp�terer genuzung - UnSet ($chSQL); - - switch ($_GET["action"]) { - - case 'change' : - if (!IsSet ($_GET["SID"])) { - echo "Fehlerhafter Aufruf!\n"; - } else { - - $sql = "SELECT * FROM `Shifts` WHERE (`SID` = '" . $_GET["SID"] . "' )"; - $Erg = mysql_query($sql, $con); - - echo "Schicht abändern:
\n"; - - // Anzeige Allgemeiner schaischt daten - echo "
"; - echo "\n"; - echo " " . - "\n"; - echo " \n"; - - echo " " . - "\n"; - echo " " . - "\n"; - echo " " . - "\n"; - if ($FromPentabarf == "Y") { - echo " " . - "\n"; - } - echo "
Schichtbeginn
Raum\n\n
Dauer in h
Beschreibung
URL

!!! Imported from Pentabarf !!!

\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n\n"; - - // L�schen - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n\n"; - - echo "ACHTUNG:
\n"; - echo "Beim Löschen werden die bisher eingetragenen Engel für diese Schicht mitgelöscht.
\n"; - - echo "

\n\n\n\n"; - - //Freie Engelschichten - $sql3 = "SELECT `TID` FROM `ShiftEntry` WHERE `SID`='" . $_GET["SID"] . "' AND `UID`='0'"; - $Erg3 = mysql_query($sql3, $con); - $rowcount = mysql_num_rows($Erg3); - - echo "Folgende Engelschichten sind noch nicht vergeben.\n"; - echo "Und koenen, wenn diese nSchicht nicht benoetigt wird geloet werden:
\n"; - for ($j = 0; $j < $rowcount; $j++) { - $TID = mysql_result($Erg3, $j, 0); - echo "" . - "freie " . TID2Type($TID) . Get_Text("inc_schicht_Engel") . "schicht loeschen
\n"; - } - echo "

\n\n\n\n"; - - //Ausgabe eingetragener schischten - $sql3 = "SELECT * FROM `ShiftEntry` WHERE `SID`='" . $_GET["SID"] . "' AND NOT `UID`='0'"; - $Erg3 = mysql_query($sql3, $con); - $rowcount = mysql_num_rows($Erg3); - - echo "Folgende Engel Sind fuer die Schicht eingetargen.\n"; - echo "Und koennen, wenn diese nicht zu Schicht erschienen sind ausgetragen werden:
\n"; - echo "\n" . - "" . - "" . - "" . - "" . - "" . - ""; - - for ($j = 0; $j < $rowcount; $j++) { - $userUID = mysql_result($Erg3, $j, "UID"); - echo "\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\n"; - } // FOR - - echo "
nicktypenormalfreeloader :-(
" . UID2Nick($userUID) . "" . TID2Type(mysql_result($Erg3, $j, "TID")) . Get_Text("inc_schicht_Engel") . "###-austragen-######-austragen-freeloader-###


\n\n\n\n"; - - //Nachtragen von Engeln - echo "Hat ein anderer Engel die Schicht übernommen, trage ihn bitte ein:"; - echo "
\n"; - echo "\n"; - echo "\n"; - - // Listet alle Nicks auf - echo "\n"; - - echo " als \n"; - - // holt eine liste der ben�tigten Engel zu dieser Schischt - $sql3 = "SELECT Count(`TID`) AS `CTID`, `TID` FROM `ShiftEntry` "; - $sql3 .= "WHERE (`SID`='" . $_GET["SID"] . "' AND `UID`='0') "; - $sql3 .= "GROUP BY `SID`, `TID`, `UID` "; - $Erg3 = mysql_query($sql3, $con); - $i = -1; - while (++ $i < mysql_num_rows($Erg3)) { - $EngelNeed[mysql_result($Erg3, $i, "TID")] = mysql_result($Erg3, $i, "CTID"); - } - - // Gibt dei m�glich Engeltypen aus und zeigt w�efiel noch be�tigt werden - echo "\n"; - - echo "\n"; - - echo "
\n Anzahl New\n"; - - echo "
"; - - } // IF ISSET( - break; - - case 'engeladd' : - if ($_GET["UIDs"] > 0) { - - $SQL = "SELECT * FROM `ShiftEntry` " . - "WHERE (`SID`='" . $_GET["SID"] . "' AND `TID`='" . $_GET["TID"] . "' AND `UID`='0')"; - $ERG = mysql_query($SQL, $con); - if (mysql_num_rows($ERG) != 0) { - $chSQL = "UPDATE `ShiftEntry` SET " . - "`UID`='" . $_GET["UIDs"] . "', `Comment`='shift added by " . $_SESSION['Nick'] . "' " . - "WHERE (`SID`='" . $_GET["SID"] . "' AND " . - "`TID`='" . $_GET["TID"] . "' AND `UID`='0' ) LIMIT 1"; - } else { - $chSQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`, `UID`, `Comment`) VALUES (" . - "'" . $_GET["SID"] . "', '" . $_GET["TID"] . "', " . - "'" . $_GET["UIDs"] . "', 'shift added by " . $_SESSION['Nick'] . "')"; - } - echo "Es wird folgende Schicht zusätzlich eingetragen:
\n"; - echo "Engel: " . UID2Nick($_GET["UIDs"]) . "
\n"; - echo "Bemerkung: Schicht eingetragen durch Erzengel " . $_SESSION['Nick'] . "
\n
\n"; - } else { - echo "Es wird folgende Schicht wurde " . $_GET["eAnzahlNew"] . "x zusätzlich eingetragen:
\n"; - for ($i = 0; $i < $_GET["eAnzahlNew"]; $i++) { - echo "$i.
\n"; - $SQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`, `UID`, `Comment`) VALUES ("; - $SQL .= "'" . $_GET["SID"] . "', '" . $_GET["TID"] . "', '0', NULL)"; - $ERG = mysql_query($SQL, $con); - if ($debug) - echo "DEBUG SQL: $SQL
\n"; - if ($ERG == 1) { - echo "Änderung wurde gesichert...
"; - } else { - echo "Fehler beim speichern... bitte noch ein mal probieren :)
"; - echo mysql_error($con); - } - echo "Es wird eine weitere Schicht eingetragen:

\n"; - } - } - break; - - case 'engeldel' : - $chSQL = "UPDATE `ShiftEntry` SET `UID`='0', `Comment`= 'NULL' WHERE (`SID`='" . $_GET["SID"] . - "' AND `UID`='" . $_GET["UIDs"] . "') LIMIT 1"; - if (isset ($_GET["freeloader"]) && $_GET["freeloader"] == 1) { - $sql = "SELECT * FROM `Shifts` WHERE (`SID` = '" . $_GET["SID"] . "' )"; - $Erg = mysql_query($sql, $con); - if (mysql_num_rows($Erg) == 1) { - $UID = $_GET["UIDs"]; - $Length = mysql_result($Erg, 0, "Len"); - $Comment = "Start: " . mysql_result($Erg, 0, "DateS") . "; " . - "Beschreibung: " . mysql_result($Erg, 0, "Man") . "; " . - "Removed by " . $_SESSION['Nick']; - $ch2SQL = "INSERT INTO `ShiftFreeloader` (`Remove_Time`, `UID`, `Length`, `Comment`) " . - "VALUES ( CURRENT_TIMESTAMP, '$UID', '$Length', '$Comment');"; - } - } - break; - - case 'engelshiftdel' : - $chSQL = "DELETE FROM `ShiftEntry` WHERE `SID`='" . $_GET["SID"] . "' AND `TID`='" . - $_GET["TID"] . "' AND `UID`='0' LIMIT 1"; - break; - - case 'changesave' : - $query = mysql_query("SELECT DATE_ADD('" . $_GET["eDate"] . "', INTERVAL '+0 " . $_GET["eDauer"] . "' DAY_HOUR)", $con); - $enddate = mysql_fetch_row($query); - - $chSQL = "UPDATE `Shifts` SET " . - "`DateS`='" . $_GET["eDate"] . "', " . - "`DateE`='" . $enddate[0] . "', " . - "`RID`='" . $_GET["eRID"] . "', " . - "`Len`='" . $_GET["eDauer"] . "', " . - "`Man`='" . $_GET["eName"] . "', " . - "`URL`='" . $_GET["eURL"] . "' " . - "WHERE `SID`='" . $_GET["SID"] . "'"; - SetHeaderGo2Back(); - break; - - case 'delete' : - $chSQL = "DELETE FROM `Shifts` WHERE `SID`='" . $_GET["SID"] . "' LIMIT 1"; - $ch2SQL = "DELETE FROM `ShiftEntry` WHERE `SID`='" . $_GET["SID"] . "'"; - SetHeaderGo2Back(); - break; - - case 'deleteShifs' : - foreach ($_GET as $k => $v) - if (strpos(" " . $k, "SID") == 1) { - echo "Shifts $v wird gel�scht..."; - executeSQL("DELETE FROM `Shifts` WHERE `SID`='$v' LIMIT 1"); - echo "
\n"; - echo "ShiftEntry $v wird gel�scht..."; - executeSQL("DELETE FROM `ShiftEntry` WHERE `SID`='$v'"); - echo "

\n"; - } - break; - - } // end switch - - if (IsSet ($chSQL)) { - // echo $chSQL; - // hier muesste das SQL ausgefuehrt werden... - $Erg = mysql_query($chSQL, $con); - if ($debug) - echo "DEBUG SQL: $chSQL
\n"; - if ($Erg == 1) { - echo "Änderung wurde gesichert...
"; - if ($debug) - echo "DEBUG: ergebniss" . $Erg . "
\n"; - if (IsSet ($ch2SQL)) { - $Erg = mysql_query($ch2SQL, $con); - if ($debug) - echo "DEBUG SQL: $ch2SQL
\n"; - if ($debug) - echo "DEBUG: ergebniss" . $Erg . "
\n"; - } - } else { - echo "Fehler beim speichern... bitte noch ein mal probieren :)
"; - echo mysql_error($con); - } - } // Ende Update - -} - -include ("includes/footer.php"); -?> diff --git a/www-ssl_old/admin/schichtplan_druck.1.php b/www-ssl_old/admin/schichtplan_druck.1.php deleted file mode 100644 index 30761390..00000000 --- a/www-ssl_old/admin/schichtplan_druck.1.php +++ /dev/null @@ -1,5 +0,0 @@ - - -
  • Ein-/Austragen
  • -
  • Druckversion
  • - diff --git a/www-ssl_old/admin/schichtplan_druck.php b/www-ssl_old/admin/schichtplan_druck.php deleted file mode 100644 index 3e856c5e..00000000 --- a/www-ssl_old/admin/schichtplan_druck.php +++ /dev/null @@ -1,119 +0,0 @@ -\n" . - "auf dieser Seite kannst du dir den Schichtplan in einer Druckansicht generieren lassen. Wähle hierfür ein Datum und den Raum:\n" . - "
    \n"; - - foreach ($VeranstaltungsTage as $k => $v) { - - $res = mysql_query("SELECT Name, RID FROM `Room` WHERE `show`!='N' ORDER BY `Name`;", $con); - for ($i = 0; $i < mysql_num_rows($res); $i++) { - $Tag = $VeranstaltungsTage[$k]; - $RID = mysql_result($res, $i, "RID"); - $Rname = mysql_result($res, $i, "Name"); - echo "\t$Tag $Rname
    \n"; - } - echo "
    \n"; - } - echo "

    "; - - include ("includes/footer.php"); -} else //################################################################# - { - if (IsSet ($_GET["Raum"]) AND IsSet ($_GET["ausdatum"])) { - $Raum = $_GET["Raum"]; - $ausdatum = $_GET["ausdatum"]; - - include ("config/config_db.php"); - include ("config/config.php"); - include ("includes/secure.php"); - //var wird nur gesetzt immer edit auszublenden, achtung sesion darf nicht gestart sein !!! - $_SESSION['CVS']["admin/schichtplan.php"] = "N"; - include ("includes/funktion_lang.php"); - include ("includes/funktion_schichtplan.php"); - include ("includes/funktion_schichtplan_aray.php"); - include ("includes/funktion_user.php"); -?> - - - - -Schichtplan - - - - - - - - - - -

    Schichtplan

    - - - - - - -
    - Datum: - - - Raum: - -
    - - - - - - - - - -\n"; - if ($j == 0) { - $Spalten[$i * $GlobalZeileProStunde + $j] .= "\t\t\n"; - - } - } - - CreateRoomShifts($Raum); - - // Ausgabe Zeilen - for ($i = 0; $i < (24 * $GlobalZeileProStunde); $i++) - echo $Spalten[$i]; - // Ende - echo "
    UhrzeitSchichtplanbelegung
    "; - if ($i < 10) - $Spalten[$i * $GlobalZeileProStunde + $j] .= "0"; - $Spalten[$i * $GlobalZeileProStunde + $j] .= "$i:"; - if ((($j * 60) / $GlobalZeileProStunde) < 10) - $Spalten[$i * $GlobalZeileProStunde + $j] .= "0"; - $Spalten[$i * $GlobalZeileProStunde + $j] .= (($j * 60) / $GlobalZeileProStunde) . "
    \n"; - - echo "Stand: " . gmdate("Y-m-d H:i") . "\n"; - echo "\n"; - echo "\n"; - - } //isset($Vars) -} //isset($Action) -?> diff --git a/www-ssl_old/admin/shiftadd.php b/www-ssl_old/admin/shiftadd.php deleted file mode 100644 index d6b1f8ff..00000000 --- a/www-ssl_old/admin/shiftadd.php +++ /dev/null @@ -1,350 +0,0 @@ -\n"; - -// erstellt ein Array der Reume -$sql = "SELECT `RID`, `Name` FROM `Room` ORDER BY `Name`"; -$Erg = mysql_query($sql, $con); -$rowcount = mysql_num_rows($Erg); - -for ($i = 0; $i < $rowcount; $i++) { - $Room[$i]["RID"] = mysql_result($Erg, $i, "RID"); - $Room[$i]["Name"] = mysql_result($Erg, $i, "Name"); -} - -// erstellt ein Aray der Engeltypen -$sql = "SELECT `TID`, `Name` FROM `EngelType` ORDER BY `Name`"; -$Erg = mysql_query($sql, $con); -$rowcount = mysql_num_rows($Erg); - -for ($i = 0; $i < $rowcount; $i++) { - $EngelType[$i]["TID"] = mysql_result($Erg, $i, "TID"); - $EngelType[$i]["Name"] = mysql_result($Erg, $i, "Name") . Get_Text("inc_schicht_engel"); -} - -// sesion mit stanadrt werten bef�llen -if (!isset ($_SESSION['shiftadd.php']['SchichtName'])) { - $_SESSION['shiftadd.php']['SchichtName'] = "--???--"; - $_SESSION['shiftadd.php']['RID'] = ""; - $_SESSION['shiftadd.php']['MonthJahr'] = gmdate("Y-m", $Time); - $_SESSION['shiftadd.php']['SDatum'] = gmdate("d", $Time); - $_SESSION['shiftadd.php']['STime'] = "10"; - $_SESSION['shiftadd.php']['MoreThenOne'] = "ON"; - $_SESSION['shiftadd.php']['EDatum'] = gmdate("d", $Time); - $_SESSION['shiftadd.php']['ETime'] = "12"; - $_SESSION['shiftadd.php']['len'] = "2"; - $_SESSION['shiftadd.php']['NachtON'] = "OFF"; - $_SESSION['shiftadd.php']['len_night'] = "00-04-08-10-12-14-16-18-20-22-24"; -} -// wenn werte �bergeben in sesion eintragen -if (!isset ($_GET["NachtON"])) - $_GET["NachtON"] = "OFF"; -if (!isset ($_GET["MoreThenOne"])) - $_GET["MoreThenOne"] = "OFF"; -if (isset ($_GET["SchichtName"])) { - foreach ($_GET as $k => $v) { - $_SESSION['shiftadd.php'][$k] = $v; - } -} - -if (!IsSet ($_GET["action"])) - $_GET["action"] = "new"; - -switch ($_GET["action"]) { - case 'new' : -?> -Hier kannst du neue Schichten eintragen. Dazu musst du den Anfang und das Ende der Schichten eintragen. -Über die Länge der Schichten errechnet sich dadurch die Anzahl dieser. Dadurch können gleich -mehrere Schichten auf einmal erfasst werden: - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"; - echo " \n"; - } -?> -
    Name:">
    Ort:
    Zeit:
    Month.Jahr:">
    Beginn:Date"> - Time">
    More then One>
    End:Date"> - Time">
    Länge in h:">
    Sonderschichten ein:>
    Sonder in h (Time;Time):">
    Anzahl Engel je Type:
    " . $TTemp["Name"] . ":
    -
    - - - -
    - - 0)) { - $lenOrg = $_GET["len"]; - if ($_GET["NachtON"] == "ON") { - $lenArrayDummy = explode("-", $_GET["len_night"]); - foreach ($lenArrayDummy as $Temp) { - if (isset ($Temp2)) - $lenArray[intval($Temp2)] = intval($Temp) - intval($Temp2); - $Temp2 = $Temp; - } //foreach - } //IF( $NachtON == "ON" ) - - echo "\n"; - echo "\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\n"; - - $DateEnd = $_GET["SDatum"]; - $TimeEnd = intval($_GET["STime"]); - $len = 0; - do { - // define Start time - $Date = $DateEnd; - $Time = $TimeEnd; - $_DateS = $_GET["MonthJahr"] . "-" . $Date . " " . $Time . ":00:00"; - - // define End time - if ($_GET["NachtON"] == "ON") { - if (!isset ($lenArray[$Time])) - die("Zeit $Time h nicht definiert."); - $_GET["len"] = $lenArray[$Time]; - if ($_GET["len"] < 1) - die("len <1"); - } - $TimeEnd = $Time + $_GET["len"]; - - //Tages�berschreitung - while ($TimeEnd >= 24) { - $TimeEnd -= 24; - $DateEnd += 1; - } - //ist schischt zu lang dan verk�rzen - if ($DateEnd > $_GET["EDatum"] || ($DateEnd == $_GET["EDatum"] && $TimeEnd >= $_GET["ETime"])) { - $_GET["len"] -= ($DateEnd - $_GET["EDatum"]) * 24; - $_GET["len"] -= ($TimeEnd - $_GET["ETime"]); // -(-) ->> + - $DateEnd = $_GET["EDatum"]; - $TimeEnd = $_GET["ETime"]; - } - $_DateE = $_GET["MonthJahr"] . "-" . $DateEnd . " " . $TimeEnd . ":00:00"; - - if ($_DateS != $_DateE) - CreateNewEntry(); - - if ($_GET["MoreThenOne"] != "ON") - break; - if ($DateEnd >= $_GET["EDatum"] && $TimeEnd >= intval($_GET["ETime"])) - break; - } - while (true); - echo "
    StartEndlenRIDBeschreibungEntry 'Shifts'SIDEntrys
    "; - - if ($_GET["OnlyShow"] == "ON") { - echo "
    "; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - echo "\n\t"; - foreach ($EngelType As $TTemp) { - $Temp = "EngelType" . $TTemp["TID"]; - echo "\n\t"; - } - echo "\n\t"; - echo "\n\t"; - echo "\n
    "; - } //if - } //IF - break; - - case 'engeldel' : - break; - -} // end switch - -function CreateNewEntry() { - global $con, $_DateS, $_DateE, $EngelType, $debug; - foreach ($EngelType As $TTemp) { - $Temp = "EngelType" . $TTemp["TID"]; - global $$Temp; - } - - echo "\n"; - - echo "\t$_DateS\n"; - echo "\t$_DateE\n"; - echo "\t" . $_GET["len"] . "\n"; - echo "\t" . $_GET["RID"] . "\n"; - echo "\t" . $_GET["SchichtName"] . "\n"; - - // Ist eintarg schon vorhanden? - $SQL = "SELECT `SID` FROM `Shifts` "; - $SQL .= "WHERE (" . - "`DateS` = '" . $_DateS . "' AND " . - "`DateE` = '" . $_DateE . "' AND " . - "`RID` = '" . $_GET["RID"] . "');"; - $Erg = mysql_query($SQL, $con); - - if (mysql_num_rows($Erg) != 0) - echo "\texists"; - elseif ($_GET["OnlyShow"] == "OFF") { - // erstellt Eintrag in Shifts f�r die algemeine schicht - $SQL = "INSERT INTO `Shifts` ( `DateS`, `DateE`, `Len`, `RID`, `Man`) VALUES ( "; - $SQL .= "'" . $_DateS . "', '" . $_DateE . "', "; - $SQL .= "'" . $_GET["len"] . "', '" . $_GET["RID"] . "', "; - $SQL .= "'" . $_GET["SchichtName"] . "');"; - $Erg = db_query($SQL, "create shift"); - - $SQLFail = "\n\t
    [" . $SQL . "]"; - - if ($Erg == 1) - echo "\tpass\n"; - else - echo "\tfail
    \n" . mysql_error($con) . "$SQLFail\n"; - - } else - echo "\tonly show\n"; - - // sucht SID von eingetragennen schiten - $SQL = "SELECT SID FROM `Shifts` "; - $SQL .= "WHERE (" . - "`DateS` = '" . $_DateS . "' AND " . - "`DateE` = '" . $_DateE . "' AND " . - "`Len` = '" . $_GET["len"] . "' AND " . - "`RID` = '" . $_GET["RID"] . "');"; - $Erg = mysql_query($SQL, $con); - if (mysql_num_rows($Erg) == 0) - echo "\t?"; - else { - $SID = mysql_result($Erg, 0, "SID"); - echo "\t" . $SID . ""; - } - - // erstellt f�r jeden Engeltypen die eintrage in 'ShiftEntry' - echo "\t"; - foreach ($EngelType As $TTemp) { - $Temp = "EngelType" . $TTemp["TID"]; - - if ($_GET[$Temp] > 0) { - $i = 0; - echo $_GET[$Temp] . " " . $TTemp["Name"] . "
    \t"; - while ($i++ < $_GET[$Temp]) { - if ($_GET["OnlyShow"] == "OFF") { - $SQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`) VALUES ("; - $SQL .= "'" . $SID . "', "; - $SQL .= "'" . $TTemp["TID"] . "');"; - - $Erg = mysql_query($SQL, $con); - - if ($debug) - $SQLFail = "\n\t
    [" . $SQL . "]"; - - if ($Erg == 1) - echo "'pass' "; - else - echo "'fail' " . mysql_error($con) . "$SQLFail\n"; - - } else - echo "+"; - } - echo "
    "; - } // IF $$TEMP - } // FOREACH - echo ""; - - echo "\n"; -} - -include ("includes/footer.php"); -?> diff --git a/www-ssl_old/admin/tshirt.php b/www-ssl_old/admin/tshirt.php deleted file mode 100644 index 9a8e7010..00000000 --- a/www-ssl_old/admin/tshirt.php +++ /dev/null @@ -1,62 +0,0 @@ -"; - } -} -?> - -Über die Suchen-Funktion des Browsers kann diese Liste schnell nach einem Nick abgesucht werden.
    -Hinter diesem erscheint ein Link, über den man eintragen kann, dass der Engel sein T-Shirt erhalten hat.

    - -Liste aller aktiven Engel: - - - - - - - - - -\n"; - $eUID = mysql_result($Erg, $i, "UID"); - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - - if (mysql_result($Erg, $i, "Tshirt") == "1") { - echo "\t\t"; - } else { - echo "\t\t"; - } - echo "\t\n"; -} - -echo "
    NickAktiv?GrösseT-Shirt ausgeben:" . UID2Nick($eUID) . "" . mysql_result($Erg, $i, "Aktiv") . "" . mysql_result($Erg, $i, "Size") . "bereits erhaltenXXXXXXXX
    "; - -include ("includes/footer.php"); -?> - diff --git a/www-ssl_old/admin/userArrived.php b/www-ssl_old/admin/userArrived.php deleted file mode 100644 index 93857d2e..00000000 --- a/www-ssl_old/admin/userArrived.php +++ /dev/null @@ -1,53 +0,0 @@ -" . Get_Text("pri_userArrived_WriteOK") . " \"" . UID2Nick($_GET["arrived"]) . "\""; - } else { - echo "

    " . Get_Text("pri_userArrived_WriteError") . " \"" . UID2Nick($_GET["arrived"]) . "\"

    "; - } -} - -echo Get_Text("pri_userArrived_Text1") . "
    "; -echo Get_Text("pri_userArrived_Text2") . "

    "; - -echo Get_Text("pri_userArrived_TableToppic"); -$SQL = "SELECT * FROM `User` ORDER BY `Nick` ASC"; -$Erg = mysql_query($SQL, $con); - -$rowcount = mysql_num_rows($Erg); - -echo "\n"; -echo "\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\t\n"; -echo "\t\n"; - -for ($i = 0; $i < $rowcount; $i++) { - echo "\t\n"; - $eUID = mysql_result($Erg, $i, "UID"); - echo "\t\t\n"; - echo "\t\t\n"; - - if (mysql_result($Erg, $i, "Gekommen") == "1") { - echo "\t\t"; - } else { - echo "\t\t"; - } - echo "\t\n"; -} -echo "
    " . Get_Text("pri_userArrived_TableTD_Nick") . "" . Get_Text("pri_userArrived_TableTD_ArrivedShow") . "" . Get_Text("pri_userArrived_TableTD_ArrivedSet") . "
    " . UID2Nick($eUID) . "" . mysql_result($Erg, $i, "Gekommen") . "" . Get_Text("pri_userArrived_TableEntry_Arrived") . "" . Get_Text("pri_userArrived_TableEntry_Set") . "
    "; - -include ("includes/footer.php"); -?> - diff --git a/www-ssl_old/nonpublic/myschichtplan_ical.php b/www-ssl_old/nonpublic/myschichtplan_ical.php deleted file mode 100644 index ff74fef0..00000000 --- a/www-ssl_old/nonpublic/myschichtplan_ical.php +++ /dev/null @@ -1,51 +0,0 @@ - - diff --git a/www-ssl_old/nonpublic/schichtplan.1.php b/www-ssl_old/nonpublic/schichtplan.1.php deleted file mode 100644 index 9c99c6ca..00000000 --- a/www-ssl_old/nonpublic/schichtplan.1.php +++ /dev/null @@ -1,20 +0,0 @@ -

     Tage

    - -$Datum\n"; -} //function Printlink( - -if (isset ($VeranstaltungsTage)) - foreach ($VeranstaltungsTage as $k => $v) - Printlink($v); -?> diff --git a/www-ssl_old/nonpublic/schichtplan.2.php b/www-ssl_old/nonpublic/schichtplan.2.php deleted file mode 100644 index 92443e13..00000000 --- a/www-ssl_old/nonpublic/schichtplan.2.php +++ /dev/null @@ -1,22 +0,0 @@ -

     Raumübersicht

    -" . - $RoomEntry["Name"] . "\n"; - else - echo "\t
  • " . - $RoomEntry["Name"] . "
  • \n"; - } -echo "
    "; -if (isset ($ausdatum)) - echo "
  • alle
  • "; -else - echo "
  • alle
  • "; -?> - diff --git a/www-ssl_old/nonpublic/schichtplan.php b/www-ssl_old/nonpublic/schichtplan.php deleted file mode 100644 index 2b9038a3..00000000 --- a/www-ssl_old/nonpublic/schichtplan.php +++ /dev/null @@ -1,220 +0,0 @@ - $v) { - if (substr($k, 0, 5) == "raum_") { - $raum = $raum . ";" . $v; - } - } - } -} - -<<<<<<< HEAD -include ("../../includes/header.php"); -include ("../../includes/funktionen.php"); -include ("../../includes/funktion_schichtplan.php"); -include ("../../includes/funktion_schichtplan_array.php"); -?> -======= -include ("includes/header.php"); -include ("includes/funktionen.php"); -include ("includes/funktion_schichtplan.php"); -include ("includes/funktion_schichtplan_aray.php"); ->>>>>>> spezial_includes_camp - -echo Get_Text("Hello") . $_SESSION['Nick'] . ",
    " . -Get_Text("pub_schicht_beschreibung") . "

    "; - -function ShowSwitchDay() { - global $VeranstaltungsTage, $VeranstaltungsTageMax, $ausdatum, $raum; - - echo "\n\n\n"; - - if (isset ($VeranstaltungsTage)) - foreach ($VeranstaltungsTage as $k => $v) - if ($ausdatum == $v) { - if ($k > 0) - echo "\t\t\t\n"; - if ($k < $VeranstaltungsTageMax) - echo "\t\t\t\n"; - } - echo "\n\n
    " . - "" . $VeranstaltungsTage[$k -1] . "" . - "" . $VeranstaltungsTage[$k +1] . "
    "; -} - -// wenn kein Datum gesetzt ist (die Seite zum ersten mal aufgerufen wird), -// das Datum auf den ersten Tag setzen... -if (!isset ($ausdatum)) { - $sql = "SELECT `DateS` FROM `Shifts` WHERE `DateS` like '" . gmdate("Y-m-d", time() + $gmdateOffset) . "%' ORDER BY `DateS`"; - // $sql = "SELECT `DateS` FROM `Shifts` WHERE `DateS` like '2004-12-29%' ORDER BY `DateS`"; - $Erg = mysql_query($sql, $con); - if (mysql_num_rows($Erg) == 0) { - $sql = "SELECT `DateS` FROM `Shifts` ORDER BY `DateS` ASC LIMIT 0, 1"; - $Erg = mysql_query($sql, $con); - } - if (mysql_num_rows($Erg) > 0) - $ausdatum = substr(mysql_result($Erg, 0, "DateS"), 0, 10); - else - $ausdatum = gmdate("Y-m-d", time() + $gmdateOffset); - -} - -if (!isset ($raum)) { - // Ausgabe wenn kein Raum Ausgew�hlt: - echo Get_Text("pub_schicht_auswahl_raeume") . "

    \n"; - -<<<<<<< HEAD - -if ( !isset($raum) ) -{ - // Ausgabe wenn kein Raum Ausgew�hlt: - echo Get_Text("pub_schicht_auswahl_raeume"). "

    \n"; - - if( isset($Room)) - { -======= - if (isset ($Room)) { ->>>>>>> spezial_includes_camp - echo "
    \n"; - foreach ($Room as $RoomEntry) { - echo "\t
  • "; - echo "" . $RoomEntry["Name"] . ""; - echo "
  • \n"; - } - echo ""; - echo ""; - echo "\n"; - echo "
    \n"; - } - - echo "

    "; - echo Get_Text("pub_schicht_alles_1") . " " . - Get_Text("pub_schicht_alles_2") . " " . Get_Text("pub_schicht_alles_3"); - echo "\n

    \n\n"; - echo "
    \n\n"; - echo Get_Text("pub_schicht_EmptyShifts") . "\n"; - - // zeit die naesten freien schichten -<<<<<<< HEAD - showEmptyShifts(); -} -else -{ // Wenn einraum Ausgew�hlt ist: - if( $raum == -1 ) - echo Get_Text("pub_schicht_Anzeige_1").$ausdatum.":

    "; - elseif( substr( $raum, 0, 1) == ";" ) - echo Get_Text("pub_schicht_Anzeige_1").$ausdatum.":

    "; - else - echo Get_Text("pub_schicht_Anzeige_1"). $ausdatum. - Get_Text("pub_schicht_Anzeige_2"). $RoomID[$raum]. "

    "; -======= - showEmptyShifts(); -} else { // Wenn einraum Ausgew�hlt ist: - if ($raum == -1) - echo Get_Text("pub_schicht_Anzeige_1") . $ausdatum . ":

    "; - elseif (substr($raum, 0, 1) == ";") echo Get_Text("pub_schicht_Anzeige_1") . $ausdatum . ":

    "; - else - echo Get_Text("pub_schicht_Anzeige_1") . $ausdatum . - Get_Text("pub_schicht_Anzeige_2") . $RoomID[$raum] . "

    "; ->>>>>>> spezial_includes_camp - - ShowSwitchDay(); - - echo "\n\n\n"; - echo "\t\n"; - echo "\t\t\n"; - - //Ausgabe Spalten �berschrift -<<<<<<< HEAD - if( $raum == -1 ) - { - if( isset($Room)) - foreach( $Room as $RoomEntry ) - if (SummRoomShifts($RoomEntry["RID"]) > 0) - echo "\t\t\n"; -======= - if ($raum == -1) { - if (isset ($Room)) - foreach ($Room as $RoomEntry) - if (SummRoomShifts($RoomEntry["RID"]) > 0) - echo "\t\t\n"; ->>>>>>> spezial_includes_camp - } - elseif (substr($raum, 0, 1) == ";") { - $words = preg_split("/;/", $raum); - foreach ($words as $word) { - if (strlen(trim($word)) > 0) - echo "\t\t\n"; - } - } else - echo "\t\t\n"; - echo "\t\n"; - - //Zeit Ausgeben - for ($i = 0; $i < 24; $i++) - for ($j = 0; $j < $GlobalZeileProStunde; $j++) { - $Spalten[$i * $GlobalZeileProStunde + $j] = "\t\n\t\t"; - - //Stunde: - $SpaltenTemp = ""; - $SpaltenTemp .= ($i < 10) ? "0$i:" : "$i:"; - - //Minute - $TempMinuten = (($j * 60) / $GlobalZeileProStunde); - $SpaltenTemp .= ($TempMinuten < 10) ? "0$TempMinuten" : "$TempMinuten"; - - //aktuelle stunde markieren - if (($j == 0) && ($i == gmdate("H", time() + $gmdateOffset)) && (gmdate("Y-m-d", time() + $gmdateOffset) == $ausdatum)) - $SpaltenTemp = "

    $SpaltenTemp

    "; - - $SpaltenTemp = "\n"; - $Spalten[$i * $GlobalZeileProStunde + $j] .= $SpaltenTemp; - } - - if ($raum == -1) { - if (isset ($Room)) - foreach ($Room as $RoomEntry) - if (SummRoomShifts($RoomEntry["RID"]) > 0) - CreateRoomShifts($RoomEntry["RID"]); - } - elseif (substr($raum, 0, 1) == ";") { - if (isset ($Room)) { - $words = preg_split("/;/", $raum); - foreach ($words as $word) { - if (strlen(trim($word)) > 0) - if (SummRoomShifts($word) > 0) - CreateRoomShifts($word); - } - } - } else - CreateRoomShifts($raum); - - //Ausageb Zeilen - for ($i = 0; $i < (24 * $GlobalZeileProStunde); $i++) { - echo $Spalten[$i] . "\t\n"; - } - - echo "
    start". $RoomEntry["Name"]. "" . $RoomEntry["Name"] . "" . $RoomID[trim($word)] . "" . $RoomID[$raum] . "
    $SpaltenTemp
    \n"; - - ShowSwitchDay(); - -} //if (isset($raum)) - -echo "@"; - -include ("includes/footer.php"); -?> diff --git a/www-ssl_old/nonpublic/schichtplan_beamer.php b/www-ssl_old/nonpublic/schichtplan_beamer.php deleted file mode 100644 index 269660e1..00000000 --- a/www-ssl_old/nonpublic/schichtplan_beamer.php +++ /dev/null @@ -1,59 +0,0 @@ - - - - - -Schichtpläne für Beamer - - - - - -\n"; - -echo " - - - - - \n"; - -echo "\n" . -"" . gmdate("d.m.y", $Time) . "\n" . -"" . gmdate("H", $Time -3600) . ":00\n" . -"" . gmdate("H", $Time +0) . ":00\n" . -"" . gmdate("H", $Time +3600) . ":00\n" . -"\n"; - -foreach ($Room as $RoomEntry) { - // var-init - $AnzahlEintraege = 0; - - $Out = ausgabe_Zeile($RoomEntry["RID"], $Time -3600, $AnzahlEintraege); - $Out .= ausgabe_Zeile($RoomEntry["RID"], $Time, $AnzahlEintraege); - $Out .= ausgabe_Zeile($RoomEntry["RID"], $Time +3600, $AnzahlEintraege); - - if ($AnzahlEintraege == 0) - $Out = ""; - else - $Out = "\n_" . $RoomEntry["Name"] . "_\n" . $Out . "\n"; - - echo $Out; -} -?> - - - - -