Skip to:
Content

bbPress.org

Changeset 25


Ignore:
Timestamp:
12/29/2004 01:22:27 AM (17 years ago)
Author:
matt
Message:

Um just kidding the last time. NOW registration works.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-config-sample.php

    r20 r25  
    1313$bb->name   = 'New bbPress Site';
    1414
     15$bb->admin_email = 'you@example.com';
    1516$bb->mod_rewrite = false;
    1617$bb->page_topics = 30;
  • trunk/bb-includes/functions.php

    r24 r25  
    186186        return $bb->domain;
    187187        break;
     188    case 'admin_email' :
     189        return $bb->admin_email;
     190        break;
    188191    endswitch;
    189192}
  • trunk/bb-includes/registration-functions.php

    r24 r25  
    1919function bb_new_user( $username, $email, $website, $location, $interests ) {
    2020    global $bbdb;
    21     $now      = current_time('mysql');
    22     $password = bb_random_pass();
     21    $now       = bb_current_time('mysql');
     22    $password  = bb_random_pass();
     23    $passcrypt = md5( $password );
    2324
    2425    $bbdb->query("INSERT INTO $bbdb->users
    2526    (username,    user_regdate, user_password, user_email, user_website, user_from,  user_interest)
    2627    VALUES
    27     ('$username', '$now',       '$password',   '$email',   '$website',  '$location', '$interests')");
     28    ('$username', '$now',       '$passcrypt',  '$email',   '$website',  '$location', '$interests')");
    2829   
    2930    $user_id = $bbdb->insert_id;
     31    bb_send_pass( $user_id, $password );
    3032    bb_do_action('bb_new_user', $user_id);
    3133    return $user_id;
     
    3941    return $password;
    4042}
     43
     44function bb_send_pass( $user, $pass ) {
     45    global $bbdb;
     46    $user = (int) $user;
     47    $user = $bbdb->get_row("SELECT * FROM $bbdb->users WHERE user_id = $user");
     48
     49    if ( $user ) :
     50        mail( $user->user_email, bb_get_option('name') . ': Password', "Your password is: $pass
     51You can now login: " . bb_get_option('uri') . "
     52
     53Enjoy!", 'From: ' . bb_get_option('admin_email') );
     54
     55    endif;
     56}
    4157?>
Note: See TracChangeset for help on using the changeset viewer.