/*#if DEBUG * MessageBox.Show("debug version"); #else * String temp_s = es_lib.Publib.ConnConfigure.GetConnectionStringByName("MBC_TEMP_Name"); * string msg = es_lib.Publib.ConnConfigure.ToggleConfigEncryption("sal.exe"); * if (temp_s != null) * { * temp_s = temp_s.Split(':')[4]; * int tempaa = int.Parse(temp_s.Substring(0, 1)); * string tempbb = temp_s.Substring(tempaa, tempaa); * return (es_dblib.esdb.GetInstance(mysqlhost, "es_hrms", "hrms", tempbb + "bc")).GetConn(); * } * else * { * throw new Exception("Conn STR ERR"); * } #endif */ public override int login(string usr, string pwd, String domain) { //(usr.Equals("2002024") || usr.Equals("2006001")) && // if ( Pub.LDAPUserExists(usr, pwd)) if (true) { curr_userinfo = new userinfo(); curr_userinfo.userid = 1; curr_userinfo.username = usr; string tempFormPrivilege = "1=1111111;2=001"; string[] ls = tempFormPrivilege.Split(';'); curr_userinfo.FormPrivilegeSet = new Hashtable(); foreach (string s in ls) { string[] ts = s.Split('='); try { curr_userinfo.FormPrivilegeSet.Add(ts[0], ts[1]); } catch { // MessageBox.Show("From Privilege Error"); } } curr_userinfo.RoleID = 1; curr_userinfo.SysPrivilege = "11111111"; curr_userinfo.SubSysPrivilege = "11111;11111111111111111111;1111111111111"; listSubSys = new List <SystemPrivilegeMng>(); return((int)RoleDefs.SchoolAdmin); } else { return((int)RoleDefs.err_user); } }
public void logout() { if (curr_userinfo != null) { curr_userinfo.FormPrivilegeSet.Clear(); curr_userinfo.FormPrivilegeSet = null; curr_userinfo.Dict.Clear(); curr_userinfo.Dict = null; curr_userinfo = null; } listSubSys = null; }