Subversion-Projekte lars-tiefland.openvz_admin

Revision

Revision 9 | Revision 12 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 9 Revision 10
Zeile 1... Zeile 1...
1
<?
1
<?
2
	//$Id: functions.php 9 2007-09-25 18:24:34Z lars $
2
	//$Id: functions.php 10 2007-09-26 19:32:38Z lars $
3
	$dir=dirname($_SERVER["PHP_SELF"]);
3
	$dir=dirname($_SERVER["PHP_SELF"]);
4
	$host="http://".$_SERVER["SERVER_NAME"];
4
	$host="http://".$_SERVER["SERVER_NAME"];
5
	$url=$host.$dir;
5
	$url=$host.$dir;
6
	$pear_logger=&create_pear_logger();
6
	$pear_logger=&create_pear_logger();
7
	$php_logger=&create_php_logger();
7
/*	$php_logger=&create_php_logger();
8
	set_error_handler('errorHandler_PHP');
8
	set_error_handler('errorHandler_PHP');
9
	PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errorHandler');
9
	PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errorHandler');*/
10
	$u=null;
10
	$u=null;
11
	$a=null;
11
	$a=null;
12
	$username=(isset($_POST["username"]))?$_POST["username"]:"";
12
	$username=(isset($_POST["username"]))?$_POST["username"]:"";
Zeile 13... Zeile 13...
13
 
13
 
Zeile 66... Zeile 66...
66
		global $url;
66
		global $url;
67
		$file_params["mode"]="666";
67
		$file_params["mode"]="666";
68
    		$file_params["lineFormat"] = '%1$s %2$s [%3$s] %4$s %5$s %6$s %7$s';
68
    		$file_params["lineFormat"] = '%1$s %2$s [%3$s] %4$s %5$s %6$s %7$s';
69
		$mail_params["from"]="Lars Tiefland <webmaster@lars-tiefland.de>";
69
		$mail_params["from"]="Lars Tiefland <webmaster@lars-tiefland.de>";
70
		$mail_params["subject"]="PHP Fehler auf $url";
70
		$mail_params["subject"]="PHP Fehler auf $url";
71
		$l1=&Log::singleton("file","php_errors.log","fifa_php",$file_params);
71
		$l1=&Log::factory("file","php_errors.log","fifa_php",$file_params);
72
		$l2=&Log::singleton("mail","ltiefland@gmail.com","fifa_php",$mail_params);
72
		$l2=&Log::factory("mail","ltiefland@gmail.com","fifa_php",$mail_params);
73
		$l3=&Log::singleton("composite");
73
		$l3=&Log::factory("composite");
74
		$c1=$l3->addChild($l1);
74
		$c1=$l3->addChild($l1);
75
//		$c2=$l3->addChild($l2);
75
		$c2=$l3->addChild($l2);
76
		return $l3;
76
		return $l3;
77
	}
77
	}
Zeile 78... Zeile 78...
78
 
78
 
79
	function create_pear_logger()
79
	function create_pear_logger()
80
	{
80
	{
81
		global $url;
81
		global $url;
82
		$file_params["mode"]="666";
82
		$file_params["mode"]="666";
83
    		$file_params["lineFormat"] = '%1$s %2$s [%3$s] %4$s %5$s %6$s %7$s';
83
    		$file_params["lineFormat"] = '%1$s %2$s [%3$s] %4$s %5$s %6$s %7$s';
84
		$mail_params["from"]="Lars Tiefland <webmaster@lars-tiefland.de>";
84
		$mail_params["from"]="Lars Tiefland <webmaster@lars-tiefland.de>";
85
		$mail_params["subject"]="PEAR Fehler auf $url";
85
		$mail_params["subject"]="PEAR Fehler auf $url";
86
		$l1=&Log::singleton("file","pear_errors.log","fifa_pear",$file_params);
86
		$l1=&Log::factory("file","pear_errors.log","fifa_pear",$file_params);
87
		$l2=&Log::singleton("mail","ltiefland@gmail.com","fifa_pear",$mail_params);
87
		$l2=&Log::factory("mail","ltiefland@gmail.com","fifa_pear",$mail_params);
88
		$l3=&Log::singleton("composite");
88
		$l3=&Log::factory("composite");
89
		$c1=$l3->addChild($l1);
89
		$c1=$l3->addChild($l1);
90
//		$c2=$l3->addChild($l2);
90
		$c2=$l3->addChild($l2);
91
		return $l3;
91
		return $l3;
Zeile 92... Zeile 92...
92
	}
92
	}
93
 
93
 
Zeile 447... Zeile 447...
447
	{
447
	{
448
		global $u_id, $u_name, $pending, $email, $db;
448
		global $u_id, $u_name, $pending, $email, $db;
449
		$t_stamp=time();
449
		$t_stamp=time();
450
		$sql="INSERT INTO log (user_id, datum, message) VALUES ($u_id, $t_stamp, '$message')";
450
		$sql="INSERT INTO log (user_id, datum, message) VALUES ($u_id, $t_stamp, '$message')";
451
		$r=$db->query($sql);
451
		$r=$db->query($sql);
452
		$res=(!DB::isError($r));
452
		$res=(!PEAR::isError($r));
453
		return $res;
453
		return $res;
454
	}
454
	}
Zeile 455... Zeile 455...
455
 
455
 
456
	function get_log_entries()
456
	function get_log_entries()
457
	{
457
	{
458
		global $db;
458
		global $db;
459
		$sql="SELECT * FROM log";
459
		$sql="SELECT * FROM log";
460
		$res=$db->query($sql);
460
		$res=$db->query($sql);
461
		if(!DB::isError($res))
461
		if(!PEAR::isError($res))
462
		{
462
		{
463
			$anz=$res->num_Rows();
463
			$anz=$res->num_Rows();
464
		}
464
		}
465
		else
465
		else