亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dbuser.java

?? Jvie論壇的程序
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/**
 * Copyright (C) 2001 Yasna.com. All rights reserved.
 *
 * ===================================================================
 * The Apache Software License, Version 1.1
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by
 *        Yasna.com (http://www.yasna.com)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Yazd" and "Yasna.com" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please
 *    contact yazd@yasna.com.
 *
 * 5. Products derived from this software may not be called "Yazd",
 *    nor may "Yazd" appear in their name, without prior written
 *    permission of Yasna.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL YASNA.COM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of Yasna.com. For more information
 * on Yasna.com, please see <http://www.yasna.com>.
 */

/**
 * Copyright (C) 2000 CoolServlets.com. All rights reserved.
 *
 * ===================================================================
 * The Apache Software License, Version 1.1
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by
 *        CoolServlets.com (http://www.coolservlets.com)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Jive" and "CoolServlets.com" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please
 *    contact webmaster@coolservlets.com.
 *
 * 5. Products derived from this software may not be called "Jive",
 *    nor may "Jive" appear in their name, without prior written
 *    permission of CoolServlets.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL COOLSERVLETS.COM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CoolServlets.com. For more information
 * on CoolServlets.com, please see <http://www.coolservlets.com>.
 */

package com.Yasna.forum.database;

import com.Yasna.forum.*;
import com.Yasna.util.*;

import java.util.*;
import java.text.*;
import java.sql.*;
import java.security.*;

/**
 * Database implementation of the User interface. Additionally, it filters all
 * HTML tags from fields before returning them for security purposes.<p>
 *
 * Use of the Jive user system is optional. There a number of different ways
 * to create your own user system or to integrate into an existing user
 * system:<ul>
 *   <li> Edit the source of this class and modify the database queries to match
 *     your user system.
 *   <li> Implement a set of custom classes and tell the ForumFactory to load
 *     them. In this case, it is still recommended to use the Jive user API
 *     since that will mean much less reimplementation work in the other
 *     classes.</ul>
 *
 * If you can follow the Jive API for your own user data, but need access
 * within Jive to extended user properties, such as addresses or other
 * personal data, and easy solution is to adapt the user properties facility
 * to load and access this data.
 */
public class DbUser implements User, Cacheable {

    /** DATABASE QUERIES **/
    private static final String LOAD_PROPERTIES =
        "SELECT name, propValue FROM yazdUserProp WHERE userID=?";
    private static final String DELETE_PROPERTIES =
        "DELETE FROM yazdUserProp WHERE userID=?";
    private static final String INSERT_PROPERTY =
        "INSERT INTO yazdUserProp(userID,name,propValue) VALUES(?,?,?)";
    private static final String LOAD_USER_BY_USERNAME =
        "SELECT * FROM yazdUser WHERE username=?";
    private static final String LOAD_USER_BY_ID =
        "SELECT * FROM yazdUser WHERE userID=?";
    private static final String INSERT_USER =
        "INSERT INTO yazdUser(userID,username,passwordHash,email,emailVisible," +
        "nameVisible) VALUES(?,?,?,?,?,?)";
    private static final String SAVE_USER =
        "UPDATE yazdUser SET passwordHash=?,email=?,emailVisible=?,name=?," +
        "nameVisible=? WHERE userID=?";
    private static final String DELETE_PERMISSIONS =
        "DELETE FROM yazdUserPerm WHERE userID=?";
    private static final String INSERT_PERMISSION =
        "INSERT INTO yazdUserPerm(userID,forumID,permission) VALUES(?,?,?)";

    /**
     * user id of -2 means no user id has been set yet. -1 is reserved for
     * "anonymous user" and 0 is reserved for "all users".
     */
    private int id = -2;
    private String username;
    private String passwordHash;
    private String name = "";
    private boolean nameVisible = true;
    private String email;
    private boolean emailVisible = true;
    private Properties properties;
    private Object propertyLock = new Object();

    /**
     * Create a new DbUser with all required fields.
     *
     * @param username the username for the user.
     * @param password a password for the user.
     * @param email the email address for the user.
     */
    protected DbUser(String username, String password, String email) {
        this.id = DbSequenceManager.nextID("User");
        this.username = username;
        //Compute hash of password.
        this.passwordHash = StringUtils.hash(password);
        this.email = email;
        properties = new Properties();
        insertIntoDb();
    }

