Open bohnelang opened 7 years ago
In this function, you can either get the connected user's max size or another user's max size in the DB. That's why, if there's no user specified, it returns the current session user's data and if there's a $user, it tries to return his value.
ok - I did download Version BoZoN 2.4 (build 17), Install it, add a superuser and add an user. After user login, I got this error "The file doesn't fit". I found out that the function user_folder_max_size returns 0 as max size. Thus - bug or feature? :-)
I encounter the problem, too. However, I suspect the reason to originate in the user management. My main user is "admin". I created a subordinate user "user1". It is not listed in the array in the session variable "users_rights":
["login"] => string(6) "user1"
["users_rights"] => array(1) {
["admin"] => int(50)
}
I suppose, the mapping for "user1" is never created. You can create it manually as shown in #170.
The mapping is stored in private/users_rights_file.php and obfuscated by base64 encoded gzipped data. Makes it cumbersome to debug. I cannot even tell if "users_rights" stores more information than just a maximum upload size value.
There is a bug in user_folder_max_size in the 2nd line should be if (!empty($user)){return $_SESSION['profile_folder_max_size'];}
original line: function user_folder_max_size($user=''){ if (empty($user)&&empty($_SESSION['profile_folder_max_size'])){return false;} if (empty($user)){return $_SESSION['profile_folder_max_size'];} if (!empty($_SESSION['users_rights'][$user])){return $_SESSION['users_rights'][$user];} return false; }