diff --git a/Admin/Modules/Home/index.php b/Admin/Modules/Home/index.php
index 6a9843a..392ef63 100755
--- a/Admin/Modules/Home/index.php
+++ b/Admin/Modules/Home/index.php
@@ -3,28 +3,33 @@ include ($_SERVER["DOCUMENT_ROOT"]."/Site/checkadmin.php");
//include ($_SERVER["DOCUMENT_ROOT"]."/Config/_siteconfig_.php");
?>
-
Administration Center
-
-
-
-Actions:
-
- # ".$modtitle."
- ";
- }
-?>
-# PhpMyAdmin
-
-
-
-
-
-
+
+
+
+
Administration Center
+
+
+
+ Actions:
+
+ # ".$modtitle."
+ ";
+ }
+ ?>
+ # PhpMyAdmin
+
+
+
+
+
+
+
+
diff --git a/Admin/Modules/Logviewer/index.php b/Admin/Modules/Logviewer/index.php
index 218a0cc..8588eb8 100755
--- a/Admin/Modules/Logviewer/index.php
+++ b/Admin/Modules/Logviewer/index.php
@@ -18,29 +18,32 @@ include ($_SERVER["DOCUMENT_ROOT"]."/Config/_dbconfig_.php");
?>
-
- Squid ID (HEX):
-
-
-
-
-
-
-Current Squid User:
- 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5,
- 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 'A',
- 11 => 'B', 12 => 'C', 13 => 'D', 14 => 'E',
- 15 => 'F' );
-
- do
- {
- $h = $hex[($dec%16)] . $h;
- $dec /= 16;
- }
- while( $dec >= 1 );
-
- return $sign . $h;
-}
-
- $zeile = exec(escapeshellcmd("cat ".db_getconfval("sqddir")."/vpnid"));
- $zeile = dec_to_hex($zeile);
- //echo $zeile;
- if(strlen ($zeile) <2)
- {
- $zeile = "0".$zeile;
- }
- if(strlen ($zeile) >2)
- {
- $zeile=substr($zeile, 0, -1);
- }
- @$y = mysql_connect($MYSQL_HOST,$MYSQL_USER,$MYSQL_PASS);
- @$x = mysql_select_db($MYSQL_DATABASE);
- if (empty($x))
- {
- echo "ERROR 0x01, Failed to connect to database! ";
- exit;
- }
- $sql4 = "SELECT * FROM userdata WHERE VPNId = '".$zeile."';";
- $result4 = mysql_query($sql4);
- //echo $sql4;
- $ar4=mysql_fetch_array($result4,MYSQL_ASSOC);
- echo "" . $ar4["Vorname"] . " " . $ar4["Nachname"] . " VPNId: " . $ar4["VPNId"]." ";
- mysql_close();
-?>
-
-
-
-
-Blacklisted Accounts:
-Blacklist cleared successfully!";
- }
- ?>
-
- Squid ID Nickname Vorname Nachname
-";
- exit;
- }
-
- $hascontent = true;
- if (strlen($zeile) >2)
- {
- $zeile=substr($zeile, 0, -1);
- }
- $sql3 = "SELECT * FROM userdata WHERE VPNId = '".$zeile."';";
- $result3 = mysql_query($sql3);
- $ar3=mysql_fetch_array($result3,MYSQL_ASSOC);
- $nick = $ar3["Nickname"];
- if($nick == "")
- $hascontent=false;
- $vor = $ar3["Vorname"];
- if($vor == "")
- $hascontent=false;
- $nach = $ar3["Nachname"];
- if($nach == "")
- $hascontent=false;
-
- if($hascontent == true)
- {
- $blindex = $blindex+1;
- echo "".$zeile." ".$nick." ".$vor." ".$nach." ";
- }
- mysql_close();
- }
-
-?>
-
- Blacklisted accounts:
-
- out of:
- ';
- elseif (count($openssl['Database'])-1 == 1)
- {
- echo '1 certificate';
- }
- elseif (count($openssl['Database'])-1 > 1)
- {
- echo '';
- echo count($openssl['Database'])-1;
- echo ' certificates';
- }?>
-
-
-
-
-
-
-
-
-
-User changed Proxy Accounts:
-
-
-
- value="ASC">Up
- value="DESC">Down
-
-
- value="Id">ID
- value="VPNId">VPNId
- value="Time">Time
- value="IP">IP
- value="Nickname">Nickname
-
-Search User: >
-
-
-
-
-";
- exit;
- }
- // MYsql befehl basteln
-
-
- if($by == "Nickname")
- {
- $sql = "SELECT * FROM proxyrepair;";
- }
- else
- {
- $sql = "SELECT * FROM proxyrepair ORDER BY $by $sort;";
- }
-
- $result = mysql_query($sql);
- echo "";
- echo "User ID VPN Id Nickname Vorname Nachname Client IP Time Dead VPN ID \n";
-// ------------------------------------------------ Mysql lesen
- if ($result)
- {
- while ($ar=mysql_fetch_array($result,MYSQL_ASSOC))
- {
-
- $sql = "SELECT * FROM userdata WHERE Id = '".$ar["Id"]."' AND (Nickname LIKE '%".$search."%' OR Vorname LIKE '%".$search."%' OR Id LIKE '%".$search."%' OR VPNId LIKE '%".$search."%');";
- $result2 = mysql_query($sql);
- $ar2=mysql_fetch_array($result2,MYSQL_ASSOC);
-
- if($ar2["Nickname"] != "")
- echo "",$ar["Id"]," ",$ar["VPNId"]," ",$ar2["Nickname"]," ",$ar2["Vorname"]," ",$ar2["Nachname"],
- " ", $ar["IP"]," ",$ar["Time"]," ",$ar["RepID"]," \n";
- }
- }
- else
- {
- echo " ";
- }
- echo "
";
- mysql_close();
-?>
-
diff --git a/Admin/Modules/Squid/index_log.php b/Admin/Modules/Squid/index_log.php
deleted file mode 100644
index 625f00e..0000000
--- a/Admin/Modules/Squid/index_log.php
+++ /dev/null
@@ -1,30 +0,0 @@
-";
- exit;
-}
- $sort = mysql_real_escape_string($_POST["dirsort"]); //$_GET["sort"];
- $by = mysql_real_escape_string($_POST["sortby"]); //$_GET["by"];
- $userid = mysql_real_escape_string($_POST["userid"]); //$_GET["userid"];
- $search = mysql_real_escape_string($_POST["search"]); //$_GET["search"];
-
-$moduleurl = $_SERVER["REQUEST_URI"];
-$urlcut = strpos($moduleurl, "&");
-$moduleurl = substr($moduleurl,0,$urlcut);
-?>
-
-Squid Logs
-
-
diff --git a/Admin/Modules/Squid/squid_dynamic/README b/Admin/Modules/Squid/squid_dynamic/README
deleted file mode 100644
index 6f55fcd..0000000
--- a/Admin/Modules/Squid/squid_dynamic/README
+++ /dev/null
@@ -1,3 +0,0 @@
-export CPATH=..:$HOME/include:/usr/local/include:/usr/include:/usr/include/mysql
-needed: libmysqlclient-dev
-gcc -l mysqlclient -o traffic Traffic.c
diff --git a/Admin/Modules/Squid/squid_dynamic/db.conf b/Admin/Modules/Squid/squid_dynamic/db.conf
deleted file mode 100755
index f902996..0000000
--- a/Admin/Modules/Squid/squid_dynamic/db.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-user: openvpn
-passwd: openvpnlog
-database: openvpn
-host: localhost
diff --git a/Admin/Modules/Squid/squid_dynamic/hexer b/Admin/Modules/Squid/squid_dynamic/hexer
deleted file mode 100755
index 6a24092..0000000
--- a/Admin/Modules/Squid/squid_dynamic/hexer
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-let x=0x3f
-echo $x
-
-
-let x=0xfffe
-echo $x
diff --git a/Admin/Modules/Squid/squid_dynamic/squid_dyn.c b/Admin/Modules/Squid/squid_dynamic/squid_dyn.c
deleted file mode 100644
index 6fa1665..0000000
--- a/Admin/Modules/Squid/squid_dynamic/squid_dyn.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* OpenVPN - Squid Load Balancer*
- *------------------------------*
- * Version 1.0 *
- * Written by Christoph Haas *
- * License: LGPL *
- * 12.10.2010 *
- */
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#define __MAX_LINE__ 100
-#define __MAX_FIELD__ 255
-#define false 0
-#define true 1
-
-
-MYSQL mysql;
-
-int connect_db(char *config)
-{
- FILE *db_data = NULL;
- regex_t reg;
- char user[__MAX_LINE__] = "";
- char passwd[__MAX_LINE__] = "";
- char database[__MAX_LINE__] = "";
- char host[__MAX_LINE__] = "";
- int port = 0;
- char tmp[__MAX_LINE__];
- char buf[__MAX_LINE__];
- int a, b;
- int length;
-
- if((db_data = fopen(config, "r")) == NULL)
- {
- fprintf(stderr, "Can't open %s for reading.\n", config);
- return false;
- }
- regcomp(®, "^([a-zA-Z0-9:]+)[ ][a-zA-Z0-9]+$", REG_EXTENDED | REG_NEWLINE);
- while(fgets(buf, __MAX_LINE__, db_data))
- {
- length = strlen(buf);
- if(length < 3)continue;
- if(length >= __MAX_LINE__)
- {
- fclose(db_data);
- regfree(®);
- fprintf(stderr, "To long line in config file.\n");
- return false;
- }
- if(buf[0] == '#')continue;
- if(regexec(®, buf, 0, 0, 0))
- {
- fclose(db_data);
- regfree(®);
- fprintf(stderr, "Syntax error in config file.\n");
- return false;
- }
- for(a = 0, b = 0; a < strlen(buf); a++)
- {
- if(buf[a] == ' ')b++;
- }
- if(b != 1)
- {
- fclose(db_data);
- regfree(®);
- fprintf(stderr, "Syntax error in config file.\n");
- return false;
- }
- if((strncmp(buf, "user: ", 6)) == 0)sscanf(buf, "%s %s", tmp, user);
- if((strncmp(buf, "passwd: ", 8)) == 0)sscanf(buf, "%s %s", tmp, passwd);
- if((strncmp(buf, "database: ", 10)) == 0)sscanf(buf, "%s %s", tmp, database);
- if((strncmp(buf, "host: ", 6)) == 0)sscanf(buf, "%s %s", tmp, host);
- if((strncmp(buf, "port: ", 6)) == 0)sscanf(buf, "%s %d", tmp, &port);
- }
- fclose(db_data);
- regfree(®);
- if((strlen(user) < 1) || (strlen(passwd) < 1) ||
- (strlen(database) < 1) || (strlen(host) < 1))
- {
- fprintf(stderr, "One value for MySQL connection isn't set. \
- Please set user, passwd, database and host.\n");
- return false;
- }
-
-
- mysql_init(&mysql);
- if((mysql_real_connect(&mysql, host, user, passwd, database, port, NULL, 0)) == NULL)
- {
- fprintf(stderr, "%s\n", mysql_error(&mysql));
- return false;
- }
- return true;
-}
-
-int main(int argc, char **argv)
-{
- MYSQL_RES *result;
- MYSQL_ROW row;
- char Query[200]= "SELECT * FROM userdata WHERE VPNId = '\0";
-
- if(argc == 2)
- {
- /*iID = atoi(argv[1]);
- printf("Int:%d\n", iID);
- sprintf(ID,"%-#10x",iID);
- printf("String:%s\n", ID);*/
-
- connect_db("/home/christoph/squid_dynamic/db.conf"); // Datenbank Verbindung aufbauen
-
- strcat(Query, argv[1]); // Query builden
- strcat(Query,"'"); //
-
- mysql_query(&mysql, Query); // Query abschicken
- result = mysql_store_result(&mysql); // Result speichern
-
- while ((row = mysql_fetch_row(result))) // Alle Datensätze auslesen (in dem Fall eh nur einer)
- {
- printf("%s:%s\n", row[9], row[10]); // Feld 9 und 10 (login/pass) aus dem datensatz ausgeben
- }
-
- mysql_free_result(result); // Result wieder löschen
- mysql_close(&mysql); // Datenbank Verbindung schliesen
- }
- else
- {
- printf("USAGE: sqidy xx | xx = VPNId\n"); // bei flascheingabe der Parameter
- }
-}
diff --git a/Admin/Modules/Squid/squid_dynamic/squidy b/Admin/Modules/Squid/squid_dynamic/squidy
deleted file mode 100755
index 677c5da..0000000
Binary files a/Admin/Modules/Squid/squid_dynamic/squidy and /dev/null differ
diff --git a/Admin/Modules/Squid/squid_dynamic/squidy.bak b/Admin/Modules/Squid/squid_dynamic/squidy.bak
deleted file mode 100755
index 726712c..0000000
Binary files a/Admin/Modules/Squid/squid_dynamic/squidy.bak and /dev/null differ
diff --git a/Admin/Modules/Squid/squid_dynamic/vpnid b/Admin/Modules/Squid/squid_dynamic/vpnid
deleted file mode 100644
index 4daddb7..0000000
--- a/Admin/Modules/Squid/squid_dynamic/vpnid
+++ /dev/null
@@ -1 +0,0 @@
-00
diff --git a/Admin/Modules/Squid/squid_dynamic/write_conf b/Admin/Modules/Squid/squid_dynamic/write_conf
deleted file mode 100755
index 9e3e244..0000000
--- a/Admin/Modules/Squid/squid_dynamic/write_conf
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/bin/bash
-
-# Zaehlvariable einlesen
-id=$ID_VPN
-
-# Abfrage ob Stringlaenge von id NULL ist
-if [ ${#ID_VPN} == 0 ];
-then id=0
-fi
-
-# id inkrementieren
-let id=$id+1
-
-# 255 Overflow verhindern
-if [ $id -gt 254 ]
-then id=0
-fi
-
-# Variable id fuer naechsten Durchlauf speichern
-export ID_VPN=$id
-
-# id HEX wandeln
-hex=$(echo "obase=16; $id" |bc)
-
-# Abfrage ob Strinlaenge von hex kleiner als 2
-if [ ${#hex} -lt 2 ];
-then hex=0$hex
-fi
-
-# Login-Daten aus Datenbank holen
-credentials=$(./squidy $hex)
-# Abfrage ob Datensatz leer :
-zero="0"
-
-if [ "$credentials" == ":" ];
-then
- . write_conf &
- zero="1"
-fi
-if [ ${#credentials} == 0 ];
-then
- . write_conf &
- zero="1"
-fi
-
-######################################################################################
-
-# Config- Datei schreiben.
-if [ $zero == "0" ]
-then
-echo "
-# Squid config by h44z
-
-# TAG: http_port
-# Usage: port
-# hostname:port
-# 1.2.3.4:port
-http_port 10.8.0.1:3128 transparent
-http_port 10.8.0.1:8080
-#https_port 10.8.0.1:8181 key=/etc/apache2/ssl/apache.pem
-
-
-visible_hostname vpnrack
-
-# TAG: icp_port
-icp_port 0
-
-# TAG: no_cache
-acl QUERY urlpath_regex cgi-bin \\?
-no_cache deny QUERY
-
-# TAG: cache_mem (bytes)
-cache_mem 32 MB
-
-# TAG: cache_dir
-cache_dir ufs /var/cache/squid 100 16 256
-
-# TAG: cache_access_log
-cache_access_log /var/log/squid/access.log
-
-# TAG: cache_log
-cache_log /var/log/squid/cache.log
-
-# TAG: cache_store_log
-cache_store_log /var/log/squid/store.log
-
-# TAG: emulate_httpd_log on|off
-emulate_httpd_log on
-
-# TAG: pid_filename
-pid_filename /var/run/squid.pid
-
-# TAG: cache_mgr
-cache_mgr christoph.haas2@students.htlinn.ac.at
-
-
-http_access allow all
-acl https port 443
-http_access allow https
-
-
-# TAG: http_reply_access
-# Allow replies to client requests. This is complementary to http_access.
-#http_reply_access allow all
-
-cache_peer 192.168.195.101 parent 8080 7 no-query default no-digest login=$credentials
-
-never_direct allow all
-" > /etc/squid3/squid.conf
-
-######################################################################################
-#restart squid
-killall -9 squid
-squid -D -YC -f /etc/squid3/squid.conf
-fi
diff --git a/Admin/Modules/Squid/squid_dynamic/write_conf_file b/Admin/Modules/Squid/squid_dynamic/write_conf_file
deleted file mode 100755
index 1e05d8e..0000000
--- a/Admin/Modules/Squid/squid_dynamic/write_conf_file
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/bin/bash
-# Script um die cache_peer funktion von Squid upzudaten.
-# V1.0
-# 13.10.2010
-# Stoeckholzer, Haas
-
-if [ ${#1} == 0 ];
-then
- echo "USAGE: write_conf_file updatetime"
- exit 0
-fi
-
-while [ "1" == "1" ] ;
-do
- sleep $1
- zero="1"
-
- while [ $zero == "1" ] ;
- do
-
- # Zaehlvariable einlesen
- id=$(cat /var/vpn/vpnid)
-
- # id inkrementieren
- let id=$id+1
-
- # 255 Overflow verhindern
- if [ $id -gt 254 ]
- then
- id=0
- fi
-
- # Variable id fuer naechsten Durchlauf speichern
- echo $id > /var/vpn/vpnid
-
- # id HEX wandeln
- hex=$(echo "obase=16; $id" |bc)
-
-
- # Abfrage ob Strinlaenge von hex kleiner als 2
- if [ ${#hex} -lt 2 ];
- then
- hex=0$hex
- fi
-
- black=$(cat /var/vpn/blacklist | grep $hex)
-
- if [ ${#black} -lt 2 ];
- then
- # Login-Daten aus Datenbank holen
- credentials=$(/home/christoph/squid_dynamic/squidy $hex)
- # Abfrage ob Datensatz leer :
-
- if [ ${#credentials} -gt 10 ];
- then
- zero="0"
- fi
- fi
- done
- echo "USING credentials: $credentials"
-
- sudo killall -9 unlinkd
- sudo killall -9 squid
-
- sudo rm /etc/squid3/squid.conf
-######################################################################################
-
-# Config- Datei schreiben.
-sudo echo -e -n "
-# Squid config by h44z
-
-# TAG: http_port
-# Usage: port
-# hostname:port
-# 1.2.3.4:port
-http_port 10.8.0.1:3128 transparent
-http_port 10.8.0.1:8080
-#https_port 10.8.0.1:8181 key=/etc/apache2/ssl/apache.pem
-
-
-visible_hostname vpnrack
-
-# TAG: icp_port
-icp_port 0
-
-# TAG: no_cache
-acl QUERY urlpath_regex cgi-bin \\?
-no_cache deny QUERY
-
-# TAG: cache_mem (bytes)
-cache_mem 32 MB
-
-# TAG: cache_dir
-cache_dir ufs /var/cache/squid 100 16 256
-
-# TAG: cache_access_log
-cache_access_log /var/log/squid/access.log
-
-# TAG: cache_log
-cache_log /var/log/squid/cache.log
-
-# TAG: cache_store_log
-cache_store_log /var/log/squid/store.log
-
-# TAG: emulate_httpd_log on|off
-emulate_httpd_log on
-
-# TAG: pid_filename
-pid_filename /var/run/squid.pid
-
-# TAG: cache_mgr
-cache_mgr christoph.haas2@students.htlinn.ac.at
-#blubber
-
-http_access allow all
-acl https port 443
-http_access allow https
-
-
-# TAG: http_reply_access
-# Allow replies to client requests. This is complementary to http_access.
-#http_reply_access allow all
-
-cache_peer 192.168.195.101 parent 8080 7 no-query default no-digest login=$credentials
-
-never_direct allow all
-" > /etc/squid3/squid.conf
-echo "Written credentials: $credentials"
-######################################################################################
- #restart squid
- sudo squid -D -YC -f /etc/squid3/squid.conf
-done
diff --git a/Admin/Modules/Squid/squid_dynamic/write_conf_file.bak b/Admin/Modules/Squid/squid_dynamic/write_conf_file.bak
deleted file mode 100755
index d3648c6..0000000
--- a/Admin/Modules/Squid/squid_dynamic/write_conf_file.bak
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/bin/bash
-# Script um die cache_peer funktion von Squid upzudaten.
-# V1.0
-# 13.10.2010
-# Stoeckholzer, Haas
-
-if [ ${#1} == 0 ];
-then
-echo "USAGE: write_conf_file updatetime"
-exit 0
-fi
-
-while [ "1" == "1" ] ; do
-
-sleep $1
-zero="1"
-
-while [ $zero == "1" ] ; do
-
-# Zaehlvariable einlesen
-id=$(cat /var/vpn/vpnid)
-
-# id inkrementieren
-let id=$id+1
-
-# 255 Overflow verhindern
-if [ $id -gt 254 ]
-then id=0
-fi
-
-# Variable id fuer naechsten Durchlauf speichern
-echo $id > /var/vpn/vpnid
-
-# id HEX wandeln
-hex=$(echo "obase=16; $id" |bc)
-
-# Abfrage ob Strinlaenge von hex kleiner als 2
-if [ ${#hex} -lt 2 ];
-then hex=0$hex
-fi
-
-# Login-Daten aus Datenbank holen
-credentials=$(/home/christoph/squid_dynamic/squidy $hex)
-# Abfrage ob Datensatz leer :
-
-if [ ${#credentials} -gt 10 ];
-then
- zero="0"
-fi
-echo "Schleife zero: $zero"
-echo "Schleife id: $id"
-echo "Schleife hex: $hex"
-done
-echo "USING zero: $zero"
-echo "USING id: $id"
-echo "USING hex: $hex"
-echo "USING credentials: $credentials"
-
-sudo killall -9 unlinkd
-sudo killall -9 squid
-
-sudo rm /etc/squid3/squid.conf
-######################################################################################
-
-# Config- Datei schreiben.
-sudo echo -e -n "
-# Squid config by h44z
-
-# TAG: http_port
-# Usage: port
-# hostname:port
-# 1.2.3.4:port
-http_port 10.8.0.1:3128 transparent
-http_port 10.8.0.1:8080
-#https_port 10.8.0.1:8181 key=/etc/apache2/ssl/apache.pem
-
-
-visible_hostname vpnrack
-
-# TAG: icp_port
-icp_port 0
-
-# TAG: no_cache
-acl QUERY urlpath_regex cgi-bin \\?
-no_cache deny QUERY
-
-# TAG: cache_mem (bytes)
-cache_mem 32 MB
-
-# TAG: cache_dir
-cache_dir ufs /var/cache/squid 100 16 256
-
-# TAG: cache_access_log
-cache_access_log /var/log/squid/access.log
-
-# TAG: cache_log
-cache_log /var/log/squid/cache.log
-
-# TAG: cache_store_log
-cache_store_log /var/log/squid/store.log
-
-# TAG: emulate_httpd_log on|off
-emulate_httpd_log on
-
-# TAG: pid_filename
-pid_filename /var/run/squid.pid
-
-# TAG: cache_mgr
-cache_mgr christoph.haas2@students.htlinn.ac.at
-#blubber
-
-http_access allow all
-acl https port 443
-http_access allow https
-
-
-# TAG: http_reply_access
-# Allow replies to client requests. This is complementary to http_access.
-#http_reply_access allow all
-
-cache_peer 192.168.195.101 parent 8080 7 no-query default no-digest login=$credentials
-
-never_direct allow all
-" > /etc/squid3/squid.conf
-echo "Written credentials: $credentials"
-######################################################################################
-#restart squid
-sudo squid -D -YC -f /etc/squid3/squid.conf
-
-done
diff --git a/Admin/Modules/Squid/squid_dynamic/write_conf_manuell b/Admin/Modules/Squid/squid_dynamic/write_conf_manuell
deleted file mode 100755
index c42e48e..0000000
--- a/Admin/Modules/Squid/squid_dynamic/write_conf_manuell
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/bin/bash
-# Script um die cache_peer funktion von Squid manuell von der Website aus upzudaten.
-# V1.0
-# 13.10.2010
-# Stoeckholzer, Haas
-
-while [ "1" == "1" ];
-do
-
- write=1
- zero=0
- # ueberpruefen ob file vpnid_man vorhanden
- if [ -e /var/vpn/vpnid_man ];
- then
- echo 1
- zero=1
- fi
-
- # ueberpruefen ob file vpnid_next vorhanden
- if [ -e /var/vpn/vpnid_next ];
- then
- echo 2
- zero=2
- fi
-
-
-
- if [ "$zero" == "1" ];
- then
- # Manuelle ID als hex einlesen einlesen
- hex=$(cat /var/vpn/vpnid_man)
- id=$(printf "%d\n" 0x$hex)
- echo $id > /var/vpn/vpnid
- rm /var/vpn/vpnid_man
- echo $hex
- # Login-Daten aus Datenbank holen
- credentials=$(/home/christoph/squid_dynamic/squidy $hex)
- fi
-
- if [ "$zero" == "2" ];
- then
- schleife="1"
- rm /var/vpn/vpnid_next
-
- while [ $schleife == "1" ] ;
- do
- # Zaehlvariable einlesen
- id_alt=$(cat /var/vpn/vpnid)
-
- # alte id HEX wandeln zum BLacklisten
- hex_alt=$(echo "obase=16; $id_alt" |bc)
-
- # Abfrage ob Strinlaenge von hex kleiner als 2
- if [ ${#hex_alt} -lt 2 ];
- then
- hex_alt=0$hex_alt
- fi
-
- # alte id BLacklisten
- if [ $write == 1 ];
- then
- echo $hex_alt >> /var/vpn/blacklist
- fi
-
- # id inkrementieren
- let id=$id_alt+1
-
- # 255 Overflow verhindern
- if [ $id -gt 254 ]
- then
- id=0
- fi
-
- # Variable id fuer naechsten Durchlauf speichern
- echo $id > /var/vpn/vpnid
-
- # id HEX wandeln
- hex=$(echo "obase=16; $id" |bc)
-
- # Abfrage ob Strinlaenge von hex kleiner als 2
- if [ ${#hex} -lt 2 ];
- then
- hex=0$hex
- fi
-
- # hole id_hex aus BLacklist?
- black=$(cat /var/vpn/blacklist|grep $hex)
-
- # Abfrage ob id_hex in BLacklist
- if [ ${#black} -lt 2 ];
- then
- # Login-Daten aus Datenbank holen
- credentials=$(/home/christoph/squid_dynamic/squidy $hex)
-
- # Abfrage ob Datensatz leer :
- if [ ${#credentials} -gt 10 ];
- then
- schleife="0"
- fi
- else write=0
- fi
- done
- fi
-
-
- # Abfrage ob Datensatz leer (zur Sicherheit):
- if [ ${#credentials} -gt 10 ] && [ $zero != "0" ];
- then
-
- # stop squid
- sudo killall -9 unlinkd
- sudo killall -9 squid
-
- sudo rm /etc/squid3/squid.conf
-######################################################################################
- # Config- Datei schreiben.
-sudo echo -e -n "
-# Squid config by h44z
-
-# TAG: http_port
-# Usage: port
-# hostname:port
-# 1.2.3.4:port
-http_port 10.8.0.1:3128 transparent
-http_port 10.8.0.1:8080
-#https_port 10.8.0.1:8181 key=/etc/apache2/ssl/apache.pem
-
-
-visible_hostname vpnrack
-
-# TAG: icp_port
-icp_port 0
-
-# TAG: no_cache
-acl QUERY urlpath_regex cgi-bin \\?
-no_cache deny QUERY
-
-# TAG: cache_mem (bytes)
-cache_mem 32 MB
-
-# TAG: cache_dir
-cache_dir ufs /var/cache/squid 100 16 256
-
-# TAG: cache_access_log
-cache_access_log /var/log/squid/access.log
-
-# TAG: cache_log
-cache_log /var/log/squid/cache.log
-
-# TAG: cache_store_log
-cache_store_log /var/log/squid/store.log
-
-# TAG: emulate_httpd_log on|off
-emulate_httpd_log on
-
-# TAG: pid_filename
-pid_filename /var/run/squid.pid
-
-# TAG: cache_mgr
-cache_mgr christoph.haas2@students.htlinn.ac.at
-
-http_access allow all
-acl https port 443
-http_access allow https
-
-
-# TAG: http_reply_access
-# Allow replies to client requests. This is complementary to http_access.
-#http_reply_access allow all
-
-cache_peer 192.168.195.101 parent 8080 7 no-query default no-digest login=$credentials
-
-never_direct allow all
-" > /etc/squid3/squid.conf
-######################################################################################
-
- echo "Written: $credentials"
-
- #start squid
- squid -D -YC -f /etc/squid3/squid.conf
-fi
-sleep 2
-done
diff --git a/Admin/Modules/Squid/squid_dynamic/write_conf_manuell.bak b/Admin/Modules/Squid/squid_dynamic/write_conf_manuell.bak
deleted file mode 100755
index fc83012..0000000
--- a/Admin/Modules/Squid/squid_dynamic/write_conf_manuell.bak
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/bin/bash
-# Script um die cache_peer funktion von Squid manuell von der Website aus upzudaten.
-# V1.0
-# 13.10.2010
-# Stoeckholzer, Haas
-
-while [ "1" == "1" ];
-do
-
- zero=0
- # ueberpruefen ob file vpnid_man vorhanden
- if [ -e /var/vpn/vpnid_man ];
- then
- echo 1
- zero=1
- fi
-
- # ueberpruefen ob file vpnid_next vorhanden
- if [ -e /var/vpn/vpnid_next ];
- then
- echo 2
- zero=2
- fi
-
-
-
- if [ "$zero" == "1" ];
- then
- # Manuelle ID als hex einlesen einlesen
- hex=$(cat /var/vpn/vpnid_man)
- id=$(printf "%d\n" $hex)
- echo $id > /var/vpn/vpnid
- rm /var/vpn/vpnid_man
- echo $hex
- # Login-Daten aus Datenbank holen
- credentials=$(/home/christoph/squid_dynamic/squidy $hex)
- fi
-
- if [ "$zero" == "2" ];
- then
- schleife="1"
- rm /var/vpn/vpnid_next
-
- while [ $schleife == "1" ] ;
- do
- # Zaehlvariable einlesen
- id=$(cat /var/vpn/vpnid)
- # id inkrementieren
- let id=$id+1
-
- # 255 Overflow verhindern
- if [ $id -gt 254 ]
- then
- id=0
- fi
-
- # Variable id fuer naechsten Durchlauf speichern
- echo $id > /var/vpn/vpnid
-
- # id HEX wandeln
- hex=$(echo "obase=16; $id" |bc)
-
- # Abfrage ob Strinlaenge von hex kleiner als 2
- if [ ${#hex} -lt 2 ];
- then
- hex=0$hex
- fi
-
- # Login-Daten aus Datenbank holen
- credentials=$(/home/christoph/squid_dynamic/squidy $hex)
-
- # Abfrage ob Datensatz leer :
- if [ ${#credentials} -gt 10 ];
- then
- schleife="0"
- fi
- done
- fi
-
-
- # Abfrage ob Datensatz leer (zur Sicherheit):
- if [ ${#credentials} -gt 10 ] && [ $zero != "0" ];
- then
-
- # stop squid
- sudo killall -9 unlinkd
- sudo killall -9 squid
-
- sudo rm /etc/squid3/squid.conf
-######################################################################################
- # Config- Datei schreiben.
-sudo echo -e -n "
-# Squid config by h44z
-
-# TAG: http_port
-# Usage: port
-# hostname:port
-# 1.2.3.4:port
-http_port 10.8.0.1:3128 transparent
-http_port 10.8.0.1:8080
-#https_port 10.8.0.1:8181 key=/etc/apache2/ssl/apache.pem
-
-
-visible_hostname vpnrack
-
-# TAG: icp_port
-icp_port 0
-
-# TAG: no_cache
-acl QUERY urlpath_regex cgi-bin \\?
-no_cache deny QUERY
-
-# TAG: cache_mem (bytes)
-cache_mem 32 MB
-
-# TAG: cache_dir
-cache_dir ufs /var/cache/squid 100 16 256
-
-# TAG: cache_access_log
-cache_access_log /var/log/squid/access.log
-
-# TAG: cache_log
-cache_log /var/log/squid/cache.log
-
-# TAG: cache_store_log
-cache_store_log /var/log/squid/store.log
-
-# TAG: emulate_httpd_log on|off
-emulate_httpd_log on
-
-# TAG: pid_filename
-pid_filename /var/run/squid.pid
-
-# TAG: cache_mgr
-cache_mgr christoph.haas2@students.htlinn.ac.at
-
-http_access allow all
-acl https port 443
-http_access allow https
-
-
-# TAG: http_reply_access
-# Allow replies to client requests. This is complementary to http_access.
-#http_reply_access allow all
-
-cache_peer 192.168.195.101 parent 8080 7 no-query default no-digest login=$credentials
-
-never_direct allow all
-" > /etc/squid3/squid.conf
-######################################################################################
-
- echo "Written: $credentials"
-
- #start squid
- squid -D -YC -f /etc/squid3/squid.conf
-fi
-sleep 2
-done
diff --git a/Admin/Modules/Squid/startsquid b/Admin/Modules/Squid/startsquid
deleted file mode 100755
index 4dccfde..0000000
--- a/Admin/Modules/Squid/startsquid
+++ /dev/null
@@ -1,5 +0,0 @@
-/home/christoph/stopsquid
-
-#iptables -t nat -A PREROUTING -i tap0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
-#iptables -t nat -A PREROUTING -i tap0 -p tcp --dport 443 -j REDIRECT --to-ports 3128
-squid -D -YC -f /etc/squid3/squid.conf
diff --git a/Admin/Modules/Squid/stopsquid b/Admin/Modules/Squid/stopsquid
deleted file mode 100755
index 91187a6..0000000
--- a/Admin/Modules/Squid/stopsquid
+++ /dev/null
@@ -1,6 +0,0 @@
-#iptables -t nat -D PREROUTING -i tap0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
-#iptables -t nat -D PREROUTING -i tap0 -p tcp --dport 443 -j REDIRECT --to-ports 3128
-
-killall squid
-killall squid
-killall squid
diff --git a/Admin/Modules/Squid_old/changesquid.php b/Admin/Modules/Squid_old/changesquid.php
deleted file mode 100755
index c5b81b5..0000000
--- a/Admin/Modules/Squid_old/changesquid.php
+++ /dev/null
@@ -1,14 +0,0 @@
-
diff --git a/Admin/Modules/Squid_old/delbl.php b/Admin/Modules/Squid_old/delbl.php
deleted file mode 100755
index 827a9b0..0000000
--- a/Admin/Modules/Squid_old/delbl.php
+++ /dev/null
@@ -1,9 +0,0 @@
- ".db_getconfval("sqddir")."/blacklist");
-echo $ret;
-header ("Location: ".$path."&uebergabe=2");
-?>
diff --git a/Admin/Modules/Squid_old/include/config.inc b/Admin/Modules/Squid_old/include/config.inc
deleted file mode 100755
index 89ed528..0000000
--- a/Admin/Modules/Squid_old/include/config.inc
+++ /dev/null
@@ -1,66 +0,0 @@
-
diff --git a/Admin/Modules/Squid_old/include/functions.inc b/Admin/Modules/Squid_old/include/functions.inc
deleted file mode 100755
index 870fa96..0000000
--- a/Admin/Modules/Squid_old/include/functions.inc
+++ /dev/null
@@ -1,251 +0,0 @@
- $PluginData)
- {
- // Check if the config.inc for a plugin exists
- if (file_exists ($_SERVER["DOCUMENT_ROOT"]."/Admin/Modules/VPNconfig/plugins/". $PluginData['Folder'] ."/config.inc"))
- {
- include ($_SERVER["DOCUMENT_ROOT"]."/Admin/Modules/VPNconfig/plugins/". $PluginData['Folder'] ."/config.inc");
-
- // Check if claimed inc files do exist
- if (isset ($config['Plugins'][$PluginName]['Action']['Include']) &&
- !file_exists ($_SERVER["DOCUMENT_ROOT"]."/Admin/Modules/VPNconfig/plugins/". $PluginData['Folder'] ."/".
- $config['Plugins'][$PluginName]['Action']['Include']))
- $config['Plugins'][$PluginName]['Action']['Include'] = NULL;
-
- if (isset ($config['Plugins'][$PluginName]['Left']['Menu']) &&
- !file_exists ($_SERVER["DOCUMENT_ROOT"]."/Admin/Modules/VPNconfig/plugins/". $PluginData['Folder'] ."/".
- $config['Plugins'][$PluginName]['Left']['Menu']))
- $config['Plugins'][$PluginName]['Left']['Menu'] = NULL;
-
- if (isset ($config['Plugins'][$PluginName]['Left']['Status']) &&
- !file_exists ($_SERVER["DOCUMENT_ROOT"]."/Admin/Modules/VPNconfig/plugins/". $PluginData['Folder'] ."/".
- $config['Plugins'][$PluginName]['Left']['Status']))
- $config['Plugins'][$PluginName]['Left']['Status'] = NULL;
- }
- }
- }
-}
-
-// ----------------------------------------------
-function seconds_string ($seconds, $periods = null)
-{
- $Wanted = '';
-
- // Define time periods
- if (!is_array ($periods))
- {
- $periods = array (
- 'years' => 31556926,
- 'months' => 2629743,
- 'weeks' => 604800,
- 'days' => 86400,
- 'hours' => 3600,
- 'minutes' => 60,
- 'seconds' => 1
- );
- }
-
- // Wanted
- if (empty ($seconds))
- { $Wanted = ''; }
- else
- {
- // Loop
- $seconds = (int) $seconds;
- foreach ($periods as $period => $value)
- {
- $count = floor ($seconds / $value);
-
- if ($count == 0)
- continue;
- elseif ($count == 1)
- $Wanted .= ($count . ' ' . substr ($period, 0, strlen ($period) - 1) . ' ');
- else
- $Wanted .= ($count . ' ' . $period . ' ');
-
- $seconds = $seconds % $value;
- }
- }
-
- return rtrim ($Wanted);
-}
-
-// ----------------------------------------------
-function chomp (&$string)
-{
- if (is_array ($string))
- {
- foreach ($string as $i => $val)
- { $endchar = chomp ($string[$i]); }
- }
- else
- {
- $endchar = substr ("$string", strlen("$string") - 1, 1);
- if ($endchar == "\n")
- { $string = substr ("$string", 0, -1); }
- }
- return $endchar;
-}
-
-// ----------------------------------------------
-function str_strip_spaces ($aline)
-{
- while (strpos ($aline, "\t") != FALSE) $aline = str_replace ("\t", ' ', $aline);
- while (strpos ($aline, ' ') != FALSE) $aline = str_replace (' ', ' ', $aline);
-
- return $aline;
-}
-
-// ----------------------------------------------
-// Returns $afile only if it is the full name, or prefixed by $apath
-function str_file_fullname ($apath, $afile)
-{
- if (substr ($afile, 0, 1) != '/')
- $afile = ($apath . $afile);
-
- return $afile;
-}
-
-// ----------------------------------------------
-// Returns $afile only if it is the full name, or prefixed by $apath
-function str_openssldata_to_string ($adata)
-{
- $Return = '';
- $amonth = array ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
-
- if (substr ($adata, -1, 1) == 'Z')
- {
- $Return = sprintf ("%s %d %s%02d, %02d:%02d:%02d",
- $amonth [substr ($adata, 2, 2) - 1],
- substr ($adata, 4, 2),
- (substr ($adata, 0, 2) > 50 ? '19' : '20'),
- substr ($adata, 0, 2),
- substr ($adata, 6, 2),
- substr ($adata, 8, 2),
- substr ($adata, 10, 2));
- }
-
- return $Return;
-}
-
-// ----------------------------------------------
-function str_get_sometag ($aline, $sometag)
-{
- if (eregi ($sometag, $aline, $anarray))
- return $anarray[1];
- else
- return '';
-}
-
-// ----------------------------------------------
-// Writes content into file
-// Optionally sames old file into backup file.
-// The Backup File has to reside on the same partition!
-function writefile ($afile, $adata, $abackup = NULL)
-{
- // Move the old file into Backup one
- if ($abackup != NULL)
- {
- if (file_exists ($afile))
- {
- if (file_exists ($abackup))
- if (!unlink ($abackup))
- exit;
- if (!rename ($afile, $abackup))
- exit;
- }
- }
-
- $fp = fopen ($afile, "w", 0);
- if (!$fp)
- exit;
-
- fputs ($fp, $adata);
- fclose ($fp);
-}
-
-
-// ----------------------------------------------
-// Guess the full file name
-function if_file_exists (&$sFileName, $bFix = FALSE)
-{
- global $config;
-
- if (strpos ($sFileName, '/') == FALSE)
- {
- $sLongFileName = $config['openvpn']['folder'] . $sFileName;
- if (file_exists ($sLongFileName) && $bFix)
- $sFileName = $sLongFileName;
- }
-
- return file_exists ($sFileName);
-}
-
-// ----------------------------------------------
-function zlib_check_functions ()
-{
- $Result = '';
- $ZLibs = array
- (
- 'gzcompress'
- );
-
- foreach ($ZLibs as $Function)
- {
- $Result .= $Function . ': ' . (function_exists ($Function) ?
- 'OK ' :
- 'DOES NOT EXIST ') . ' ';
- }
-
- return $Result;
-}
-
-// ----------------------------------------------
-function html_dump ($aname, $athing)
-{
- echo ''. $aname .' : ';
- print_r ($athing);
- echo " \n";
-}
-
-// ----------------------------------------------
-function html_error ($amessage, $ifexit = true)
-{
- global $config;
- echo $amessage;
- if ($ifexit)
- exit;
-}
-
-// ----------------------------------------------
-function html_postredir ($url)
-{
- header ('HTTP/1.1 303 REDIRECT');
- header ('Location: '. $url);
-#header ('Status: 303'); // if 1st header generates 500, then commend it out and use this one as 2nd
-}
-
-// ----------------------------------------------
-// ----------------------------------------------
-function html_download ($sFile, $sName)
-{
- header ('Content-type: application/octet-stream');
- header ('Content-Disposition: attachment; filename="'. $sName . '"');
- readfile ($sFile);
-}
-
-// ----------------------------------------------
-function html_download_data ($sData, $sName)
-{
- header ('Content-type: application/octet-stream');
- header ('Content-Disposition: attachment; filename="'. $sName . '"');
- echo $sData;
-}
-?>
diff --git a/Admin/Modules/Squid_old/include/openssl-functions.inc b/Admin/Modules/Squid_old/include/openssl-functions.inc
deleted file mode 100755
index a10701a..0000000
--- a/Admin/Modules/Squid_old/include/openssl-functions.inc
+++ /dev/null
@@ -1,377 +0,0 @@
-: ' . (function_exists ($Function) ?
- 'OK ' :
- 'DOES NOT EXIST ') . ' ';
- }
-
- return $Result;
-}
-
-// ----------------------------------------------
-function openssl_load_database ($afile = '')
-{
- global $config;
- global $openssl;
-
- $afile = ($afile == '' ? $config['openssl']['database'] : $afile);
- $lines = file ($afile);
-
- if (!is_array ($lines))
- exit;
-
- foreach ($lines as $line_num => $line)
- {
- chomp ($line);
- $linetokens = explode ("\t", $line);
-
- // Ensure that all the fields are set
- if (count ($linetokens) == 6)
- {
- // Decode the openssl's database. See apps/apps.h
- $openssl['Database'][] = array ('Status' => $linetokens[0],
- 'ExpDate' => $linetokens[1],
- 'RevDate' => $linetokens[2],
- 'Serial' => $linetokens[3],
- 'File' => $linetokens[4],
- 'Name' => $linetokens[5],
- 'Country' => openssl_get_country ($linetokens[5]),
- 'State' => openssl_get_state ($linetokens[5]),
- 'City' => openssl_get_city ($linetokens[5]),
- 'Company' => openssl_get_company ($linetokens[5]),
- 'Department' => openssl_get_department ($linetokens[5]),
- 'CN' => openssl_get_CN ($linetokens[5]),
- 'Email' => openssl_get_email ($linetokens[5])
- );
- }
- }
-}
-
-// ----------------------------------------------
-function openssl_write_database ($afile = '')
-{
- global $config;
- global $openssl;
-
- $afile = ($afile == '' ? $config['openssl']['database'] : $afile);
-
- $atext = '';
- for ($i = 0; $i < count ($openssl['Database']); $i++)
- {
- $atext .= ($atext == '' ? '' : "\n");
- $atext .= $openssl['Database'][$i]['Status'] ."\t".
- $openssl['Database'][$i]['ExpDate'] ."\t".
- $openssl['Database'][$i]['RevDate'] ."\t".
- $openssl['Database'][$i]['Serial'] ."\t".
- $openssl['Database'][$i]['File'] ."\t".
- $openssl['Database'][$i]['Name'];
- }
-
- writefile ($afile, $atext, $afile .'.old');
-}
-
-// ----------------------------------------------
-function openssl_write_database_attr ($atext = '', $afile = '')
-{
- global $config;
- global $openssl;
-
- $afile = ($afile == '' ? $config['openssl']['database'] : $afile) .'.attr';
- $atext = ($atext == '' ? "unique_subject = yes\n" : $atext);
-
- if (file_exists ($afile))
- {
- ob_start ();
- readfile ($afile);
- $atext = ob_get_contents ();
- ob_end_clean ();
- }
-
- writefile ($afile, $atext, $afile .'.old');
-}
-
-// ----------------------------------------------
-// Returns the PEM file with spaces reduced and replaced to
-function openssl_load_cert ($anid)
-{
- global $config;
-
- do
- {
- $lines = file ($config['openssl']['pubfolder'] . $anid . '.pem');
-
- if (!is_array ($lines))
- {
- $Return = '';
- break;
- }
-
- foreach ($lines as $line_num => $line)
- {
- chomp ($line);
- $Return[] = str_replace (' ', ' ', htmlspecialchars (str_replace (' ', ' ', $line)));
- }
- } while (FALSE);
-
- return $Return;
-}
-
-// ----------------------------------------------
-function openssl_load_serial ($afile = '')
-{
- global $config;
-
- $afile = ($afile == '' ? $config['openssl']['serial'] : $afile);
-
- $lines = file ($afile);
-
- if (!is_array ($lines))
- exit;
-
- $Return = sscanf ($lines[0], "%X");
-
- return $Return[0];
-}
-
-// ----------------------------------------------
-function openssl_write_serial ($iNumber, $afile = '')
-{
- global $config;
-
- $afile = ($afile == '' ? $config['openssl']['serial'] : $afile);
-
- writefile ($afile, openssl_hex_serial ($iNumber) . "\n", $afile .'.old');
-}
-
-// ----------------------------------------------
-// Supports up to 999,999 serials
-function openssl_hex_serial ($iNumber)
-{
- if ($iNumber < 100)
- $sString = sprintf ("%02X", $iNumber);
- elseif ($iNumber < 10000)
- $sString = sprintf ("%04X", $iNumber);
- else
- $sString = sprintf ("%06X", $iNumber);
-
- return $sString;
-}
-
-// ----------------------------------------------
-// Builds User Private Key, CSR and Public Certificate
-function openssl_build_key (&$anoutput, $adn, $validdays = NULL)
-{
- global $config;
- global $openssl;
-
- $anoutput = '';
- $Return = FALSE;
-
- // Allow to override default value
- $validdays = ($validdays == NULL ? $config['openssl']['default']['expiration'] : $validdays);
-
- do
- {
- if (!isset ($adn) ||
- !isset ($adn['countryName']) ||
- !isset ($adn['stateOrProvinceName']) ||
- !isset ($adn['localityName']) ||
- !isset ($adn['organizationName']) ||
- !isset ($adn['organizationalUnitName']) ||
- !isset ($adn['commonName']) ||
- !isset ($adn['emailAddress'])
- )
- { $anoutput .= "- ERROR on ". __LINE__ ." line: incomplete DN information\n"; break; }
- $anoutput .= "+ OK got the valid input\n";
-
- // Get the new User Private Key
- $UserPrivKey = openssl_pkey_new (array($config['openssl']['config'],0));
- if ($UserPrivKey == FALSE)
- { $anoutput .= "- ERROR on ". (__LINE__ - 2) ." line (openssl_pkey_new):\n ". openssl_error_strings () ." (that might usually mean that the openssl.cnf file is unavailable)"; break; }
- $anoutput .= "+ OK got the User Private Key\n";
-
- // Generate the User Certificate Request
- $UserReq = openssl_csr_new ($adn,
- $UserPrivKey,
- $config['openssl']['config']);
- if ($UserReq == FALSE)
- { $anoutput .= "- ERROR on ". (__LINE__ - 4) ." line (openssl_csr_new):\n ". openssl_error_strings (); break; }
- $anoutput .= "+ OK generated the User Certificate Request\n";
-
- // Read the openssl serial
- $CAserial = openssl_load_serial ($config['openssl']['serial']);
- $anoutput .= "+ OK read current openssl serial (". openssl_hex_serial ($CAserial) .")\n";
-
- $UserPubCertFile = $config['openssl']['pubfolder'] . openssl_hex_serial ($CAserial) .'.pem';
- $UserCertReqFile = $config['openssl']['reqfolder'] . openssl_hex_serial ($CAserial) .'.csr';
- $UserPrivKeyFile = $config['openssl']['prvfolder'] . openssl_hex_serial ($CAserial) .'.key';
-
- // Read the openssl database
- openssl_load_database ($config['openssl']['database']);
- $anoutput .= "+ OK read the openssl database (". count ($openssl['Database']) ." items)\n";
-
- // Get CA's Private Key
- $CAPrivKey = openssl_pkey_get_private ($config['openssl']['CA']['priv']);
-
- if ($CAPrivKey == FALSE)
- { $anoutput .= "- ERROR on ". (__LINE__ - 2) ." line (openssl_pkey_get_private)\n ". openssl_error_strings (); break; }
- $anoutput .= "+ OK read the CA Private Key\n";
-
- // Get a CA-signed cert that lasts for 1 year
- $UserPubCert = openssl_csr_sign ($UserReq,
- $config['openssl']['CA']['pub'],
- $CAPrivKey,
- $validdays,
- $config['openssl']['config'],
- $CAserial);
- if ($UserPubCert == FALSE)
- { $anoutput .= "- ERROR on ". (__LINE__ - 7) ." line (openssl_csr_sign)\n ". openssl_error_strings (); break; }
- $anoutput .= "+ OK signed the User Certificate Request with CA Private Key\n";
-
- // Add the new row into openssl database
- $openssl['Database'][] = array ('Status' => 'V',
- 'ExpDate' => date ('ymdHis',
- time() +
- date ('Z') +
- ($validdays * 24 * 60 * 60)) .'Z',
- 'RevDate' => '',
- 'Serial' => openssl_hex_serial ($CAserial),
- 'File' => openssl_hex_serial ($CAserial) .'.crt',
- 'Name' => openssl_make_name ($adn)
- );
-
- // Create files
-
- $OldUMask = umask (0007);
-
- // Write User Private Key
- if (!openssl_pkey_export_to_file ($UserPrivKey, $UserPrivKeyFile, NULL, $config['openssl']['config']))
- { $anoutput .= "- ERROR on ". (__LINE__ - 1) ." line (openssl_pkey_export_to_file)\n ". openssl_error_strings () ." (That might mean that the key folder is not write enabled for www user)"; break; }
- $anoutput .= "+ OK wrote User Private Key into file $UserPrivKeyFile\n";
-
- // Write User Public Certificate
- if (!openssl_x509_export_to_file ($UserPubCert, $UserPubCertFile, FALSE))
- { $anoutput .= "- ERROR on ". (__LINE__ - 1) ." line (openssl_x509_export_to_file)\n ". openssl_error_strings (); break; }
- $anoutput .= "+ OK wrote User Public Certificate into file $UserPubCertFile\n";
-
- // Write User Certificate Request
- if (!openssl_csr_export_to_file ($UserReq, $UserCertReqFile))
- { $anoutput .= "- ERROR on ". (__LINE__ - 1) ." line (openssl_csr_export_to_file)\n ". openssl_error_strings (); break; }
- $anoutput .= "+ OK wrote User Certificate Request into file $UserCertReqFile\n";
-
- // Write new openssl database
- openssl_write_database ($config['openssl']['database']);
- openssl_write_database_attr ('', $config['openssl']['database']);
- $anoutput .= "+ OK wrote new openssl database\n";
-
- // Write new openssl serial
- openssl_write_serial ($CAserial + 1, $config['openssl']['serial']);
- $anoutput .= "+ OK wrote new openssl serial\n";
-
- umask ($OldUMask);
-
- $Return = openssl_hex_serial ($CAserial);
- } while (FALSE);
-
- return $Return;
-}
-
-// ----------------------------------------------
-function openssl_error_strings ()
-{
- $sString = '';
- while ($msg = openssl_error_string ())
- $sString .= $msg ."\n";
-
- return $sString;
-}
-
-// ----------------------------------------------
-function openssl_make_name ($adn)
-{
- $sString = '';
-
- if (strlen ($adn['countryName']) > 0) $sString .= '/C=' . $adn['countryName'];
- if (strlen ($adn['stateOrProvinceName']) > 0) $sString .= '/ST=' . $adn['stateOrProvinceName'];
- if (strlen ($adn['localityName']) > 0) $sString .= '/L=' . $adn['localityName'];
- if (strlen ($adn['organizationName']) > 0) $sString .= '/O=' . $adn['organizationName'];
- if (strlen ($adn['organizationalUnitName']) > 0) $sString .= '/OU=' . $adn['organizationalUnitName'];
- if (strlen ($adn['commonName']) > 0) $sString .= '/CN=' . $adn['commonName'];
- if (strlen ($adn['emailAddress']) > 0) $sString .= '/emailAddress='. $adn['emailAddress'];
-
- return $sString;
-}
-
-// ----------------------------------------------
-function openssl_get_country ($aline)
-{ return str_get_sometag ($aline . '/', '\/C=([^/]*)\/'); }
-
-// ----------------------------------------------
-function openssl_get_state ($aline)
-{ return str_get_sometag ($aline . '/', '\/ST=([^/]*)\/'); }
-
-// ----------------------------------------------
-function openssl_get_city ($aline)
-{ return str_get_sometag ($aline . '/', '\/L=([^/]*)\/'); }
-
-// ----------------------------------------------
-function openssl_get_company ($aline)
-{ return str_get_sometag ($aline . '/', '\/O=([^/]*)\/'); }
-
-// ----------------------------------------------
-function openssl_get_department ($aline)
-{ return str_get_sometag ($aline . '/', '\/OU=([^/]*)\/'); }
-
-// ----------------------------------------------
-function openssl_get_CN ($aline)
-{ return str_get_sometag ($aline . '/', '\/CN=([^/]*)\/'); }
-
-// ----------------------------------------------
-function openssl_get_email ($aline)
-{ return str_get_sometag ($aline . '/', '\/emailAddress=([^/]*)\/'); }
-
-// ----------------------------------------------
-// Guess the full file name
-function openssl_get_filename ($iSerial, $sExt)
-{
- global $config;
-
- $sReturn = $config['openssl']['folder'] . openssl_hex_serial ($iSerial) . $sExt;
- if (!file_exists ($sReturn))
- {
- $sReturn = $config['openssl']['pubfolder'] . openssl_hex_serial ($iSerial) . $sExt;
- if (!file_exists ($sReturn))
- {
- $sReturn = $config['openssl']['reqfolder'] . openssl_hex_serial ($iSerial) . $sExt;
- if (!file_exists ($sReturn))
- {
- $sReturn = $config['openssl']['prvfolder'] . openssl_hex_serial ($iSerial) . $sExt;
- if (!file_exists ($sReturn))
- {
- $sReturn = '';
- }
- }
- }
- }
-
- return $sReturn;
-}
-
-
-?>
diff --git a/Admin/Modules/Squid_old/include/restartsquid.php b/Admin/Modules/Squid_old/include/restartsquid.php
deleted file mode 100755
index e60d11c..0000000
--- a/Admin/Modules/Squid_old/include/restartsquid.php
+++ /dev/null
@@ -1,11 +0,0 @@
-
diff --git a/Admin/Modules/Squid_old/include/startsquid.php b/Admin/Modules/Squid_old/include/startsquid.php
deleted file mode 100755
index e4aac29..0000000
--- a/Admin/Modules/Squid_old/include/startsquid.php
+++ /dev/null
@@ -1,11 +0,0 @@
-
diff --git a/Admin/Modules/Squid_old/include/stopsquid.php b/Admin/Modules/Squid_old/include/stopsquid.php
deleted file mode 100755
index 710c8df..0000000
--- a/Admin/Modules/Squid_old/include/stopsquid.php
+++ /dev/null
@@ -1,11 +0,0 @@
-
diff --git a/Admin/Modules/Squid_old/index.php b/Admin/Modules/Squid_old/index.php
deleted file mode 100755
index 768a080..0000000
--- a/Admin/Modules/Squid_old/index.php
+++ /dev/null
@@ -1,297 +0,0 @@
-";
- exit;
-}
- $sort = mysql_real_escape_string($_POST["dirsort"]); //$_GET["sort"];
- $by = mysql_real_escape_string($_POST["sortby"]); //$_GET["by"];
- $userid = mysql_real_escape_string($_POST["userid"]); //$_GET["userid"];
- $search = mysql_real_escape_string($_POST["search"]); //$_GET["search"];
-
-$moduleurl = $_SERVER["REQUEST_URI"];
-$urlcut = strpos($moduleurl, "&");
-$moduleurl = substr($moduleurl,0,$urlcut);
-?>
-
-Squid Config
-Squid is currently: running ";
-}
-else
-{
- echo "Squid is currently: stopped ";
-}
-
- if ($_REQUEST["uebergabe"]=="3")
- {
- echo "Squid restarted successfully! ";
- echo " ";
- }
- if ($_REQUEST["uebergabe"]=="4")
- {
- echo "Squid started successfully! ";
- echo " ";
- }
- if ($_REQUEST["uebergabe"]=="5")
- {
- echo "Squid stopped successfully! ";
- echo " ";
- }
- ?>
-
-
-Change Proxy Account:
-Changed Squid Account successfully!";
- }
- ?>
-
-
-
- Squid ID (HEX):
-
-
-
-
-
-
-Current Squid User:
- 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5,
- 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 'A',
- 11 => 'B', 12 => 'C', 13 => 'D', 14 => 'E',
- 15 => 'F' );
-
- do
- {
- $h = $hex[($dec%16)] . $h;
- $dec /= 16;
- }
- while( $dec >= 1 );
-
- return $sign . $h;
-}
-
- $zeile = exec(escapeshellcmd("cat ".db_getconfval("sqddir")."/vpnid"));
- $zeile = dec_to_hex($zeile);
- //echo $zeile;
- if(strlen ($zeile) <2)
- {
- $zeile = "0".$zeile;
- }
- if(strlen ($zeile) >2)
- {
- $zeile=substr($zeile, 0, -1);
- }
- @$y = mysql_connect($MYSQL_HOST,$MYSQL_USER,$MYSQL_PASS);
- @$x = mysql_select_db($MYSQL_DATABASE);
- if (empty($x))
- {
- echo "ERROR 0x01, Failed to connect to database! ";
- exit;
- }
- $sql4 = "SELECT * FROM userdata WHERE VPNId = '".$zeile."';";
- $result4 = mysql_query($sql4);
- //echo $sql4;
- $ar4=mysql_fetch_array($result4,MYSQL_ASSOC);
- echo "" . $ar4["Vorname"] . " " . $ar4["Nachname"] . " VPNId: " . $ar4["VPNId"]." ";
- mysql_close();
-?>
-
-
-
-
-Blacklisted Accounts:
-Blacklist cleared successfully!";
- }
- ?>
-
- Squid ID Nickname Vorname Nachname
-";
- exit;
- }
-
- $hascontent = true;
- if (strlen($zeile) >2)
- {
- $zeile=substr($zeile, 0, -1);
- }
- $sql3 = "SELECT * FROM userdata WHERE VPNId = '".$zeile."';";
- $result3 = mysql_query($sql3);
- $ar3=mysql_fetch_array($result3,MYSQL_ASSOC);
- $nick = $ar3["Nickname"];
- if($nick == "")
- $hascontent=false;
- $vor = $ar3["Vorname"];
- if($vor == "")
- $hascontent=false;
- $nach = $ar3["Nachname"];
- if($nach == "")
- $hascontent=false;
-
- if($hascontent == true)
- {
- $blindex = $blindex+1;
- echo "".$zeile." ".$nick." ".$vor." ".$nach." ";
- }
- mysql_close();
- }
-
-?>
-
- Blacklisted accounts:
-
- out of:
- ';
- elseif (count($openssl['Database'])-1 == 1)
- {
- echo '1 certificate';
- }
- elseif (count($openssl['Database'])-1 > 1)
- {
- echo '';
- echo count($openssl['Database'])-1;
- echo ' certificates';
- }?>
-
-
-
-
-
-
-
-
-
-User changed Proxy Accounts:
-
-
-
- value="ASC">Up
- value="DESC">Down
-
-
- value="Id">ID
- value="VPNId">VPNId
- value="Time">Time
- value="IP">IP
- value="Nickname">Nickname
-
-Search User: >
-
-
-
-
-";
- exit;
- }
- // MYsql befehl basteln
-
-
- if($by == "Nickname")
- {
- $sql = "SELECT * FROM proxyrepair;";
- }
- else
- {
- $sql = "SELECT * FROM proxyrepair ORDER BY $by $sort;";
- }
-
- $result = mysql_query($sql);
- echo "";
- echo "User ID VPN Id Nickname Vorname Nachname Client IP Time Dead VPN ID \n";
-// ------------------------------------------------ Mysql lesen
- if ($result)
- {
- while ($ar=mysql_fetch_array($result,MYSQL_ASSOC))
- {
-
- $sql = "SELECT * FROM userdata WHERE Id = '".$ar["Id"]."' AND (Nickname LIKE '%".$search."%' OR Vorname LIKE '%".$search."%' OR Id LIKE '%".$search."%' OR VPNId LIKE '%".$search."%');";
- $result2 = mysql_query($sql);
- $ar2=mysql_fetch_array($result2,MYSQL_ASSOC);
-
- if($ar2["Nickname"] != "")
- echo "",$ar["Id"]," ",$ar["VPNId"]," ",$ar2["Nickname"]," ",$ar2["Vorname"]," ",$ar2["Nachname"],
- " ", $ar["IP"]," ",$ar["Time"]," ",$ar["RepID"]," \n";
- }
- }
- else
- {
- echo " ";
- }
- echo "
";
- mysql_close();
-?>
-
diff --git a/Admin/Modules/Squid_old/squid_dynamic/README b/Admin/Modules/Squid_old/squid_dynamic/README
deleted file mode 100644
index 6f55fcd..0000000
--- a/Admin/Modules/Squid_old/squid_dynamic/README
+++ /dev/null
@@ -1,3 +0,0 @@
-export CPATH=..:$HOME/include:/usr/local/include:/usr/include:/usr/include/mysql
-needed: libmysqlclient-dev
-gcc -l mysqlclient -o traffic Traffic.c
diff --git a/Admin/Modules/Squid_old/squid_dynamic/db.conf b/Admin/Modules/Squid_old/squid_dynamic/db.conf
deleted file mode 100755
index f902996..0000000
--- a/Admin/Modules/Squid_old/squid_dynamic/db.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-user: openvpn
-passwd: openvpnlog
-database: openvpn
-host: localhost
diff --git a/Admin/Modules/Squid_old/squid_dynamic/hexer b/Admin/Modules/Squid_old/squid_dynamic/hexer
deleted file mode 100755
index 6a24092..0000000
--- a/Admin/Modules/Squid_old/squid_dynamic/hexer
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-let x=0x3f
-echo $x
-
-
-let x=0xfffe
-echo $x
diff --git a/Admin/Modules/Squid_old/squid_dynamic/squid_dyn.c b/Admin/Modules/Squid_old/squid_dynamic/squid_dyn.c
deleted file mode 100644
index 6fa1665..0000000
--- a/Admin/Modules/Squid_old/squid_dynamic/squid_dyn.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* OpenVPN - Squid Load Balancer*
- *------------------------------*
- * Version 1.0 *
- * Written by Christoph Haas *
- * License: LGPL *
- * 12.10.2010 *
- */
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#define __MAX_LINE__ 100
-#define __MAX_FIELD__ 255
-#define false 0
-#define true 1
-
-
-MYSQL mysql;
-
-int connect_db(char *config)
-{
- FILE *db_data = NULL;
- regex_t reg;
- char user[__MAX_LINE__] = "";
- char passwd[__MAX_LINE__] = "";
- char database[__MAX_LINE__] = "";
- char host[__MAX_LINE__] = "";
- int port = 0;
- char tmp[__MAX_LINE__];
- char buf[__MAX_LINE__];
- int a, b;
- int length;
-
- if((db_data = fopen(config, "r")) == NULL)
- {
- fprintf(stderr, "Can't open %s for reading.\n", config);
- return false;
- }
- regcomp(®, "^([a-zA-Z0-9:]+)[ ][a-zA-Z0-9]+$", REG_EXTENDED | REG_NEWLINE);
- while(fgets(buf, __MAX_LINE__, db_data))
- {
- length = strlen(buf);
- if(length < 3)continue;
- if(length >= __MAX_LINE__)
- {
- fclose(db_data);
- regfree(®);
- fprintf(stderr, "To long line in config file.\n");
- return false;
- }
- if(buf[0] == '#')continue;
- if(regexec(®, buf, 0, 0, 0))
- {
- fclose(db_data);
- regfree(®);
- fprintf(stderr, "Syntax error in config file.\n");
- return false;
- }
- for(a = 0, b = 0; a < strlen(buf); a++)
- {
- if(buf[a] == ' ')b++;
- }
- if(b != 1)
- {
- fclose(db_data);
- regfree(®);
- fprintf(stderr, "Syntax error in config file.\n");
- return false;
- }
- if((strncmp(buf, "user: ", 6)) == 0)sscanf(buf, "%s %s", tmp, user);
- if((strncmp(buf, "passwd: ", 8)) == 0)sscanf(buf, "%s %s", tmp, passwd);
- if((strncmp(buf, "database: ", 10)) == 0)sscanf(buf, "%s %s", tmp, database);
- if((strncmp(buf, "host: ", 6)) == 0)sscanf(buf, "%s %s", tmp, host);
- if((strncmp(buf, "port: ", 6)) == 0)sscanf(buf, "%s %d", tmp, &port);
- }
- fclose(db_data);
- regfree(®);
- if((strlen(user) < 1) || (strlen(passwd) < 1) ||
- (strlen(database) < 1) || (strlen(host) < 1))
- {
- fprintf(stderr, "One value for MySQL connection isn't set. \
- Please set user, passwd, database and host.\n");
- return false;
- }
-
-
- mysql_init(&mysql);
- if((mysql_real_connect(&mysql, host, user, passwd, database, port, NULL, 0)) == NULL)
- {
- fprintf(stderr, "%s\n", mysql_error(&mysql));
- return false;
- }
- return true;
-}
-
-int main(int argc, char **argv)
-{
- MYSQL_RES *result;
- MYSQL_ROW row;
- char Query[200]= "SELECT * FROM userdata WHERE VPNId = '\0";
-
- if(argc == 2)
- {
- /*iID = atoi(argv[1]);
- printf("Int:%d\n", iID);
- sprintf(ID,"%-#10x",iID);
- printf("String:%s\n", ID);*/
-
- connect_db("/home/christoph/squid_dynamic/db.conf"); // Datenbank Verbindung aufbauen
-
- strcat(Query, argv[1]); // Query builden
- strcat(Query,"'"); //
-
- mysql_query(&mysql, Query); // Query abschicken
- result = mysql_store_result(&mysql); // Result speichern
-
- while ((row = mysql_fetch_row(result))) // Alle Datensätze auslesen (in dem Fall eh nur einer)
- {
- printf("%s:%s\n", row[9], row[10]); // Feld 9 und 10 (login/pass) aus dem datensatz ausgeben
- }
-
- mysql_free_result(result); // Result wieder löschen
- mysql_close(&mysql); // Datenbank Verbindung schliesen
- }
- else
- {
- printf("USAGE: sqidy xx | xx = VPNId\n"); // bei flascheingabe der Parameter
- }
-}
diff --git a/Admin/Modules/Squid_old/squid_dynamic/squidy b/Admin/Modules/Squid_old/squid_dynamic/squidy
deleted file mode 100755
index 677c5da..0000000
Binary files a/Admin/Modules/Squid_old/squid_dynamic/squidy and /dev/null differ
diff --git a/Admin/Modules/Squid_old/squid_dynamic/squidy.bak b/Admin/Modules/Squid_old/squid_dynamic/squidy.bak
deleted file mode 100755
index 726712c..0000000
Binary files a/Admin/Modules/Squid_old/squid_dynamic/squidy.bak and /dev/null differ
diff --git a/Admin/Modules/Squid_old/squid_dynamic/vpnid b/Admin/Modules/Squid_old/squid_dynamic/vpnid
deleted file mode 100644
index 4daddb7..0000000
--- a/Admin/Modules/Squid_old/squid_dynamic/vpnid
+++ /dev/null
@@ -1 +0,0 @@
-00
diff --git a/Admin/Modules/Squid_old/squid_dynamic/write_conf b/Admin/Modules/Squid_old/squid_dynamic/write_conf
deleted file mode 100755
index 9e3e244..0000000
--- a/Admin/Modules/Squid_old/squid_dynamic/write_conf
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/bin/bash
-
-# Zaehlvariable einlesen
-id=$ID_VPN
-
-# Abfrage ob Stringlaenge von id NULL ist
-if [ ${#ID_VPN} == 0 ];
-then id=0
-fi
-
-# id inkrementieren
-let id=$id+1
-
-# 255 Overflow verhindern
-if [ $id -gt 254 ]
-then id=0
-fi
-
-# Variable id fuer naechsten Durchlauf speichern
-export ID_VPN=$id
-
-# id HEX wandeln
-hex=$(echo "obase=16; $id" |bc)
-
-# Abfrage ob Strinlaenge von hex kleiner als 2
-if [ ${#hex} -lt 2 ];
-then hex=0$hex
-fi
-
-# Login-Daten aus Datenbank holen
-credentials=$(./squidy $hex)
-# Abfrage ob Datensatz leer :
-zero="0"
-
-if [ "$credentials" == ":" ];
-then
- . write_conf &
- zero="1"
-fi
-if [ ${#credentials} == 0 ];
-then
- . write_conf &
- zero="1"
-fi
-
-######################################################################################
-
-# Config- Datei schreiben.
-if [ $zero == "0" ]
-then
-echo "
-# Squid config by h44z
-
-# TAG: http_port
-# Usage: port
-# hostname:port
-# 1.2.3.4:port
-http_port 10.8.0.1:3128 transparent
-http_port 10.8.0.1:8080
-#https_port 10.8.0.1:8181 key=/etc/apache2/ssl/apache.pem
-
-
-visible_hostname vpnrack
-
-# TAG: icp_port
-icp_port 0
-
-# TAG: no_cache
-acl QUERY urlpath_regex cgi-bin \\?
-no_cache deny QUERY
-
-# TAG: cache_mem (bytes)
-cache_mem 32 MB
-
-# TAG: cache_dir
-cache_dir ufs /var/cache/squid 100 16 256
-
-# TAG: cache_access_log
-cache_access_log /var/log/squid/access.log
-
-# TAG: cache_log
-cache_log /var/log/squid/cache.log
-
-# TAG: cache_store_log
-cache_store_log /var/log/squid/store.log
-
-# TAG: emulate_httpd_log on|off
-emulate_httpd_log on
-
-# TAG: pid_filename
-pid_filename /var/run/squid.pid
-
-# TAG: cache_mgr
-cache_mgr christoph.haas2@students.htlinn.ac.at
-
-
-http_access allow all
-acl https port 443
-http_access allow https
-
-
-# TAG: http_reply_access
-# Allow replies to client requests. This is complementary to http_access.
-#http_reply_access allow all
-
-cache_peer 192.168.195.101 parent 8080 7 no-query default no-digest login=$credentials
-
-never_direct allow all
-" > /etc/squid3/squid.conf
-
-######################################################################################
-#restart squid
-killall -9 squid
-squid -D -YC -f /etc/squid3/squid.conf
-fi
diff --git a/Admin/Modules/Squid_old/squid_dynamic/write_conf_file b/Admin/Modules/Squid_old/squid_dynamic/write_conf_file
deleted file mode 100755
index 1e05d8e..0000000
--- a/Admin/Modules/Squid_old/squid_dynamic/write_conf_file
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/bin/bash
-# Script um die cache_peer funktion von Squid upzudaten.
-# V1.0
-# 13.10.2010
-# Stoeckholzer, Haas
-
-if [ ${#1} == 0 ];
-then
- echo "USAGE: write_conf_file updatetime"
- exit 0
-fi
-
-while [ "1" == "1" ] ;
-do
- sleep $1
- zero="1"
-
- while [ $zero == "1" ] ;
- do
-
- # Zaehlvariable einlesen
- id=$(cat /var/vpn/vpnid)
-
- # id inkrementieren
- let id=$id+1
-
- # 255 Overflow verhindern
- if [ $id -gt 254 ]
- then
- id=0
- fi
-
- # Variable id fuer naechsten Durchlauf speichern
- echo $id > /var/vpn/vpnid
-
- # id HEX wandeln
- hex=$(echo "obase=16; $id" |bc)
-
-
- # Abfrage ob Strinlaenge von hex kleiner als 2
- if [ ${#hex} -lt 2 ];
- then
- hex=0$hex
- fi
-
- black=$(cat /var/vpn/blacklist | grep $hex)
-
- if [ ${#black} -lt 2 ];
- then
- # Login-Daten aus Datenbank holen
- credentials=$(/home/christoph/squid_dynamic/squidy $hex)
- # Abfrage ob Datensatz leer :
-
- if [ ${#credentials} -gt 10 ];
- then
- zero="0"
- fi
- fi
- done
- echo "USING credentials: $credentials"
-
- sudo killall -9 unlinkd
- sudo killall -9 squid
-
- sudo rm /etc/squid3/squid.conf
-######################################################################################
-
-# Config- Datei schreiben.
-sudo echo -e -n "
-# Squid config by h44z
-
-# TAG: http_port
-# Usage: port
-# hostname:port
-# 1.2.3.4:port
-http_port 10.8.0.1:3128 transparent
-http_port 10.8.0.1:8080
-#https_port 10.8.0.1:8181 key=/etc/apache2/ssl/apache.pem
-
-
-visible_hostname vpnrack
-
-# TAG: icp_port
-icp_port 0
-
-# TAG: no_cache
-acl QUERY urlpath_regex cgi-bin \\?
-no_cache deny QUERY
-
-# TAG: cache_mem (bytes)
-cache_mem 32 MB
-
-# TAG: cache_dir
-cache_dir ufs /var/cache/squid 100 16 256
-
-# TAG: cache_access_log
-cache_access_log /var/log/squid/access.log
-
-# TAG: cache_log
-cache_log /var/log/squid/cache.log
-
-# TAG: cache_store_log
-cache_store_log /var/log/squid/store.log
-
-# TAG: emulate_httpd_log on|off
-emulate_httpd_log on
-
-# TAG: pid_filename
-pid_filename /var/run/squid.pid
-
-# TAG: cache_mgr
-cache_mgr christoph.haas2@students.htlinn.ac.at
-#blubber
-
-http_access allow all
-acl https port 443
-http_access allow https
-
-
-# TAG: http_reply_access
-# Allow replies to client requests. This is complementary to http_access.
-#http_reply_access allow all
-
-cache_peer 192.168.195.101 parent 8080 7 no-query default no-digest login=$credentials
-
-never_direct allow all
-" > /etc/squid3/squid.conf
-echo "Written credentials: $credentials"
-######################################################################################
- #restart squid
- sudo squid -D -YC -f /etc/squid3/squid.conf
-done
diff --git a/Admin/Modules/Squid_old/squid_dynamic/write_conf_file.bak b/Admin/Modules/Squid_old/squid_dynamic/write_conf_file.bak
deleted file mode 100755
index d3648c6..0000000
--- a/Admin/Modules/Squid_old/squid_dynamic/write_conf_file.bak
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/bin/bash
-# Script um die cache_peer funktion von Squid upzudaten.
-# V1.0
-# 13.10.2010
-# Stoeckholzer, Haas
-
-if [ ${#1} == 0 ];
-then
-echo "USAGE: write_conf_file updatetime"
-exit 0
-fi
-
-while [ "1" == "1" ] ; do
-
-sleep $1
-zero="1"
-
-while [ $zero == "1" ] ; do
-
-# Zaehlvariable einlesen
-id=$(cat /var/vpn/vpnid)
-
-# id inkrementieren
-let id=$id+1
-
-# 255 Overflow verhindern
-if [ $id -gt 254 ]
-then id=0
-fi
-
-# Variable id fuer naechsten Durchlauf speichern
-echo $id > /var/vpn/vpnid
-
-# id HEX wandeln
-hex=$(echo "obase=16; $id" |bc)
-
-# Abfrage ob Strinlaenge von hex kleiner als 2
-if [ ${#hex} -lt 2 ];
-then hex=0$hex
-fi
-
-# Login-Daten aus Datenbank holen
-credentials=$(/home/christoph/squid_dynamic/squidy $hex)
-# Abfrage ob Datensatz leer :
-
-if [ ${#credentials} -gt 10 ];
-then
- zero="0"
-fi
-echo "Schleife zero: $zero"
-echo "Schleife id: $id"
-echo "Schleife hex: $hex"
-done
-echo "USING zero: $zero"
-echo "USING id: $id"
-echo "USING hex: $hex"
-echo "USING credentials: $credentials"
-
-sudo killall -9 unlinkd
-sudo killall -9 squid
-
-sudo rm /etc/squid3/squid.conf
-######################################################################################
-
-# Config- Datei schreiben.
-sudo echo -e -n "
-# Squid config by h44z
-
-# TAG: http_port
-# Usage: port
-# hostname:port
-# 1.2.3.4:port
-http_port 10.8.0.1:3128 transparent
-http_port 10.8.0.1:8080
-#https_port 10.8.0.1:8181 key=/etc/apache2/ssl/apache.pem
-
-
-visible_hostname vpnrack
-
-# TAG: icp_port
-icp_port 0
-
-# TAG: no_cache
-acl QUERY urlpath_regex cgi-bin \\?
-no_cache deny QUERY
-
-# TAG: cache_mem (bytes)
-cache_mem 32 MB
-
-# TAG: cache_dir
-cache_dir ufs /var/cache/squid 100 16 256
-
-# TAG: cache_access_log
-cache_access_log /var/log/squid/access.log
-
-# TAG: cache_log
-cache_log /var/log/squid/cache.log
-
-# TAG: cache_store_log
-cache_store_log /var/log/squid/store.log
-
-# TAG: emulate_httpd_log on|off
-emulate_httpd_log on
-
-# TAG: pid_filename
-pid_filename /var/run/squid.pid
-
-# TAG: cache_mgr
-cache_mgr christoph.haas2@students.htlinn.ac.at
-#blubber
-
-http_access allow all
-acl https port 443
-http_access allow https
-
-
-# TAG: http_reply_access
-# Allow replies to client requests. This is complementary to http_access.
-#http_reply_access allow all
-
-cache_peer 192.168.195.101 parent 8080 7 no-query default no-digest login=$credentials
-
-never_direct allow all
-" > /etc/squid3/squid.conf
-echo "Written credentials: $credentials"
-######################################################################################
-#restart squid
-sudo squid -D -YC -f /etc/squid3/squid.conf
-
-done
diff --git a/Admin/Modules/Squid_old/squid_dynamic/write_conf_manuell b/Admin/Modules/Squid_old/squid_dynamic/write_conf_manuell
deleted file mode 100755
index c42e48e..0000000
--- a/Admin/Modules/Squid_old/squid_dynamic/write_conf_manuell
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/bin/bash
-# Script um die cache_peer funktion von Squid manuell von der Website aus upzudaten.
-# V1.0
-# 13.10.2010
-# Stoeckholzer, Haas
-
-while [ "1" == "1" ];
-do
-
- write=1
- zero=0
- # ueberpruefen ob file vpnid_man vorhanden
- if [ -e /var/vpn/vpnid_man ];
- then
- echo 1
- zero=1
- fi
-
- # ueberpruefen ob file vpnid_next vorhanden
- if [ -e /var/vpn/vpnid_next ];
- then
- echo 2
- zero=2
- fi
-
-
-
- if [ "$zero" == "1" ];
- then
- # Manuelle ID als hex einlesen einlesen
- hex=$(cat /var/vpn/vpnid_man)
- id=$(printf "%d\n" 0x$hex)
- echo $id > /var/vpn/vpnid
- rm /var/vpn/vpnid_man
- echo $hex
- # Login-Daten aus Datenbank holen
- credentials=$(/home/christoph/squid_dynamic/squidy $hex)
- fi
-
- if [ "$zero" == "2" ];
- then
- schleife="1"
- rm /var/vpn/vpnid_next
-
- while [ $schleife == "1" ] ;
- do
- # Zaehlvariable einlesen
- id_alt=$(cat /var/vpn/vpnid)
-
- # alte id HEX wandeln zum BLacklisten
- hex_alt=$(echo "obase=16; $id_alt" |bc)
-
- # Abfrage ob Strinlaenge von hex kleiner als 2
- if [ ${#hex_alt} -lt 2 ];
- then
- hex_alt=0$hex_alt
- fi
-
- # alte id BLacklisten
- if [ $write == 1 ];
- then
- echo $hex_alt >> /var/vpn/blacklist
- fi
-
- # id inkrementieren
- let id=$id_alt+1
-
- # 255 Overflow verhindern
- if [ $id -gt 254 ]
- then
- id=0
- fi
-
- # Variable id fuer naechsten Durchlauf speichern
- echo $id > /var/vpn/vpnid
-
- # id HEX wandeln
- hex=$(echo "obase=16; $id" |bc)
-
- # Abfrage ob Strinlaenge von hex kleiner als 2
- if [ ${#hex} -lt 2 ];
- then
- hex=0$hex
- fi
-
- # hole id_hex aus BLacklist?
- black=$(cat /var/vpn/blacklist|grep $hex)
-
- # Abfrage ob id_hex in BLacklist
- if [ ${#black} -lt 2 ];
- then
- # Login-Daten aus Datenbank holen
- credentials=$(/home/christoph/squid_dynamic/squidy $hex)
-
- # Abfrage ob Datensatz leer :
- if [ ${#credentials} -gt 10 ];
- then
- schleife="0"
- fi
- else write=0
- fi
- done
- fi
-
-
- # Abfrage ob Datensatz leer (zur Sicherheit):
- if [ ${#credentials} -gt 10 ] && [ $zero != "0" ];
- then
-
- # stop squid
- sudo killall -9 unlinkd
- sudo killall -9 squid
-
- sudo rm /etc/squid3/squid.conf
-######################################################################################
- # Config- Datei schreiben.
-sudo echo -e -n "
-# Squid config by h44z
-
-# TAG: http_port
-# Usage: port
-# hostname:port
-# 1.2.3.4:port
-http_port 10.8.0.1:3128 transparent
-http_port 10.8.0.1:8080
-#https_port 10.8.0.1:8181 key=/etc/apache2/ssl/apache.pem
-
-
-visible_hostname vpnrack
-
-# TAG: icp_port
-icp_port 0
-
-# TAG: no_cache
-acl QUERY urlpath_regex cgi-bin \\?
-no_cache deny QUERY
-
-# TAG: cache_mem (bytes)
-cache_mem 32 MB
-
-# TAG: cache_dir
-cache_dir ufs /var/cache/squid 100 16 256
-
-# TAG: cache_access_log
-cache_access_log /var/log/squid/access.log
-
-# TAG: cache_log
-cache_log /var/log/squid/cache.log
-
-# TAG: cache_store_log
-cache_store_log /var/log/squid/store.log
-
-# TAG: emulate_httpd_log on|off
-emulate_httpd_log on
-
-# TAG: pid_filename
-pid_filename /var/run/squid.pid
-
-# TAG: cache_mgr
-cache_mgr christoph.haas2@students.htlinn.ac.at
-
-http_access allow all
-acl https port 443
-http_access allow https
-
-
-# TAG: http_reply_access
-# Allow replies to client requests. This is complementary to http_access.
-#http_reply_access allow all
-
-cache_peer 192.168.195.101 parent 8080 7 no-query default no-digest login=$credentials
-
-never_direct allow all
-" > /etc/squid3/squid.conf
-######################################################################################
-
- echo "Written: $credentials"
-
- #start squid
- squid -D -YC -f /etc/squid3/squid.conf
-fi
-sleep 2
-done
diff --git a/Admin/Modules/Squid_old/squid_dynamic/write_conf_manuell.bak b/Admin/Modules/Squid_old/squid_dynamic/write_conf_manuell.bak
deleted file mode 100755
index fc83012..0000000
--- a/Admin/Modules/Squid_old/squid_dynamic/write_conf_manuell.bak
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/bin/bash
-# Script um die cache_peer funktion von Squid manuell von der Website aus upzudaten.
-# V1.0
-# 13.10.2010
-# Stoeckholzer, Haas
-
-while [ "1" == "1" ];
-do
-
- zero=0
- # ueberpruefen ob file vpnid_man vorhanden
- if [ -e /var/vpn/vpnid_man ];
- then
- echo 1
- zero=1
- fi
-
- # ueberpruefen ob file vpnid_next vorhanden
- if [ -e /var/vpn/vpnid_next ];
- then
- echo 2
- zero=2
- fi
-
-
-
- if [ "$zero" == "1" ];
- then
- # Manuelle ID als hex einlesen einlesen
- hex=$(cat /var/vpn/vpnid_man)
- id=$(printf "%d\n" $hex)
- echo $id > /var/vpn/vpnid
- rm /var/vpn/vpnid_man
- echo $hex
- # Login-Daten aus Datenbank holen
- credentials=$(/home/christoph/squid_dynamic/squidy $hex)
- fi
-
- if [ "$zero" == "2" ];
- then
- schleife="1"
- rm /var/vpn/vpnid_next
-
- while [ $schleife == "1" ] ;
- do
- # Zaehlvariable einlesen
- id=$(cat /var/vpn/vpnid)
- # id inkrementieren
- let id=$id+1
-
- # 255 Overflow verhindern
- if [ $id -gt 254 ]
- then
- id=0
- fi
-
- # Variable id fuer naechsten Durchlauf speichern
- echo $id > /var/vpn/vpnid
-
- # id HEX wandeln
- hex=$(echo "obase=16; $id" |bc)
-
- # Abfrage ob Strinlaenge von hex kleiner als 2
- if [ ${#hex} -lt 2 ];
- then
- hex=0$hex
- fi
-
- # Login-Daten aus Datenbank holen
- credentials=$(/home/christoph/squid_dynamic/squidy $hex)
-
- # Abfrage ob Datensatz leer :
- if [ ${#credentials} -gt 10 ];
- then
- schleife="0"
- fi
- done
- fi
-
-
- # Abfrage ob Datensatz leer (zur Sicherheit):
- if [ ${#credentials} -gt 10 ] && [ $zero != "0" ];
- then
-
- # stop squid
- sudo killall -9 unlinkd
- sudo killall -9 squid
-
- sudo rm /etc/squid3/squid.conf
-######################################################################################
- # Config- Datei schreiben.
-sudo echo -e -n "
-# Squid config by h44z
-
-# TAG: http_port
-# Usage: port
-# hostname:port
-# 1.2.3.4:port
-http_port 10.8.0.1:3128 transparent
-http_port 10.8.0.1:8080
-#https_port 10.8.0.1:8181 key=/etc/apache2/ssl/apache.pem
-
-
-visible_hostname vpnrack
-
-# TAG: icp_port
-icp_port 0
-
-# TAG: no_cache
-acl QUERY urlpath_regex cgi-bin \\?
-no_cache deny QUERY
-
-# TAG: cache_mem (bytes)
-cache_mem 32 MB
-
-# TAG: cache_dir
-cache_dir ufs /var/cache/squid 100 16 256
-
-# TAG: cache_access_log
-cache_access_log /var/log/squid/access.log
-
-# TAG: cache_log
-cache_log /var/log/squid/cache.log
-
-# TAG: cache_store_log
-cache_store_log /var/log/squid/store.log
-
-# TAG: emulate_httpd_log on|off
-emulate_httpd_log on
-
-# TAG: pid_filename
-pid_filename /var/run/squid.pid
-
-# TAG: cache_mgr
-cache_mgr christoph.haas2@students.htlinn.ac.at
-
-http_access allow all
-acl https port 443
-http_access allow https
-
-
-# TAG: http_reply_access
-# Allow replies to client requests. This is complementary to http_access.
-#http_reply_access allow all
-
-cache_peer 192.168.195.101 parent 8080 7 no-query default no-digest login=$credentials
-
-never_direct allow all
-" > /etc/squid3/squid.conf
-######################################################################################
-
- echo "Written: $credentials"
-
- #start squid
- squid -D -YC -f /etc/squid3/squid.conf
-fi
-sleep 2
-done
diff --git a/Admin/Modules/Squid_old/startsquid b/Admin/Modules/Squid_old/startsquid
deleted file mode 100755
index 4dccfde..0000000
--- a/Admin/Modules/Squid_old/startsquid
+++ /dev/null
@@ -1,5 +0,0 @@
-/home/christoph/stopsquid
-
-#iptables -t nat -A PREROUTING -i tap0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
-#iptables -t nat -A PREROUTING -i tap0 -p tcp --dport 443 -j REDIRECT --to-ports 3128
-squid -D -YC -f /etc/squid3/squid.conf
diff --git a/Admin/Modules/Squid_old/stopsquid b/Admin/Modules/Squid_old/stopsquid
deleted file mode 100755
index 91187a6..0000000
--- a/Admin/Modules/Squid_old/stopsquid
+++ /dev/null
@@ -1,6 +0,0 @@
-#iptables -t nat -D PREROUTING -i tap0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
-#iptables -t nat -D PREROUTING -i tap0 -p tcp --dport 443 -j REDIRECT --to-ports 3128
-
-killall squid
-killall squid
-killall squid
diff --git a/Admin/Modules/Usermanagement/index.php b/Admin/Modules/Usermanagement/index.php
index 4370272..1d44e9c 100755
--- a/Admin/Modules/Usermanagement/index.php
+++ b/Admin/Modules/Usermanagement/index.php
@@ -1,3 +1,6 @@
+
+
diff --git a/Modules/ServerTraffic/index.php b/Modules/ServerTraffic/index.php
index e86649d..5b50eda 100644
--- a/Modules/ServerTraffic/index.php
+++ b/Modules/ServerTraffic/index.php
@@ -76,20 +76,20 @@ function Potenz($sent_sum)
$sql = "SELECT * FROM $table ORDER BY $by $sort;";
$result = mysql_query($sql);
- echo "";
+ echo "";
if($table=='connections')
{
- echo "Start Time Stop Time Client IP Download
+ echo " Start Time Stop Time Client IP Download
Upload \n";
}
else if($table=='month')
{
- echo "Month Year Connection Time Download
+ echo " Month Year Connection Time Download
Upload \n";
}
else if($table=='year')
{
- echo "Year Connection Time Download
+ echo " Year Connection Time Download
Upload \n";
}
else
diff --git a/Modules/UserControl/change.php b/Modules/UserControl/change.php
index 648ffea..ddea0a0 100755
--- a/Modules/UserControl/change.php
+++ b/Modules/UserControl/change.php
@@ -16,7 +16,6 @@ echo "
Nachname: ".$_SESSION["user_nachname"]."
Vorname: ".$_SESSION["user_vorname"]."
Email: ".$_SESSION["user_email"]."
- Novell Login: ".$_SESSION["user_novlogin"]."
Avatar: ".$_SESSION["user_avatar"]."
Passwort:
-
-
- Novell Login (Email):
-
-
-
- Novell Password:
-
-
+
diff --git a/Modules/UserControl/edituser.php b/Modules/UserControl/edituser.php
index 1033adf..63789f9 100755
--- a/Modules/UserControl/edituser.php
+++ b/Modules/UserControl/edituser.php
@@ -17,8 +17,6 @@ $benutzer["Kennwort"] = mysql_real_escape_string($_REQUEST["pwd"]);
$benutzer["Nachname"] = mysql_real_escape_string($_REQUEST["nachname"]);
$benutzer["Vorname"] = mysql_real_escape_string($_REQUEST["vorname"]);
$benutzer["Avatar"] = mysql_real_escape_string($_REQUEST["avatar"]);
-$benutzer["NovLogin"] = mysql_real_escape_string($_REQUEST["novlogin"]);
-$benutzer["NovPass"] = mysql_real_escape_string($_REQUEST["novpass"]);
$moduleurl = $_REQUEST["path"];
if($_SESSION["user_id"] != $benutzer["id"])
@@ -67,30 +65,12 @@ $sql = "UPDATE userdata SET ";
}
$sql = $sql . "Avatar='". $benutzer["Avatar"]."' ";
$strcount = 1;
- }
- if($benutzer["NovLogin"] != "")
- {
- if($strcount==1)
- {
- $sql = $sql . ",";
- }
- $sql = $sql . "NovLogin='". $benutzer["NovLogin"]."' ";
- $strcount = 1;
- }
- if($benutzer["NovPass"] != "")
- {
- if($strcount==1)
- {
- $sql = $sql . ",";
- }
- $sql = $sql . "NovPass='". $benutzer["NovPass"]."' ";
- $strcount = 1;
}
$sql = $sql . "WHERE id = '" . $benutzer["id"]."'";
//echo $sql;
mysql_query ($sql);
$sql = "SELECT ".
- "Id, VPNId, IsAdmin, Nickname, Nachname, Vorname, Email, Avatar, NovLogin, NovPass ".
+ "Id, VPNId, IsAdmin, Nickname, Nachname, Vorname, Email, Avatar, ".
"FROM ".
"userdata ".
"WHERE ".
@@ -113,8 +93,6 @@ if (mysql_num_rows ($result) > 0)
$_SESSION["user_vorname"] = $data["Vorname"];
$_SESSION["user_email"] = $data["Email"];
$_SESSION["user_avatar"] = $data["Avatar"];
- $_SESSION["user_novlogin"] = $data["NovLogin"];
- $_SESSION["user_novpass"] = $data["NovPass"];
mysql_close();
header ("Location: ".$moduleurl."&uebergabe=0");
}
diff --git a/Modules/UserControl/index.php b/Modules/UserControl/index.php
index 3b3a649..d48bf42 100755
--- a/Modules/UserControl/index.php
+++ b/Modules/UserControl/index.php
@@ -51,13 +51,13 @@ echo "