    /**
     * Load a DbUser object specified by userID.
     *
     * @param userID the userID of the user to load.
     */
    protected DbUser(int userID) throws UserNotFoundException {
        this.id = userID;
        loadFromDb();
        loadProperties();
    }

    /**
     * Load a DbUser object specified by username.
     *
     * @param username the username of the user to load.
     */
    protected DbUser(String username) throws UserNotFoundException {
        this.username = username;
        loadFromDb();
        loadProperties();
    }

    //FROM THE USER INTERFACE//

    public int getID() {
        return id;
    }

    public boolean isAnonymous() {
        return (id==-1);
    }

    public String getUsername() {
        return StringUtils.escapeHTMLTags(username);
    }

    public String getName() {
        return StringUtils.escapeHTMLTags(name);
    }

    public void setName(String name) throws UnauthorizedException {
        this.name = name;
        saveToDb();
    }

    public boolean isNameVisible() {
        return nameVisible;
    }

    public void setNameVisible(boolean visible) throws UnauthorizedException {
        this.nameVisible = visible;
        saveToDb();
    }

    public void setPassword(String password) throws UnauthorizedException {
        //Compute hash of password.
        this.passwordHash = StringUtils.hash(password);
        saveToDb();
    }

    public String getPasswordHash() throws UnauthorizedException {
        return passwordHash;
    }

    public void setPasswordHash(String passwordHash) {
        this.passwordHash = passwordHash;
        saveToDb();
    }

    public String getEmail() {
        return StringUtils.escapeHTMLTags(email);
    }

    public void setEmail(String email) throws UnauthorizedException {
        this.email = email;
        saveToDb();
    }

    public boolean isEmailVisible() {
        return emailVisible;
    }

    public void setEmailVisible(boolean visible) throws UnauthorizedException {
        this.emailVisible = visible;
        saveToDb();
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美1区2区3区| 免费一级片91| 欧美久久久久久久久久| 日本色综合中文字幕| www国产精品av| 成人av电影在线| 亚洲一区二区三区四区五区中文| 欧美色大人视频| 极品少妇xxxx精品少妇| 国产欧美日韩精品一区| 日本福利一区二区| 日本午夜一本久久久综合| 久久久国产精品麻豆| 95精品视频在线| 天天亚洲美女在线视频| 久久蜜桃av一区二区天堂| 97久久超碰国产精品电影| 亚洲专区一二三| 日韩欧美的一区| 成人精品在线视频观看| 亚洲一区二区3| 精品免费视频.| av不卡免费在线观看| 视频一区欧美日韩| 国产日本欧洲亚洲| 欧美性猛交xxxxxx富婆| 久久99久久99| 伊人夜夜躁av伊人久久| 精品日韩一区二区三区免费视频| 99热这里都是精品| 青青草91视频| 亚洲色图欧洲色图婷婷| 日韩一区二区在线看| 99精品视频一区二区| 日本欧美一区二区三区乱码| 国产精品久久午夜夜伦鲁鲁| 欧美久久久一区| 不卡一区二区三区四区| 日韩av一区二区三区四区| 国产欧美日韩中文久久| 欧美日韩激情在线| 成人va在线观看| 日韩在线一区二区三区| **网站欧美大片在线观看| 日韩欧美国产一区在线观看| 色哟哟一区二区| 国产麻豆9l精品三级站| 亚洲国产成人精品视频| 久久久www成人免费无遮挡大片| 欧美性猛交一区二区三区精品| 国产福利一区在线观看| 偷偷要91色婷婷| 《视频一区视频二区| 26uuuu精品一区二区| 欧美老年两性高潮| 99久久99久久精品国产片果冻 | 成人动漫一区二区在线| 青青草原综合久久大伊人精品 | 国产美女av一区二区三区| 亚洲国产综合视频在线观看| 国产无人区一区二区三区| 欧美一区二区精品久久911| 在线免费观看一区| 99久久免费国产| 国产精品一二三| 久久国产精品区| 石原莉奈一区二区三区在线观看| 亚洲欧美另类小说视频| 国产亚洲欧美日韩在线一区| 欧美刺激午夜性久久久久久久 | 国产亚洲一本大道中文在线| 91 com成人网| 欧美中文字幕一二三区视频| 不卡免费追剧大全电视剧网站| 国产一区二区精品久久| 免费在线观看视频一区| 亚洲国产精品久久人人爱| 亚洲另类春色国产| 中文字幕一区三区| 国产欧美一区二区三区网站 | 日韩黄色免费网站| 亚洲一区二区在线视频| 亚洲三级在线看| 国产精品美女久久久久av爽李琼| ww亚洲ww在线观看国产| 91精品国模一区二区三区| 欧美视频在线观看一区| 色婷婷精品久久二区二区蜜臀av| 北条麻妃国产九九精品视频| 岛国一区二区在线观看| 国产精品一区二区三区乱码| 国产乱码精品一品二品| 精品一区二区精品| 国内精品伊人久久久久av影院 | 精品写真视频在线观看| 免费一区二区视频| 日韩电影免费一区| 日韩 欧美一区二区三区| 日韩国产在线观看| 蜜臀av一级做a爰片久久| 蜜臀av在线播放一区二区三区| 日韩电影免费一区| 麻豆国产精品官网| 狠狠狠色丁香婷婷综合激情| 韩国中文字幕2020精品| 国产精品夜夜嗨| 丁香激情综合国产| 99精品视频在线免费观看| 99精品视频在线播放观看| 一本久久a久久精品亚洲| 91激情五月电影| 欧美色综合久久| 4438成人网| 日韩欧美国产综合| 久久综合给合久久狠狠狠97色69| 国产亚洲欧美色| 中文字幕永久在线不卡| 亚洲精品视频在线看| 亚洲午夜电影在线观看| 日韩**一区毛片| 国产又粗又猛又爽又黄91精品| 国产在线视频一区二区三区| 国产精品小仙女| av网站免费线看精品| 在线视频亚洲一区| 欧美伦理电影网| 久久这里只有精品首页| 国产精品日产欧美久久久久| 亚洲欧美另类图片小说| 天使萌一区二区三区免费观看| 蜜桃91丨九色丨蝌蚪91桃色| 国产一区二区伦理| 91视频免费观看| 欧美日韩精品福利| xnxx国产精品| 1区2区3区精品视频| 丝袜美腿亚洲一区二区图片| 国内精品自线一区二区三区视频| 成人v精品蜜桃久久一区| 在线欧美小视频| 日韩欧美一级二级三级| 中文字幕免费不卡| 亚洲午夜久久久久久久久久久 | 久久婷婷国产综合国色天香| 中文字幕在线不卡一区| 水蜜桃久久夜色精品一区的特点| 国产一区二区在线影院| 91在线观看一区二区| 欧美精品在线一区二区| 国产日韩欧美高清在线| 一区二区三区久久久| 毛片av中文字幕一区二区| k8久久久一区二区三区 | 欧美精品粉嫩高潮一区二区| 久久久久国产成人精品亚洲午夜| 亚洲特黄一级片| 日本va欧美va瓶| av不卡免费电影| 日韩网站在线看片你懂的| 专区另类欧美日韩| 蜜臀精品久久久久久蜜臀| 99精品国产99久久久久久白柏| 欧美高清www午色夜在线视频| 国产日韩精品一区二区三区| 亚洲一区二区三区精品在线| 国产在线播放一区三区四| 欧美在线免费视屏| 久久精品视频免费| 亚洲一线二线三线视频| 国产一区二区三区高清播放| 欧美日韩在线播放三区| 国产欧美一区二区三区在线老狼| 午夜不卡av在线| thepron国产精品| 精品少妇一区二区三区视频免付费| 亚洲另类色综合网站| 国产精品456| 制服.丝袜.亚洲.中文.综合| 中文字幕在线观看不卡视频| 久久国产视频网| 欧美主播一区二区三区| 欧美国产综合一区二区| 另类综合日韩欧美亚洲| 欧美性videosxxxxx| 亚洲国产激情av| 麻豆91在线观看| 91成人网在线| 国产亚洲一区二区三区四区| 日韩国产精品久久久| 一本在线高清不卡dvd| 国产欧美日产一区| 久色婷婷小香蕉久久| 欧美午夜精品理论片a级按摩| 国产精品乱人伦| 国产精品一区二区在线播放| 日韩欧美国产三级| 亚洲第一激情av| 一本在线高清不卡dvd| 国产精品久久久久影院色老大| 精一区二区三区|