PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
kevinkap
Involved
Involved


Joined: Apr 22, 2006
Posts: 350

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

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?
View user's profile Send private message
montego
Site Admin


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

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

<bump> anyone?
View user's profile Send private message Visit poster's website
evaders99
Moderator


Joined: Apr 30, 2004
Posts: 2852

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

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.
View user's profile Send private message Visit poster's website
kevinkap
Involved
Involved


Joined: Apr 22, 2006
Posts: 350

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

oooh, can you tell me how to do that, to techie for me?
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum