Changeset 1068

Show
Ignore:
Timestamp:
10/21/07 17:01:05 (10 months ago)
Author:
Neal
Message:

Changed an incorrectly used unbuffered query to a regular query.
Modified validate_username so that profile.php can exclude a user from the duplicate username check.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/punbb-1.3-dev/upload/include/functions.php

    r1063 r1068  
    768768// Verifies that the provided username is OK for insertion into the database 
    769769// 
    770 function validate_username($username
     770function validate_username($username, $exclude_id = null
    771771{ 
    772772        global $lang_common, $lang_register, $lang_prof_reg, $pun_config; 
     
    798798 
    799799        // Check for username dupe 
    800         $dupe = check_username_dupe($username); 
     800        $dupe = check_username_dupe($username, $exclude_id); 
    801801        if ($dupe !== false) 
    802802                $errors[] = sprintf($lang_prof_reg['Username dupe'], htmlspecialchars($dupe)); 
     
    16151615 
    16161616        ($hook = get_hook('fn_qr_check_username_dupe')) ? eval($hook) : null; 
    1617         $result = $db->query_build($query, true) or error(__FILE__, __LINE__); 
     1617        $result = $db->query_build($query) or error(__FILE__, __LINE__); 
    16181618 
    16191619        return $db->num_rows($result) ? $db->result($result) : false; 
  • branches/punbb-1.3-dev/upload/profile.php

    r1062 r1068  
    513513 
    514514                                        // Validate the new username 
    515                                         $errors = validate_username($form['username']); 
     515                                        $errors = validate_username($form['username'], $id); 
    516516                                        if (!empty($errors)) 
    517517                                                message(current($errors));