This topic is locked

Assign users to group

2/1/2008 10:08:35 AM
PHPRunner General questions
A
amplus author

I want to display the first- and lastname of the user and not the loginname
Who can tell me where I must made the change for it

J
Jane 2/4/2008

Hi,
you can do the following:

  1. save first and last name is the $_SESSION variables in the AfterSuccessfulLogin event.

    Here is a sample:
    global $conn;

    $str = "select FirstName, LastName from TableName where UserName='".$_SESSION["UserID"]."'";

    $rs = db_query($str,$conn);

    if ($data = db_fetch_array($rs))

    $_SESSION["fullname"] = $data["FirstName"]." ".$data["LastName"];



where FirstName, LastName and UserName are your actual field names, TableName is your actual table name.
2. then add following code to the List page: Before Display event:

$smarty->assign("userid",$_SESSION["fullname"]);