Esempio n. 1
0
/**
 * Get formatted user name from SUMO_TABLE_USERS by user 
 */
function sumo_get_username($username = '', $cache = TRUE)
{
    global $SUMO;
    $query = "SELECT firstname,lastname FROM " . SUMO_TABLE_USERS . " \r\n\t\t\t  WHERE username='******'";
    if ($cache) {
        $rs = $SUMO['DB']->CacheExecute(60, $query);
    } else {
        $rs = $SUMO['DB']->Execute($query);
    }
    $tab = $rs->FetchRow();
    $username = sumo_get_formatted_username($tab['firstname'], $tab['lastname']);
    return $username;
}
Esempio n. 2
0
 if ($_SESSION['users']['list']['col'][10]) {
     $excel->WriteText($row, $col, $language['LastLogin']);
     $col++;
 }
 if ($_SESSION['users']['list']['col'][15]) {
     $excel->WriteText($row, $col, $language['Created']);
     $col++;
 }
 if ($_SESSION['users']['list']['col'][11]) {
     $excel->WriteText($row, $col, $language['Expire']);
 }
 while ($tab = $rs->FetchRow()) {
     $last_login = $tab['last_login'] ? sumo_get_human_date($tab['last_login']) : '';
     $created = $tab['created'] ? sumo_get_human_date($tab['created']) : '';
     $expire = $tab['day_limit'] != NULL ? sumo_get_human_date($tab['day_limit'] * 86400 + $SUMO['server']['time'], FALSE) : '';
     $username = sumo_get_formatted_username($tab['firstname'], $tab['lastname']);
     $col = 0;
     $row++;
     if ($username == ' ') {
         $username = '';
     }
     if ($_SESSION['users']['list']['col'][6]) {
         $excel->WriteNumber($row, $col, $tab['id']);
         $col++;
     }
     if ($_SESSION['users']['list']['col'][2]) {
         $excel->WriteText($row, $col, $tab['username']);
         $col++;
     }
     if ($_SESSION['users']['list']['col'][4]) {
         $excel->WriteText($row, $col, $username);