projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix SUID banner on skin OpenWeb
[platal.git]
/
classes
/
corelogger.php
diff --git
a/classes/corelogger.php
b/classes/corelogger.php
index
5797236
..
e5784c6
100644
(file)
--- a/
classes/corelogger.php
+++ b/
classes/corelogger.php
@@
-19,13
+19,14
@@
*/
*/
-class CoreLogger {
+class CoreLogger
+{
/** user id */
/** user id */
-
var
$uid;
+
public
$uid;
/** id of the session */
/** id of the session */
-
var
$session;
+
private
$session;
/** list of available actions */
/** list of available actions */
-
var
$actions;
+
private
$actions;
/** The constructor, creates a new entry in the sessions table
*
/** The constructor, creates a new entry in the sessions table
*
@@
-33,7
+34,8
@@
class CoreLogger {
* @param $suid the id of the administrator who has just su'd to the user
* @return VOID
*/
* @param $suid the id of the administrator who has just su'd to the user
* @return VOID
*/
- function CoreLogger($uid, $suid='') {
+ public function __construct($uid, $suid = 0)
+ {
// write the session entry
$this->uid = $uid;
$this->session = $this->writeSession($uid, $suid);
// write the session entry
$this->uid = $uid;
$this->session = $this->writeSession($uid, $suid);
@@
-52,7
+54,7
@@
class CoreLogger {
* @param $suid the id of the administrator who has just su'd to the user
* @return session the session id
*/
* @param $suid the id of the administrator who has just su'd to the user
* @return session the session id
*/
-
function writeSession($uid, $suid = null
)
+
private function writeSession($uid, $suid = 0
)
{
$ip = $_SERVER['REMOTE_ADDR'];
$host = strtolower(gethostbyaddr($_SERVER['REMOTE_ADDR']));
{
$ip = $_SERVER['REMOTE_ADDR'];
$host = strtolower(gethostbyaddr($_SERVER['REMOTE_ADDR']));
@@
-69,7
+71,7
@@
class CoreLogger {
}
XDB::execute("INSERT INTO logger.sessions
}
XDB::execute("INSERT INTO logger.sessions
- SET uid={?}, host={?}, ip={?}, forward_ip={?}, forward_host={?}, browser={?}, suid={?}, flags={?}",
+
SET uid={?}, host={?}, ip={?}, forward_ip={?}, forward_host={?}, browser={?}, suid={?}, flags={?}",
$uid, $host, $ip, $forward_ip, $forward_host, $browser, $suid, $proxy);
return XDB::insertId();
$uid, $host, $ip, $forward_ip, $forward_host, $browser, $suid, $proxy);
return XDB::insertId();
@@
-79,18
+81,20
@@
class CoreLogger {
/** Logs an action and its related data.
*
* @param $action le type d'action
/** Logs an action and its related data.
*
* @param $action le type d'action
- * @param $data les donn
é
es (id de liste, etc.)
+ * @param $data les donn
é
es (id de liste, etc.)
* @return VOID
*/
* @return VOID
*/
- function log($action, $data = null) {
+ public function log($action, $data = null)
+ {
if (isset($this->actions[$action])) {
XDB::execute("INSERT INTO logger.events
if (isset($this->actions[$action])) {
XDB::execute("INSERT INTO logger.events
- SET session={?}, action={?}, data={?}",
+
SET session={?}, action={?}, data={?}",
$this->session, $this->actions[$action], $data);
} else {
$this->session, $this->actions[$action], $data);
} else {
-
echo "unknown action : $action<br />"
;
+
trigger_error("CoreLogger: unknown action, $action", E_USER_WARNING)
;
}
}
}
}
}
}
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
?>