Example #1
0
        public static UserInfo To_UserInfo(Request_Head head, User_Register u)
        {
            var user = new UserInfo();

            user.u_id   = 0;
            user.u_uid  = 0;
            user.u_type = (byte)Login_Type.Local;

            user.u_mobile = u.u_tel;

            user.u_status        = (int)Users_State.Register;
            user.u_status_email  = 0; // 表示未验证
            user.u_status_mobile = 1;
            user.u_status_verify = 0;

            user.u_face           = string.Empty;
            user.u_face2          = string.Empty;
            user.u_face3          = head.Platform == Platform.Android ? "android" : "ios"; // 存放标记
            user.u_signature      = string.Empty;
            user.u_signatureImg   = string.Empty;
            user.u_regTime        = DateTime.Now;
            user.u_prevLoginTime  = string.Empty;
            user.u_curLoginTime   = string.Empty;
            user.u_login_num      = 0;
            user.u_login_duration = 0;
            user.u_total_money    = 0;
            user.u_total_exp      = 0;
            user.u_grade          = (int)User_Level.normal;
            user.u_birthday       = string.Empty;
            user.u_astro          = string.Empty;
            user.u_profession     = string.Empty;
            user.u_height         = 0;
            user.u_weight         = 0;
            user.u_live_country   = string.Empty;
            user.u_live_city      = string.Empty;
            user.u_home_country   = string.Empty;
            user.u_home_city      = string.Empty;
            user.u_interest       = string.Empty;
            user.u_weibo          = string.Empty;
            user.u_total_tiezi    = 0;
            user.u_total_huifu    = 0;
            user.u_total_shang    = 0;
            user.u_total_shangQZ  = 0;
            user.u_total_shangQF  = 0;
            user.u_total_shangJY  = 0;
            user.u_total_pinglun  = 0;
            user.u_tableId        = 0;
            user.u_today_shangF   = 0;
            user.u_today_shangJY  = 0;

            user.u_email  = string.Empty;
            user.u_name   = u.u_name;
            user.u_pwd    = Cipher_Md5.Md5_16_1(u.u_pwd);
            user.u_regsex = 2;//默认性别保密
            return(user);
        }
Example #2
0
        public static int User_PwdReset_Log_Insert(string u_tel)
        {
            Users_PwdFoundLogInfo logInfo = new Users_PwdFoundLogInfo
            {
                pl_createTime = DateTime.Now,
                pl_expireTime =

                    DateTime.Now.AddHours(24),
                pl_remark = string.Format("用户修改密码成功!(IP:{0},时间:{1})", Util.Get_RemoteIp(), DateTime.Now),
                pl_status = 0
            };

            logInfo.pl_uid = Cipher_Md5.Md5_16_1(u_tel + logInfo.pl_expireTime.ToString() + logInfo.pl_status.ToString());
            logInfo.pl_url = "http://user.qianzhan.com/account/resetpwd?email=" + u_tel + "&gid=" + logInfo.pl_uid;
            logInfo.pl_to  = u_tel;

            logInfo.pl_execTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            return(DataAccess.User_PwdReset_Log_Insert(logInfo));
        }
Example #3
0
        /// <summary>
        /// 将评论“顶”日志插入数据库
        /// </summary>
        /// <param name="cmtId"></param>
        /// <returns></returns>
        public static int FavorLog_Insert(string cmtId)
        {
            string objType = "CMTAgree";
            string objId   = cmtId + "," + DateTime.Now.ToString("yyMMddHH");

            OperationContext              context           = OperationContext.Current;
            MessageProperties             messageProperties = context.IncomingMessageProperties;
            RemoteEndpointMessageProperty endpointProperty  =
                messageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
            string ip       = endpointProperty.Address;
            string clientId = string.Empty;
            string uid      = Cipher_Md5.Md5_16_1(string.Join(",", new string[] { DateTime.Today.ToString("yyyy-MM-dd"), objType, objId, clientId }));
            int    week     = Util.GetWeekOfYear(DateTime.Today);
            string tblName  = string.Format("FavorLog_{0}{1}{2}", DateTime.Today.Year, week < 10 ? "0" : "", week);

            using (var access = new DataAccess_QzNews(Constants.SysLog_Db_Key))
            {
                // 将日志插入到数据库
                return(access.FavorLog_Insert(uid, objType, objId, string.Empty, string.Empty, clientId, ip, string.Empty, tblName));
            }
        }
Example #4
0
 /// <summary>
 /// 邮件超链接验证
 /// </summary>
 /// <param name="mailgid">邮件GID</param>
 /// <param name="mail">邮箱地址</param>
 /// <param name="type">连接类型</param>
 /// <param name="targetUrl">目标连接地址</param>
 /// <returns>加密后的验证对象</returns>
 public static string AnchorLinkValidationMD516(string mailgid, string mail, string type, string targetUrl)
 {
     return(Cipher_Md5.Md5_16_1(string.Format("FORWARD ORGMAIL VALIDATION {0},{1},{2},{3}", mailgid, mail, type, targetUrl)));
 }