Changeset 4314
- Timestamp:
- 01/04/11 23:46:52 (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-http.c
r4312 r4314 2105 2105 tpl_printf(vars, 0, "CLIENTCNR", "%d", get_threadnum(cl)); 2106 2106 tpl_addVar(vars, 0, "CLIENTUSER", xml_encode(vars, usr)); 2107 if (cl->typ == 'c') tpl_addVar(vars, 0, "CLIENTDESCRIPTION", xml_encode(vars, cl->account ->description));2107 if (cl->typ == 'c') tpl_addVar(vars, 0, "CLIENTDESCRIPTION", xml_encode(vars, cl->account?cl->account->description:"")); 2108 2108 tpl_printf(vars, 0, "CLIENTCAU", "%d", cau); 2109 2109 tpl_printf(vars, 0, "CLIENTCRYPTED", "%d", cl->crypted); -
trunk/oscam.c
r4306 r4314 345 345 char *username(struct s_client * client) 346 346 { 347 if (!client) 348 return "NULL"; 349 350 if (client->typ == 's' || client->typ == 'h') 351 { 352 // get username master running under 353 struct passwd *pwd; 354 if ((pwd = getpwuid(getuid())) != NULL) 355 return pwd->pw_name; 356 else 357 return "root"; 358 } 359 360 if (client->account->usr[0]) 361 return(client->account->usr); 362 else 363 return("anonymous"); 347 if (!client) 348 return "NULL"; 349 350 if (client->typ == 's' || client->typ == 'h') 351 { 352 // get username master running under 353 struct passwd *pwd; 354 if ((pwd = getpwuid(getuid())) != NULL) 355 return pwd->pw_name; 356 else 357 return "root"; 358 } 359 360 if(client->account) 361 { 362 if (client->account->usr[0]) 363 return(client->account->usr); 364 else 365 return("anonymous"); 366 } 367 else 368 { 369 return("NULL"); 370 } 364 371 } 365 372
Note:
See TracChangeset
for help on using the changeset viewer.