Commit 037e15be authored by kiz_0987's avatar kiz_0987

#98286 Fixing module_exist instead of module_exists errors. Thanks archetwist.

parent 45b1c10c
......@@ -61,7 +61,7 @@ function gallery_update_user(&$edit, $user) {
$user->roles = ($edit['roles']) ? $edit['roles'] : $user->roles;
// Use full name from profile if it exists
$fullnamefield = variable_get('gallery_profile_full_name_field', 'profile_full_name');
$usefullname = variable_get('gallery_use_full_name', 0) && module_exist('profile');
$usefullname = variable_get('gallery_use_full_name', 0) && module_exists('profile');
if (($edit[$fullnamefield] || $user->$fullnamefield) && $usefullname) {
$user->$fullnamefield = ($edit[$fullnamefield]) ? $edit[$fullnamefield] : $user->$fullnamefield;
} else {
......@@ -102,7 +102,7 @@ function gallery_delete_user($user) {
*/
function gallery_modify_user($user, $action = 'create') {
$fullnamefield = variable_get('gallery_profile_full_name_field', 'profile_full_name');
$usefullname = variable_get('gallery_use_full_name', 0) && module_exist('profile');
$usefullname = variable_get('gallery_use_full_name', 0) && module_exists('profile');
$fullname = ($user->$fullnamefield && $usefullname) ? $user->$fullnamefield : $user->name;
// Generate random password for gallery2 if user is blocked, to avoid them being able to login
// to gallery2 if not-embedded operation is allowed.
......@@ -382,7 +382,7 @@ function gallery_user_info($user, $full = false) {
if ($g2_user->getuserName() != $user->name ){
$g2_userinfo['error_msg'][] = t('Different Usernames');
}
$usefullname = variable_get('gallery_use_full_name', 0) && module_exist('profile');
$usefullname = variable_get('gallery_use_full_name', 0) && module_exists('profile');
if ($usefullname) {
$fullnamefield = variable_get('gallery_profile_full_name_field', 'profile_full_name');
$fullnameresult = db_query("SELECT v.value FROM {profile_values} v INNER JOIN {profile_fields} f ON v.fid = f.fid AND v.uid=%d WHERE f.name = '%s'", $user->uid, $fullnamefield);
......@@ -430,4 +430,4 @@ function gallery_user_info($user, $full = false) {
}
return $g2_userinfo;
}
?>
\ No newline at end of file
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment