function save_userinfo($reg_username, $reg_email, $reg_uid = null, $user_type, $reg_user_type_xf)
 {
     global $_K;
     $reg_username = kekezu::escape($reg_username);
     $slt = kekezu::randomkeys(6);
     $pwd = keke_user_class::get_password($this->_reg_pwd, $slt);
     $this->_member_obj->setUid($reg_uid);
     $this->_member_obj->setEmail($reg_email);
     $this->_member_obj->setUsername($reg_username);
     $this->_member_obj->setPassword($this->_reg_pwd);
     $this->_member_obj->setRand_code($slt);
     $this->_member_obj->setUser_type($user_type);
     //增加user_type
     $reg_member_uid = $this->_member_obj->create_keke_witkey_member();
     $this->_oltime_obj->setUid($reg_member_uid);
     $this->_oltime_obj->setUsername($reg_username);
     $this->_oltime_obj->setLast_op_time(time());
     $this->_oltime_obj->setOnline_total_time(0);
     $this->_oltime_obj->create_keke_witkey_member_oltime();
     if ($reg_member_uid) {
         $buyer_level = keke_user_mark_class::get_mark_level(0, '2');
         $seller_level = keke_user_mark_class::get_mark_level('0', '1');
         $this->_shop_obj->setShop_type(1);
         $this->_shop_obj->setUid($reg_member_uid);
         $this->_shop_obj->setUsername($reg_username);
         $this->_shop_obj->setShop_name($reg_username);
         $this->_shop_obj->setShop_status($_K['autoshop'] == '1' ? '1' : '3');
         $res_shop_id = $this->_shop_obj->create_keke_witkey_shop();
         $this->_space_obj->setUid($reg_member_uid);
         $this->_space_obj->setUsername($reg_username);
         $this->_space_obj->setPassword($this->_reg_pwd);
         $this->_space_obj->setSec_code($pwd);
         $this->_space_obj->setEmail($reg_email);
         $this->_space_obj->setReg_time(time());
         $this->_space_obj->setReg_ip(keke_glob_class::checkipaddres($this->_reg_ip) ? $this->_reg_ip : '0.0.0.0');
         $this->_space_obj->setBuyer_level(serialize($buyer_level));
         $this->_space_obj->setSeller_level(serialize($seller_level));
         $this->_space_obj->setAutoshop($_K['autoshop']);
         $this->_space_obj->setUser_type($reg_user_type_xf);
         //修改用户实名认证类型
         $space_id = $this->_space_obj->create_keke_witkey_space();
     }
     $info = array('uid' => $reg_member_uid, 'username' => $reg_username, 'email' => $reg_email);
     $this->_sys_config['allow_reg_action'] == 1 and keke_user_class::send_email_action_user($info);
     return $reg_member_uid;
 }
