public static string[,] getCatDbAry(string argGenre, int argLng, int argFid) { int num = argLng; int num2 = argFid; string str = argGenre; db db = new db(); string[,] strArray = null; string str2 = cls.getString(jt.itake("global.config.sys->category-ndatabase", "cfg")); string argFpre = cls.getString(jt.itake("global.config.sys->category-nfpre", "cfg")); string argString = cls.cfnames(argFpre, "id"); string str5 = string.Concat(new object[] { "select * from ", str2, " where ", cls.cfnames(argFpre, "hidden"), "=0 and ", cls.cfnames(argFpre, "lng"), "=", num, " and ", cls.cfnames(argFpre, "genre"), "='", str, "' and ", cls.cfnames(argFpre, "fid"), "=", num2, " order by ", cls.cfnames(argFpre, "order"), " asc" }); object[] objArray = db.getDataAry(str5); if (objArray != null) { for (int i = 0; i < objArray.Length; i++) { object[,] argAry = (object[,]) objArray[i]; int num4 = (int) db.getValue(argAry, argString); string[,] strArray2 = new string[,] { { cls.toString(db.getValue(argAry, argString)), cls.toString(db.getValue(argAry, cls.cfnames(argFpre, "topic"))), cls.toString(db.getValue(argAry, cls.cfnames(argFpre, "fid"))) } }; strArray = cls.mergeAry(cls.mergeAry(strArray, strArray2), getCatDbAry(str, num, num4)); } } return strArray; }
public bool checkUsername(string argUserid, string argUsername, string argPassword) { bool flag = false; int num = cls.getNum(argUserid, -1); string str = cls.getSafeString(argUsername); string str2 = cls.getSafeString(argPassword); if (num != -1) { db db = new db(); string str3 = cls.getString(jt.itake("global." + this.ngenre + ":config.ndatabase", "cfg")); string argFpre = cls.getString(jt.itake("global." + this.ngenre + ":config.nfpre", "cfg")); string str5 = cls.cfnames(argFpre, "id"); string argString = string.Concat(new object[] { "select * from ", str3, " where ", str5, "=", num, " and ", cls.cfnames(argFpre, "lock"), "=0" }); object[] objArray = db.getDataAry(argString); if (objArray == null) { return flag; } object[,] argAry = (object[,]) objArray[0]; string str7 = (string) db.getValue(argAry, cls.cfnames(argFpre, "username")); string str8 = (string) db.getValue(argAry, cls.cfnames(argFpre, "password")); if ((str7 == str) && (str8 == str2)) { flag = true; } } return flag; }
public bool ckLogin(string argUsername, string argPassword) { bool flag = true; if (cls.isEmpty(this.username) || cls.isEmpty(this.popedom)) { db db = new db(); string argObject = ""; string str2 = cls.getSafeString(argUsername); string str3 = cls.getSafeString(argPassword); string str4 = cls.getString(jt.itake("global.config.admin-ndatabase", "cfg")); string argFpre = cls.getString(jt.itake("global.config.admin-nfpre", "cfg")); string argString = "select * from " + str4 + " where " + cls.cfnames(argFpre, "username") + "='" + str2 + "' and " + cls.cfnames(argFpre, "password") + "='" + str3 + "' and " + cls.cfnames(argFpre, "lock") + "=0"; object[] objArray = db.getDataAry(argString); if (objArray != null) { object[,] argAry = (object[,]) objArray[0]; int argValue = (int) db.getValue(argAry, cls.cfnames(argFpre, "id")); string str7 = (string) db.getValue(argAry, cls.cfnames(argFpre, "username")); string str8 = (string) db.getValue(argAry, cls.cfnames(argFpre, "password")); string str9 = (string) db.getValue(argAry, cls.cfnames(argFpre, "popedom")); session.set("admin-id", argValue); session.set("admin-username", str7); session.set("admin-popedom", str9); cookies.set("admin-username", str7); cookies.set("admin-password", str8); this.id = argValue; this.username = str7; this.popedom = str9; argObject = "update " + str4 + " set " + cls.cfnames(argFpre, "lasttime") + "='" + cls.getDate() + "'," + cls.cfnames(argFpre, "lastip") + "='" + request.ClientIP() + "' where " + cls.cfnames(argFpre, "username") + "='" + str2 + "'"; } else { flag = false; } if (!cls.isEmpty(argObject)) { db.Execute(argObject); } } return flag; }
public static string itransferMultiGenre(string argStrings) { int num6; string argTemplate = ""; string argString = argStrings; string argXInfostr = cls.getParameter(argString, "tpl"); string argObject = cls.getParameter(argString, "tplid"); string str8 = cls.getParameter(argString, "tplstr"); string str9 = cls.getParameter(argString, "type"); string str10 = cls.getParameter(argString, "genre"); string str11 = cls.getParameter(argString, "field"); string str12 = cls.getParameter(argString, "osql"); string str13 = cls.getParameter(argString, "osqlorder"); string str14 = cls.getParameter(argString, "ocmode"); string str15 = cls.getParameter(argString, "rowfilter"); string str16 = cls.getParameter(argString, "baseurl"); string str17 = cls.getParameter(argString, "vars"); int num = cls.getNum(cls.getParameter(argString, "topx"), -1); int num2 = cls.getNum(cls.getParameter(argString, "lng"), -1); int num3 = cls.getNum(config.dbtype, 0); if (num2 == -1) { num2 = cls.getNum(config.nlng, -1); } if (num <= 0) { return argTemplate; } string ngenre = config.ngenre; if (cls.isEmpty(str10)) { return argTemplate; } string str19 = ""; string str20 = ""; str19 = str19 + "select * from ("; foreach (string str21 in str10.Split(new char[] { '&' })) { string str22 = cls.getString(jt.itake("global." + str21 + ":config.ndatabase", "cfg")); string argFpre = cls.getString(jt.itake("global." + str21 + ":config.nfpre", "cfg")); if (!cls.isEmpty(str22)) { string str29; str19 = str19 + "select " + cls.cfnames(argFpre, "id") + " as un_id,"; foreach (string str24 in str11.Split(new char[] { '&' })) { str29 = str19; str19 = str29 + cls.cfnames(argFpre, str24) + " as un_" + str24 + ","; } str29 = str19; str19 = str29 + cls.cfnames(argFpre, "time") + " as un_time, '" + str21 + "' as un_genre from " + str22; switch (str9) { case "new": str19 = str19 + " where " + cls.cfnames(argFpre, "hidden") + "=0"; str20 = " order by un_time desc"; break; case "-new": str19 = str19 + " where " + cls.cfnames(argFpre, "hidden") + "=0"; str20 = " order by un_time desc"; break; case "@new": str19 = str19 + " where 1=1"; str20 = " order by un_time desc"; break; case "commendatory": str29 = str19; str19 = str29 + " where " + cls.cfnames(argFpre, "hidden") + "=0 and " + cls.cfnames(argFpre, "commendatory") + "=1"; str20 = " order by un_time desc"; break; case "-commendatory": str29 = str19; str19 = str29 + " where " + cls.cfnames(argFpre, "hidden") + "=0 and " + cls.cfnames(argFpre, "commendatory") + "=1"; str20 = " order by un_time desc"; break; case "@commendatory": str19 = str19 + " where " + cls.cfnames(argFpre, "commendatory") + "=1"; str20 = " order by un_time desc"; break; default: str19 = str19 + " where " + cls.cfnames(argFpre, "hidden") + "=0"; str20 = " order by un_time desc"; break; } if ((num2 != -1) && (num2 != -100)) { object obj2 = str19; str19 = string.Concat(new object[] { obj2, " and ", cls.cfnames(argFpre, "lng"), "=", num2 }); } str19 = str19 + " union all "; } } if (str19.IndexOf(" union all ") != -1) { str19 = cls.getLRStr(str19, " union all ", "leftr"); } str19 = str19 + ") t1 where 1=1"; if (!cls.isEmpty(str12)) { str19 = str19 + str12; } if (!cls.isEmpty(str13)) { str20 = str13; } str19 = str19 + str20; if ((num3 >= 0) && (num3 < 10)) { str19 = string.Concat(new object[] { "select top ", num, " *", cls.getLRStr(str19, "select *", "rightr") }); } if ((num3 >= 10) && (num3 < 20)) { str19 = str19 + " limit 0," + num; } if (!cls.isEmpty(str8)) { argTemplate = str8; } else if (!cls.isEmpty(argObject)) { string[,] strArray3 = getJtbcElement(argObject); if ((strArray3 != null) && (strArray3.GetLength(1) == 2)) { argTemplate = strArray3[0, 1]; } } else if (argXInfostr.IndexOf(".") != -1) { argTemplate = jt.itake(argXInfostr, "tpl"); } else { argTemplate = jt.itake("global.tpl_transfer." + argXInfostr, "tpl"); } if (!cls.isEmpty(str17)) { string[] strArray4 = str17.Split(new char[] { '|' }); num6 = 0; while (num6 < strArray4.Length) { string str25 = strArray4[num6]; if (!cls.isEmpty(str25)) { string[] strArray5 = str25.Split(new char[] { '=' }); if (strArray5.Length == 2) { argTemplate = argTemplate.Replace("{$" + strArray5[0] + "}", strArray5[1]); } } num6++; } } db db = new db(); object[] objArray = db.getDataAry(str19); if (objArray != null) { string newValue = ""; int num7 = 0; string str2 = cls.ctemplate(ref argTemplate, "{@}"); for (int i = 0; i < objArray.Length; i++) { if (cls.isEmpty(str15) || !cls.cinstr(str15, cls.toString(i + 1), ",")) { num7++; string str4 = str2; object[,] argAry = (object[,]) objArray[i]; num6 = 0; while (num6 < argAry.GetLength(0)) { argAry[num6, 0] = cls.getLRStr((string) argAry[num6, 0], "un_", "rightr"); str4 = str4.Replace("{$" + cls.toString(argAry[num6, 0]) + "}", encode.htmlencode(cls.toString(argAry[num6, 1]), "1")); num6++; } config.rstAry = argAry; string argRoutestr = cls.toString(db.getValue(argAry, "genre")); string str27 = ""; if (!cls.isEmpty(str16)) { str27 = str16; } else if (argRoutestr != ngenre) { str27 = cls.getActualRoute(argRoutestr); if (cls.getRight(str27, 1) != "/") { str27 = str27 + "/"; } } str4 = str4.Replace("{$-genre}", encode.htmlencode(argRoutestr)).Replace("{$-baseurl}", str27).Replace("{$-i}", cls.toString(num7)); for (num6 = 2; num6 < 7; num6++) { int num9 = num7 % num6; str4 = str4.Replace("{$-!mod" + num6 + "}", cls.toString(num9)); if (num9 != 0) { str4 = str4.Replace("{$-!mod" + num6 + "-string}", ""); } else { str4 = str4.Replace("{$-!mod" + num6 + "-string}", cls.toString(str14)); } } str4 = jt.creplace(str4); newValue = newValue + str4; } } argTemplate = argTemplate.Replace(config.jtbccinfo, newValue); } else { argTemplate = ""; } return jt.creplace(argTemplate); }
public bool Login(string argUsername, string argPassword, string argRemember) { bool flag = false; this.Logout(); string argValue = cls.getSafeString(argUsername); string str2 = encode.md5(cls.getSafeString(argPassword)); int num = cls.getNum(argRemember, 0); db db = new db(); string str3 = cls.getString(jt.itake("global." + this.ngenre + ":config.ndatabase", "cfg")); string argFpre = cls.getString(jt.itake("global." + this.ngenre + ":config.nfpre", "cfg")); string argString = cls.cfnames(argFpre, "id"); string str6 = "select * from " + str3 + " where " + cls.cfnames(argFpre, "username") + "='" + argValue + "' and " + cls.cfnames(argFpre, "password") + "='" + str2 + "' and " + cls.cfnames(argFpre, "lock") + "=0"; object[] objArray = db.getDataAry(str6); if (objArray == null) { return flag; } object[,] argAry = (object[,]) objArray[0]; string str7 = cls.toString(db.getValue(argAry, argString)); if (num == 0) { cookies.set(this.ngenre + "-userid", str7); cookies.set(this.ngenre + "-username", argValue); cookies.set(this.ngenre + "-password", str2); } else { cookies.set(this.ngenre + "-userid", str7, 0x1e13380); cookies.set(this.ngenre + "-username", argValue, 0x1e13380); cookies.set(this.ngenre + "-password", str2, 0x1e13380); } session.set(this.ngenre + "-nuserid", str7); session.set(this.ngenre + "-nusername", argValue); db.Execute("update " + str3 + " set " + cls.cfnames(argFpre, "prelasttime") + "=" + cls.cfnames(argFpre, "lasttime") + " where " + argString + "=" + str7); db.Execute("update " + str3 + " set " + cls.cfnames(argFpre, "lasttime") + "='" + cls.getDate() + "' where " + argString + "=" + str7); return true; }
public int getUserID(string argUsername) { int num = 0; string str = cls.getSafeString(argUsername); db db = new db(); string str2 = cls.getString(jt.itake("global." + this.ngenre + ":config.ndatabase", "cfg")); string argFpre = cls.getString(jt.itake("global." + this.ngenre + ":config.nfpre", "cfg")); string argString = cls.cfnames(argFpre, "id"); string str5 = "select * from " + str2 + " where " + cls.cfnames(argFpre, "username") + "='" + str + "'"; object[] objArray = db.getDataAry(str5); if (objArray != null) { object[,] argAry = (object[,]) objArray[0]; num = cls.toInt32(db.getValue(argAry, argString)); } return num; }