Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> RN Bug Reports - Other Issues
Author Message
kevinkap
Involved
Involved



Joined: Apr 22, 2006
Posts: 356

PostPosted: Thu Aug 02, 2007 2:45 pm Reply with quote

Ok, this could fit in a couple places so if a mod thinks it needs to be moved, please do so. I have a version of coppermine that was made as an integration into nuke. It was working very good. Now when I try to edit a user within the gallery, such as to make them a gallery admin or ban them or anything I get this error " The username you have entered already exist, please choose a different one".

The only thing I know of that changed since the last time I used this function was the addition of the cnbya package modified by fade2gray to use captcha.

With debug turned on in the gallery it points to a section of code"


Code:


function update_user($user_id)
{
    global $CONFIG;
    global $lang_usermgr_php, $lang_register_php;
    global $field_user_id, $field_user_name, $field_user_email, $field_user_pass;

    $user_active_cp = $_POST['user_active_cp'];
    $user_group_cp = $_POST['user_group_cp'];
    $group_list = isset($_POST['group_list']) ? $_POST['group_list'] : '';

    $sql = "SELECT $field_user_id " .
     "FROM {$CONFIG['TABLE_USERS']} " .
     "WHERE $field_user_name = '" . addslashes($username) . "' AND $field_user_id != $user_id";
    $result = db_query($sql);

    if (mysql_num_rows($result)){
        cpg_die(ERROR, $lang_register_php['err_user_exists'], __FILE__, __LINE__);
        return false;
    }
    mysql_free_result($result);
   
    $user_group_list = '';
    if (is_array($group_list)) {
        foreach($group_list as $group) $user_group_list .= ($group != $user_group) ? $group . ',' : '';
        $user_group_list = substr($user_group_list, 0, -1);
    }

    $sql_update = "UPDATE {$CONFIG['TABLE_USERS']} " .
     "SET " .
     "user_active_cp    = '$user_active_cp', " .
     "user_group_cp     = '$user_group_cp', " .
     "user_group_list_cp     = '$user_group_list' " .
     "WHERE $field_user_id = '$user_id'";
    db_query($sql_update);
}


The section I think that is triggering this error is
Code:
if (mysql_num_rows($result)){

        cpg_die(ERROR, $lang_register_php['err_user_exists'], __FILE__, __LINE__);


I am just not sure what would cause this to trigger this now. It looks like it has something to do with the registration process within the gallery. I do not allow seperate signups so can that be modified or even removed to not trigger this error?

_________________
Kevin Kappes 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Mon Aug 06, 2007 10:28 pm Reply with quote

<bump> anyone?

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Tue Aug 07, 2007 7:29 am Reply with quote

Well its saying if the query above it returns no results, then there must be an error.

What I would do is try to echo the query out and run it in phpMyAdmin to see what its doing.

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
kevinkap







PostPosted: Thu Aug 16, 2007 8:58 pm Reply with quote

oooh, can you tell me how to do that, to techie for me?
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> RN Bug Reports - Other Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©