Re: [phplib] PHPlib: Additional Username From: Max A. Derkachev (kot <email protected>)
Date: 01/10/01

Hello Christian,

Wednesday, January 10, 2001, 11:49:00 AM, you wrote:

CTblc> Hi,

CTblc> can anybody tell me at which position in the phplib I can add a field
CTblc> username to table active_sessions ?

If you add a field 'username' to the active_sessions, you'll need
change CT_Sql class method, ac_store() namely, to make it store
username into the field specified.
Look at queries there and add appropriate code to the sql statements.
E.g.:
function ac_store($id, $name, $str) {
global $auth; // you'll need this string to access $auth->auth['username']
....
$uquery = sprintf("update %s set val='%s', ".
                  "changed='%s', ". // added a comma
                  "username = '%s' ". // added a place for username
                  "where sid='%s' and name='%s'",
      $this->database_table,
      $str,
      $now,
      $auth->auth['username'], // the value of username
      $id,
      $name);
..............
Do the similar thing in insert query ($iquery).

-- 
Best regards,
Max A. Derkachev mailto:kot <email protected>
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
http://www.Books.Ru -- All Books of Russia
 

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>