Exemplo n.º 1
0
        }
        $id = $user->newUser($new);
        unset($user);
        $user = new nlb_user($db, $id);
        // add template into DB.
        $date = 1000000;
        // make the cache in the past so ETS will update it.
        $db->query('INSERT INTO ' . db_source . " ( \r\n\t\t`owner_id` , `blog` , `blog_updated` , `friends` , `friends_updated` , `profile` , `profile_updated` )\r\n\t\tVALUES (\r\n\t\t'{$id}', 'empty', '{$date}', 'empty', '{$date}', 'empty', '{$date}'\r\n\t\t);");
        $db->query('INSERT INTO ' . db_cache . " ( \r\n\t\t`owner_id` , `blog` , `blog_updated` , `friends` , `friends_updated` , `profile` , `profile_updated` )\r\n\t\tVALUES (\r\n\t\t'{$id}', 'empty', '{$date}', 'empty', '{$date}', 'empty', '{$date}'\r\n\t\t);");
        $user->setTemplateSource($clean['template'], $config->get('home_text'));
        // did the first user just register?
        if ($id == 1) {
            $user->grant('admin');
            $user->updateDB();
        }
        $sent = $user->validateEmail($config);
        $ets->page_body = $l['reg-done'];
        if ($sent) {
            $ets->page_body .= $l['reg-checkmail'];
        }
    }
}
if (empty($_POST) || $baddata) {
    if (!empty($_POST) && $text->is_missing_required) {
        foreach ($text->missing_fields as $miss) {
            $problems[] = $l['missing-field'] . $miss;
        }
        $baddata = true;
    }
    // build timezone options.
    $timezone = build_timezone_list($config->get('server_timezone'));