コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
	{
        try
        {
            userInfo = Master.userInfo;
            hidEditorId.Value = Master.userInfo.AccountId.ToString();
            Session["accountauthoritylogin"] = Master.userInfo.Login;
            Session["accountauthorityid"] = Master.userInfo.AccountId;
            if (!Page.IsPostBack)
            {

                log.Debug("webroot_aspx_authorities_accountauthority");
                AjaxPro.Utility.RegisterTypeForAjax(typeof(webroot_aspx_authorities_accountauthority));
                bindGroupsTable();
                bindUsersInGroupTable();
            }

            TreeView1.Attributes.Add("onclick", "OnCheckBoxCheckChanged(event)");

            if (TreeView1.Nodes.Count == 0)
            {
                treeVC = new TreeViewControlEx(userInfo);
                TreeView1.Nodes.Clear();
                treeVC.TreeNodePopulate(TreeView1.Nodes);
                TreeView1.PathSeparator = ("|").ToCharArray()[0];
            }
            TreeView1.ExpandAll();
        }
        catch (Exception ex)
        {
            //show error
            showErrorMessage(ex.Message);
            return;
        }
    }
コード例 #2
0
ファイル: AuthorityManager.cs プロジェクト: wra222/testgit
        public AuthorityManager(UserInfo ui)
            : this()
        {
            userInfo = ui;

            if (userInfo.Login.Contains("\\"))
            {
                isDomainUser = true;
            }
        }
コード例 #3
0
ファイル: AuthorityManager.cs プロジェクト: wra222/testgit
        public AuthorityManager(UserInfo ui)
            : this()
        {
            string strRBPCServiceURL = ConfigurationManager.AppSettings["RBPCServiceAddress"].ToString();
            string strRBPCServicePort = ConfigurationManager.AppSettings["RBPCServicePort"].ToString();


            string strAccountMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IAccountManager";
            string strPermissionMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IPermissionManager";
            string strRoleMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IRoleManager";
            string strSecurityMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/ISecurityManager";


            accountMgr = (IAccountManager)Activator.GetObject(typeof(IAccountManager), strAccountMgrURL);
            permissionMgr = (IPermissionManager)Activator.GetObject(typeof(IPermissionManager), strPermissionMgrURL);
            roleMgr = (IRoleManager)Activator.GetObject(typeof(IRoleManager), strRoleMgrURL);
            securityMgr = (ISecurityManager)Activator.GetObject(typeof(ISecurityManager), strSecurityMgrURL);
            application = System.Configuration.ConfigurationManager.AppSettings.Get("RBPCApplication").ToString();
            editorID = ui.AccountId;//31989
        }
コード例 #4
0
ファイル: AccountUser.cs プロジェクト: wra222/testgit
        public static UserAcountInfoDef GetLogonUser(String tokenString)
        {
            UserAcountInfoDef result = new UserAcountInfoDef();

            ISecurityManager securityManager = null;
            securityManager = RBPCAgent.getRBPCManager<ISecurityManager>();

            Token tokenObject = new Token();
            tokenObject = (Token)WebCommonMethod.deserialize(tokenString);
            AccountInfo accountInfo = securityManager.getAccountByToken(tokenObject);

            result.LogonUser = Null2String(accountInfo.Login); //itc\itcxxxxxx

            //string application = System.Configuration.ConfigurationManager.AppSettings.Get("RBPCApplication").ToString();
            //根据登入人取得权限列表
            //PermissionInfo[] accountInfoList = securityManager.getAuthorities(tokenObject,application);

            UserInfo userInfo = new UserInfo();
            userInfo.Login = accountInfo.Login;

            if (accountInfo.Login.Contains("\\"))
                userInfo.UserId = (String)accountInfo.Login.Split(new Char[] { '\\' })[1]; //itcxxxxxx
            else
                userInfo.UserId = (String)accountInfo.Login;

            userInfo.UserName = (String)accountInfo.Name;
            userInfo.Department = (String)accountInfo.Department;
            userInfo.Domain = (String)accountInfo.Domain;
            userInfo.Company = (String)accountInfo.Company;
            userInfo.AccountId = (long)accountInfo.Id;
            userInfo.Login = (String)accountInfo.Login; //itc\itcxxxxxx
            ///////////////////////

            AuthorityManager manager = new AuthorityManager(userInfo);
            List<string> accountInfoList = manager.getPrimaryPermissionsByUserID(accountInfo.Login);

            for (int i = 0; i < accountInfoList.Count; i++)
            {
                if (accountInfoList[i] == "Authority Manager")
                {
                    result.IsAuthorityUsermanager = "True";
                }

                if (accountInfoList[i] == "Maintain")
                {
                    result.IsAuthorityDashboard = "True";
                }

            }

            //Session["UserId"] = userInfo.UserId;
            return result;
        }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
	{
        try
        {
            userInfo = new com.inventec.iMESWEB.UserInfo();
            userInfo.Login = StringUtil.decode_URL(Request.QueryString["logonUser"]);

            IAccountManager securityManager = null;
            securityManager = RBPCAgent.getRBPCManager<IAccountManager>();

            string application = "";

            if (userInfo.Login.Contains("\\"))
            {
                application = Constants.APPLICATION_ALL;
            }
            else
            {
                application = System.Configuration.ConfigurationManager.AppSettings.Get("RBPCApplication").ToString();
            }

            AccountInfo account = securityManager.findAccountByLogin(userInfo.Login, application);

            if (account.Login.Contains("\\"))
                userInfo.UserId = (String)account.Login.Split(new Char[] { '\\' })[1]; //itcxxxxxx
            else
                userInfo.UserId = (String)account.Login;

            userInfo.UserName = (String)account.Name;
            userInfo.Department = (String)account.Department;
            userInfo.Domain = (String)account.Domain;
            userInfo.Company = (String)account.Company;
            userInfo.AccountId = (long)account.Id;
            userInfo.Login = (String)account.Login; //itc\itcxxxxxx

            //userInfo = Master.userInfo;
            hidEditorId.Value = userInfo.AccountId.ToString();
                        
            if (!Page.IsPostBack)
            {

                log.Debug("webroot_aspx_authorities_accountauthority");
                AjaxPro.Utility.RegisterTypeForAjax(typeof(webroot_aspx_authorities_accountauthority));
                bindUsersInSubSystemTable();
                bindGroupsTable();
                bindUsersInGroupTable();
            }

            TreeView1.Attributes.Add("onclick", "OnCheckBoxCheckChanged(event)");

            if (TreeView1.Nodes.Count == 0)
            {
                treeVC = new TreeViewControl();
                TreeView1.Nodes.Clear();
                treeVC.TreeNodePopulate(TreeView1.Nodes);
                TreeView1.PathSeparator = ("|").ToCharArray()[0];
            }
            TreeView1.ExpandAll();
        }
            /*
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }*/
        catch (Exception ex)
        {
            //show error
            showErrorMessage(ex.Message);
            return;
        }

        this.Title = "Dashboard Authority";
    }
コード例 #6
0
ファイル: TreeViewControlEx.cs プロジェクト: wra222/testgit
 public TreeViewControlEx(UserInfo userInfo)
 {
     authMgr = new AuthorityManager(userInfo);
     treeNodes = new DataTable();
 }
コード例 #7
0
ファイル: TreeViewControl.cs プロジェクト: wra222/testgit
 public TreeViewControl(UserInfo ui)
 {
     authorManager = new AuthorityManager(ui);
     treeNodes = new DataTable();
     userInfo = ui;
 }