2 /* Copyright (C) 2009 Winch Gate Property Limited
4 * This file is part of ryzom_api.
5 * ryzom_api is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * ryzom_api is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with ryzom_api. If not, see <http://www.gnu.org/licenses/>.
20 function ryzom_name_to_file($name)
23 for ($i=0; $i<strlen($name); ++
$i)
27 else if ($name[$i] == '%' ||
$name[$i] <= chr(32) ||
$name[$i] >= chr(127))
28 $r .= sprintf("%%%02x", ord($name[$i]));
35 // -------------------------------------
36 // get user home directory
37 // -------------------------------------
38 function ryzom_get_user_dir($user)
40 global $_RYZOM_API_CONFIG;
43 die("INTERNAL ERROR CODE 1");
45 $user = ryzom_name_to_file($user);
46 return $_RYZOM_API_CONFIG['cookie_path'].'/'.$_RYZOM_API_CONFIG['shardid'].'/'.substr(strtolower($user), 0, 2).'/'.strtolower($user).'/';