Beispiel #2
0
    intval($hdn_mark_rule_id) and $mark_rule_obj->setWhere(" mark_rule_id = " . intval($hdn_mark_rule_id) . "");
    $mark_rule_obj->setM_value(intval($txt_m_value));
    $mark_rule_obj->setG_value(intval($txt_g_value));
    $mark_rule_obj->setG_title($txt_g_title);
    $mark_rule_obj->setM_title($txt_m_title);
    $mark_rule_obj->setG_ico($hdn_g_ico);
    $mark_rule_obj->setM_ico($hdn_m_ico);
    if (intval($hdn_mark_rule_id)) {
        kekezu::admin_system_log($_lang['edit_mark_rule']);
        $res = $mark_rule_obj->edit_keke_witkey_mark_rule();
    } else {
        kekezu::admin_system_log($_lang['create_mark_rule']);
        $res = $mark_rule_obj->create_keke_witkey_mark_rule();
    }
    if ($res) {
        $u_list = db_factory::query(sprintf(" select buyer_credit,seller_credit,uid from %switkey_space", TABLEPRE));
        if ($u_list) {
            $s = sizeof($u_list);
            for ($i = 0; $i < $s; $i++) {
                $b_level = keke_user_mark_class::get_mark_level($u_list[$i]['buyer_credit'], 2);
                $s_level = keke_user_mark_class::get_mark_level($u_list[$i]['seller_credit'], 1);
                $sql = " UPDATE " . TABLEPRE . "witkey_space set buyer_level='" . serialize($b_level) . "',seller_level='" . serialize($s_level) . "' where uid='{$u_list[$i]['uid']}'";
                $sql != '' && db_factory::execute($sql);
            }
        }
    }
    kekezu::admin_show_msg($_lang['operate_notice'], $url, 2, $_lang['submit_success'], 'success');
} else {
    $mark_rule = $mark_rule_obj->query_keke_witkey_mark_rule();
    require $kekezu->_tpl_obj->template(ADMIN_DIRECTORY . "/tpl/admin_{$do}_{$view}");
}
 function less_credit($value, $type)
 {
     $user_info = $this->_to_user_info;
     $uid = $user_info['uid'];
     if ($type == 1) {
         $sql = sprintf("update %switkey_space set buyer_credit = buyer_credit-%d where uid=%d", TABLEPRE, $value, $uid);
         $b_level = keke_user_mark_class::get_mark_level($user_info['buyer_credit'], 2);
         $up_sql = " UPDATE " . TABLEPRE . "witkey_space set buyer_level='" . serialize($b_level) . "' where uid=" . $uid;
     } elseif ($type == 2) {
         $sql = sprintf("update %switkey_space set seller_credit = seller_credit-%d where uid=%d", TABLEPRE, $value, $uid);
         $s_level = keke_user_mark_class::get_mark_level($user_info['seller_credit'], 1);
         $up_sql = " UPDATE " . TABLEPRE . "witkey_space set seller_level='" . serialize($s_level) . "' where uid=" . $uid;
     }
     db_factory::execute($up_sql);
     return db_factory::execute($sql);
 }
 function save_userinfo($reg_username, $reg_email, $reg_uid = null)
 {
     global $_K;
     $reg_username = kekezu::escape($reg_username);
     $slt = kekezu::randomkeys(6);
     $pwd = keke_user_class::get_password($this->_reg_pwd, $slt);
     $this->_member_obj->setUid($reg_uid);
     $this->_member_obj->setEmail($reg_email);
     $this->_member_obj->setUsername($reg_username);
     $this->_member_obj->setPassword($this->_reg_pwd);
     $this->_member_obj->setRand_code($slt);
     $reg_member_uid = $this->_member_obj->create_keke_witkey_member();
     $this->_oltime_obj->setUid($reg_member_uid);
     $this->_oltime_obj->setUsername($reg_username);
     $this->_oltime_obj->setLast_op_time(time());
     $this->_oltime_obj->setOnline_total_time(0);
     $this->_oltime_obj->create_keke_witkey_member_oltime();
     if ($reg_member_uid) {
         $buyer_level = keke_user_mark_class::get_mark_level(0, '2');
         $seller_level = keke_user_mark_class::get_mark_level('0', '1');
         $this->_shop_obj->setShop_type(1);
         $this->_shop_obj->setUid($reg_member_uid);
         $this->_shop_obj->setUsername($reg_username);
         $this->_shop_obj->setShop_name($reg_username);
         $this->_shop_obj->setShop_status($_K['autoshop'] == '1' ? '1' : '3');
         $res_shop_id = $this->_shop_obj->create_keke_witkey_shop();
         $this->_space_obj->setUid($reg_member_uid);
         $this->_space_obj->setUsername($reg_username);
         $this->_space_obj->setPassword($this->_reg_pwd);
         $this->_space_obj->setSec_code($pwd);
         $this->_space_obj->setEmail($reg_email);
         $this->_space_obj->setReg_time(time());
         $this->_space_obj->setReg_ip(keke_glob_class::checkipaddres($this->_reg_ip) ? $this->_reg_ip : '0.0.0.0');
         $this->_space_obj->setBuyer_level(serialize($buyer_level));
         $this->_space_obj->setSeller_level(serialize($seller_level));
         $this->_space_obj->setAutoshop($_K['autoshop']);
         $space_id = $this->_space_obj->create_keke_witkey_space();
     }
     $info = array('uid' => $reg_member_uid, 'username' => $reg_username, 'email' => $reg_email);
     if ($this->_sys_config['allow_reg_action'] != '1') {
         if ($reg_member_uid) {
             $arr = array();
             $arr['用户名'] = $reg_username;
             $arr['网站名称'] = $kekezu->_sys_config['website_name'];
             keke_msg_class::notify_user($reg_member_uid, $reg_username, 'reg', '注册成功', $arr, '2');
         }
     } else {
         keke_user_class::send_email_action_user($info);
     }
     return $reg_member_uid;
 }