guardian46
Založený: 31.05.2005
Príspevky: 34
Zaslal: 2005-06-14 18:32
Návrat hore
Odpovedať s citátom
|
I am using a php app (phpSecurePages) and MySQL for usernames and passwords for login to phpMyEdit web pages. I have activated the changelog option and changes are being recorded, except the user's username. I know that phpSecurePages creates the variable $login for the sessions because I am using it in a filter. Can anyone help me get PME to use this to plug in the username in the changelog?
I found this:
http://opensource.platon.sk/forum/projects/viewtopic.php?t=199&highlight=changelog
but was unable to make it work for me.
I am using the phpMyEdit-mce-cal.class.php dated 4/20/04, and phpMyEdit.class.php ver 1.167.
Thanks
|
guardian46
Založený: 31.05.2005
Príspevky: 34
Zaslal: 2005-06-20 21:03
Návrat hore
Odpovedať s citátom
|
Thanks for the suggestion, Doug. That looks like what I need. But, since I don't have a clue about php code, I don't really know what to do with it. I gave it a try by changing, in the phpMyEdit.class.php file this:
| Kód: |
// Note change in log table
if ($this->logtable) {
$query = sprintf('INSERT INTO %s'
.' (updated, user, host, operation, tab, rowkey, col, oldval, newval)'
.' VALUES (NOW(), "%s", "%s", "insert", "%s", "%s", "", "", "%s")',
$this->logtable, addslashes($this->get_server_var('REMOTE_USER')),
addslashes($this->get_server_var('REMOTE_ADDR')), addslashes($this->tb),
addslashes($key_col_val), addslashes(serialize($newvals)));
$this->myquery($query, __LINE__);
}
|
To this:
| Kód: |
// Note change in log table
if ($this->logtable) {
if(empty($_SERVER['REMOTE_USER'])){
($_SERVER['REMOTE_USER']) = $login;
}
$query = sprintf('INSERT INTO %s'
.' (updated, user, host, operation, tab, rowkey, col, oldval, newval)'
.' VALUES (NOW(), "%s", "%s", "insert", "%s", "%s", "", "", "%s")',
$this->logtable, addslashes($this->get_server_var('REMOTE_USER')),
addslashes($this->get_server_var('REMOTE_ADDR')), addslashes($this->tb),
addslashes($key_col_val), addslashes(serialize($newvals)));
$this->myquery($query, __LINE__);
} |
But that caused these errors:
Parse error: parse error in /var/www/html/mgrs/phpMyEdit.class.php on line 2464
Fatal error: Class phpmyedit_mce_cal: Cannot inherit from undefined class phpmyedit in /var/www/html/mgrs/extensions/phpMyEdit-mce-cal.class.php on line 262
Any help would be appreciated.
|
guardian46
Založený: 31.05.2005
Príspevky: 34
Zaslal: 2005-06-22 17:12
Návrat hore
Odpovedať s citátom
|
Thanks Doug, I added it to my form calling file as the next line after the $opts['logtable'] = 'changelog'; and it's working there.
FYI, the code caused a parse error until I removed the ")" just before the equal sign:
| Kód: |
| if(empty($_SERVER['REMOTE_USER'])) { $_SERVER['REMOTE_USER'] = $login; } |
Again, thanks for the help, I really appreciate it.
|
TechJammer
Založený: 06.03.2008
Príspevky: 1
Zaslal: 2008-03-06 20:59
Návrat hore
Odpovedať s citátom
|
Nice tip all: Guardian, I used your suggestion and it worked perfectly! Thanks!
|
|
Odoslať novú tému
Odpovedať na tému
|
|