coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: wkpoon on June 08, 2007, 07:08:41 AM

Title: No allow user to modify profile1
Post by: wkpoon on June 08, 2007, 07:08:41 AM
I use the profile1 as user full name and enter by administrator, is there a way to prevent  user to modify their profile1 (user full name).
Title: Re: No allow user to modify profile1
Post by: Sami on June 08, 2007, 10:17:18 AM
Edit profile.php

- around line #36
find this:


        array('input', 'user_profile1', $CONFIG['user_profile1_name'], 255),


change it to this


        array('text', 'user_profile1', $CONFIG['user_profile1_name']),


- Comment out line #189


//$profile1 = addslashes($_POST['user_profile1']);


- go to line #216 and change this


    $sql = "UPDATE {$CONFIG['TABLE_USERS']} SET " . "user_profile1 = '$profile1', " . "user_profile2 = '$profile2', " . "user_profile3 = '$profile3', " . "user_profile4 = '$profile4', " . "user_profile5 = '$profile5', " . "user_profile6 = '$profile6'" . ($CONFIG['allow_email_change'] && !$error ? ", user_email = '$email'" : "") . " WHERE user_id = '" . USER_ID . "'";


to this


    $sql = "UPDATE {$CONFIG['TABLE_USERS']} SET " . "user_profile2 = '$profile2', " . "user_profile3 = '$profile3', " . "user_profile4 = '$profile4', " . "user_profile5 = '$profile5', " . "user_profile6 = '$profile6'" . ($CONFIG['allow_email_change'] && !$error ? ", user_email = '$email'" : "") . " WHERE user_id = '" . USER_ID . "'";


I don't test it my self , report back if you got any issue
Title: Re: No allow user to modify profile1
Post by: wkpoon on June 08, 2007, 12:01:26 PM
Thank you very much, it work any so far so good !!!!!