add a function to find the home of a user that doesn't hardcode /var/alternc

This commit is contained in:
Antoine Beaupré 2007-05-30 19:59:15 +00:00
parent 2085abb7e9
commit 8f7c385161
1 changed files with 16 additions and 0 deletions

View File

@ -209,6 +209,22 @@ function checkuserpath($path) {
return 0;
}
/**
* get the home of the user
*
* @args string $user the username, if null will use the global $mem. no
* security checks performed on path
* @returns string the actual absolute path
* @see $L_ALTERNC_LOC
*/
function getuserpath($user = null) {
global $L_ALTERNC_LOC;
if (is_null($user)) {
global $mem;
$user = $mem->user['login'];
}
return $L_ALTERNC_LOC . "/html/".substr($user,0,1)."/".$user;
}
function cbox($test) {
if ($test) echo (" checked=\"checked\"");