bernd commited on 2007-06-17 08:58:53
Zeige 8 geänderte Dateien mit 54 Einfügungen und 3 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@509 87cf0b9e-d624-0410-a070-f6ee81989793
| ... | ... |
@@ -28,7 +28,7 @@ $prefix = $prefix.str_repeat("../", $count);
|
| 28 | 28 |
require_once('session/start.php');
|
| 29 | 29 |
|
| 30 | 30 |
$output = ""; |
| 31 |
-include("inc/base.php");
|
|
| 31 |
+require_once("inc/base.php");
|
|
| 32 | 32 |
/* setup module include path */ |
| 33 | 33 |
ini_set('include_path',ini_get('include_path').':./modules/'.dirname($go).'/include:');
|
| 34 | 34 |
|
| ... | ... |
@@ -1,5 +1,30 @@ |
| 1 | 1 |
<?php |
| 2 | 2 |
|
| 3 |
+require_once('inc/db_connect.php');
|
|
| 4 |
+ |
|
| 5 |
+function logger($scriptname, $scope, $message) |
|
| 6 |
+{
|
|
| 7 |
+ $user = 'NULL'; |
|
| 8 |
+ if ($_SESSION['role'] == ROLE_SYSTEMUSER) |
|
| 9 |
+ $user = "'{$_SESSION['userinfo']['username']}'";
|
|
| 10 |
+ elseif ($_SESSION['role'] == ROLE_CUSTOMER) |
|
| 11 |
+ $user = "'{$_SESSION['customerinfo']['customerno']}'";
|
|
| 12 |
+ |
|
| 13 |
+ $remote = mysql_real_escape_string($_SERVER['REMOTE_ADDR']); |
|
| 14 |
+ |
|
| 15 |
+ $scriptname = mysql_real_escape_string($scriptname); |
|
| 16 |
+ $scope = mysql_real_escape_string($scope); |
|
| 17 |
+ $message = mysql_real_escape_string($message); |
|
| 18 |
+ |
|
| 19 |
+ $query = "INSERT INTO misc.scriptlog (remote, user,scriptname,scope,message) VALUES ('{$remote}', {$user}, '{$scriptname}', '{$scope}', '{$message}');";
|
|
| 20 |
+ DEBUG($query); |
|
| 21 |
+ @mysql_query($query); |
|
| 22 |
+ if (mysql_error()) |
|
| 23 |
+ system_failure(mysql_error()); |
|
| 24 |
+ |
|
| 25 |
+} |
|
| 26 |
+ |
|
| 27 |
+ |
|
| 3 | 28 |
function output($arg) |
| 4 | 29 |
{
|
| 5 | 30 |
global $output; |
| ... | ... |
@@ -2,6 +2,7 @@ |
| 2 | 2 |
|
| 3 | 3 |
require_once('inc/debug.php');
|
| 4 | 4 |
require_once('inc/db_connect.php');
|
| 5 |
+require_once('inc/base.php');
|
|
| 5 | 6 |
|
| 6 | 7 |
function mailaccounts($uid) |
| 7 | 8 |
{
|
| ... | ... |
@@ -87,6 +88,7 @@ function change_mailaccount($id, $arr) |
| 87 | 88 |
mysql_query($query); |
| 88 | 89 |
if (mysql_error()) |
| 89 | 90 |
system_failure('Beim Ändern der Account-Daten ist ein Fehler aufgetreten. Sollte dies wiederholt vorkommen, senden Sie bitte die Fehlermeldung ('.mysql_error().') an einen Administrator.');
|
| 91 |
+ logger("modules/imap/include/mailaccounts.php", "imap", "updated account »{$arr['account']}«");
|
|
| 90 | 92 |
|
| 91 | 93 |
} |
| 92 | 94 |
|
| ... | ... |
@@ -128,6 +130,7 @@ function create_mailaccount($arr) |
| 128 | 130 |
mysql_query($query); |
| 129 | 131 |
if (mysql_error()) |
| 130 | 132 |
system_failure('Beim Anlegen des Kontos ist ein Fehler aufgetreten. Sollte dies wiederholt vorkommen, senden Sie bitte die Fehlermeldung ('.mysql_error().') an einen Administrator.');
|
| 133 |
+ logger("modules/imap/include/mailaccounts.php", "imap", "created account »{$arr['account']}«");
|
|
| 131 | 134 |
|
| 132 | 135 |
} |
| 133 | 136 |
|
| ... | ... |
@@ -139,6 +142,7 @@ function delete_mailaccount($id) |
| 139 | 142 |
mysql_query($query); |
| 140 | 143 |
if (mysql_error()) |
| 141 | 144 |
system_failure('Beim Löschen des Kontos ist ein Fehler aufgetreten. Sollte dies wiederholt vorkommen, senden Sie bitte die Fehlermeldung ('.mysql_error().') an einen Administrator.');
|
| 145 |
+ logger("modules/imap/include/mailaccounts.php", "imap", "deleted account »{$id}«");
|
|
| 142 | 146 |
} |
| 143 | 147 |
|
| 144 | 148 |
|
| ... | ... |
@@ -4,8 +4,11 @@ require_once('session/start.php');
|
| 4 | 4 |
|
| 5 | 5 |
require_once('inc/error.php');
|
| 6 | 6 |
|
| 7 |
+logger("modules/index/logout.php", "logout", "logged out");
|
|
| 8 |
+ |
|
| 7 | 9 |
if (!session_destroy()) |
| 8 | 10 |
{
|
| 11 |
+ logger("modules/index/logout.php", "logout", "session timed out.");
|
|
| 9 | 12 |
system_failure('Die Sitzung konnte nicht geschlossen werden, eventuell ist die Wartezeit abgelaufen und die Sitzung wurde daher schon beendet.');
|
| 10 | 13 |
} |
| 11 | 14 |
unset($_SESSION['role']); |
| ... | ... |
@@ -12,7 +12,9 @@ if (isset($_POST['customerno'])) |
| 12 | 12 |
if (create_token($_POST['customerno'])) |
| 13 | 13 |
{
|
| 14 | 14 |
require_once('mail.php');
|
| 15 |
+ require_once('inc/base.php');
|
|
| 15 | 16 |
send_customer_token($_POST['customerno']); |
| 17 |
+ logger("modules/index/new_password.php", "pwrecovery", "token sent for customer »{$_POST['customerno']}«");
|
|
| 16 | 18 |
success_msg('Die angegebenen Daten waren korrekt, Sie sollten umgehend eine E-Mail erhalten.');
|
| 17 | 19 |
} |
| 18 | 20 |
} |
| ... | ... |
@@ -21,6 +21,8 @@ if (isset($_REQUEST['customerno']) and isset($_REQUEST['token'])) |
| 21 | 21 |
else |
| 22 | 22 |
{
|
| 23 | 23 |
require_once('session/checkuser.php');
|
| 24 |
+ require_once('inc/base.php');
|
|
| 25 |
+ logger("modules/index/validate_token.php", "pwrecovery", "customer »{$customerno}« set a new password");
|
|
| 24 | 26 |
set_customer_password($customerno, $_POST['password']); |
| 25 | 27 |
success_msg('Das Passwort wurde gesetzt!');
|
| 26 | 28 |
invalidate_customer_token($customerno); |
| ... | ... |
@@ -1,5 +1,6 @@ |
| 1 | 1 |
<?php |
| 2 | 2 |
|
| 3 |
+require_once('inc/base.php');
|
|
| 3 | 4 |
require_once('inc/debug.php');
|
| 4 | 5 |
require_once('inc/error.php');
|
| 5 | 6 |
|
| ... | ... |
@@ -111,8 +112,11 @@ function set_customer_password($customerno, $newpass) |
| 111 | 112 |
$query = "UPDATE kundendaten.kunden SET passwort='$newpass' WHERE id='".$customerno."' LIMIT 1"; |
| 112 | 113 |
@mysql_query($query); |
| 113 | 114 |
if (mysql_error()) |
| 115 |
+ {
|
|
| 116 |
+ logger("session/checkuser.php", "dberror", "error while changing customer's password. Query was: »$query«");
|
|
| 114 | 117 |
system_failure('Beim Datenbankzugriff ist ein Fehler aufgetreten. Sollte dies wiederholt vorkommen, senden Sie bitte die Fehlermeldung ('.mysql_error().') an einen Administrator.');
|
| 115 |
- |
|
| 118 |
+ } |
|
| 119 |
+ logger("session/checkuser.php", "pwchange", "changed customer's password.");
|
|
| 116 | 120 |
} |
| 117 | 121 |
|
| 118 | 122 |
|
| ... | ... |
@@ -125,8 +129,12 @@ function set_systemuser_password($uid, $newpass) |
| 125 | 129 |
$query = "UPDATE system.passwoerter SET passwort='$newpass' WHERE uid='".$uid."' LIMIT 1"; |
| 126 | 130 |
@mysql_query($query); |
| 127 | 131 |
if (mysql_error()) |
| 132 |
+ {
|
|
| 133 |
+ logger("session/checkuser.php", "dberror", "error while changing user's password. Query was: »$query«");
|
|
| 128 | 134 |
system_failure('Beim Datenbankzugriff ist ein Fehler aufgetreten. Sollte dies wiederholt vorkommen, senden Sie bitte die Fehlermeldung ('.mysql_error().') an einen Administrator.');
|
| 129 | 135 |
} |
| 136 |
+ logger("session/checkuser.php", "pwchange", "changed user's password.");
|
|
| 137 |
+} |
|
| 130 | 138 |
|
| 131 | 139 |
|
| 132 | 140 |
/* |
| ... | ... |
@@ -9,9 +9,13 @@ require_once('session/checkuser.php');
|
| 9 | 9 |
require_once('inc/error.php');
|
| 10 | 10 |
require_once('inc/debug.php');
|
| 11 | 11 |
|
| 12 |
+require_once('inc/base.php');
|
|
| 13 |
+ |
|
| 12 | 14 |
if (!session_start()) |
| 15 |
+{
|
|
| 16 |
+ logger("session/start.php", "session", "Die session konnte nicht gestartet werden!");
|
|
| 13 | 17 |
system_failure('Die Sitzung konnte nicht gestartet werden, bitte benachrichtigen Sie den Administrator!');
|
| 14 |
- |
|
| 18 |
+} |
|
| 15 | 19 |
|
| 16 | 20 |
DEBUG("<pre>POST-DATA: ".htmlspecialchars(print_r($_POST, true))."\nSESSION_DATA: ".htmlspecialchars(print_r($_SESSION, true))."</pre>");
|
| 17 | 21 |
|
| ... | ... |
@@ -21,6 +25,7 @@ if (isset($_POST['username']) && isset($_POST['password'])) |
| 21 | 25 |
if ($role === NULL) |
| 22 | 26 |
{
|
| 23 | 27 |
$_SESSION['role'] = ROLE_ANONYMOUS; |
| 28 |
+ logger("session/start.php", "login", "wrong user data");
|
|
| 24 | 29 |
login_screen('Ihre Anmeldung konnte nicht durchgeführt werden. Vermutlich haben Sie falsche Zugangsdaten eingegeben.');
|
| 25 | 30 |
} |
| 26 | 31 |
else |
| ... | ... |
@@ -33,10 +38,12 @@ if (isset($_POST['username']) && isset($_POST['password'])) |
| 33 | 38 |
case ROLE_SYSTEMUSER: |
| 34 | 39 |
$info = get_user_info($_POST['username']); |
| 35 | 40 |
$_SESSION['userinfo'] = $info; |
| 41 |
+ logger("session/start.php", "login", "logged in user »{$info['username']}«");
|
|
| 36 | 42 |
break; |
| 37 | 43 |
case ROLE_CUSTOMER: |
| 38 | 44 |
$info = get_customer_info($_POST['username']); |
| 39 | 45 |
$_SESSION['customerinfo'] = $info; |
| 46 |
+ logger("session/start.php", "login", "logged in customer no »{$info['customerno']}«");
|
|
| 40 | 47 |
break; |
| 41 | 48 |
} |
| 42 | 49 |
} |
| 43 | 50 |