public virtual ACL_DOC_TYPE BuildXmlDocAcl(string accid, ACL_DOC_TYPE xmlacl)
        {
            if (xmlacl.mfpfeature == null)             // AR-Series hasn't ACL
            {
                return(xmlacl);
            }

            xmlacl.userinfo.accountid = accid;             // don't forget

            foreach (ACL_MAIN_FEATURE_TYPE mf in xmlacl.mfpfeature)
            {
                string name = mf.sysname;

                // set ACL to this feature.
                mf.allow = ObtainAcl(accid, name, "", "", "", "");

                if (mf.settingconstraints != null)
                {
                    foreach (ACL_PROPERTY_TYPE prop in mf.settingconstraints)
                    {
                        if (prop.setting != null)
                        {
                            ACL_SETTING_TYPE[] settings = prop.setting;
                            foreach (ACL_SETTING_TYPE setting in settings)
                            {
                                // Set ACL to this feature property.
                                setting.Value = ObtainAcl(accid, name, prop.sysname, setting.sysname, "", "");
                            }
                        }
                    }
                }

                if (mf.subfeature != null)
                {
                    foreach (ACL_SUB_FEATURE_TYPE sf in mf.subfeature)
                    {
                        // Set ACL to this sub-feature.
                        sf.allow = ObtainAcl(accid, name, "", "", sf.sysname, "");

                        if (sf.details != null)
                        {
                            foreach (ACL_DETAIL_TYPE d in sf.details)
                            {
                                // Set ACL to this feature detail.
                                d.Value = ObtainAcl(accid, name, "", "", sf.sysname, d.sysname);
                            }
                        }
                    }
                }
            }

            return(xmlacl);
        }
Esempio n. 2
0
            public void LogUserIn(string accid, AccountantBase auth)
            {
                ACL_DOC_TYPE acl = auth.BuildXmlDocAcl(accid, xmldocacl);

                LIMITS_TYPE[] limits = auth.BuildXmlDocLimit(accid, xmldoclimits);

                MFPCoreWSEx mfpWS = GetConfiguredMfpCoreWS();

                mfpWS.EnableDevice(acl, limits);

                mfpWS.ShowScreen(E_MFP_SHOWSCREEN_TYPE.TOP_LEVEL_SCREEN);
            }
        private void CallEnableDevice(string jobType, int numPages, string jobMainType, string jobSubType)
        {
            string userSysID = Session["UserSystemID"] as string;
            string device    = Session["DeviceID"] as string;

            if (string.IsNullOrEmpty(device))
            {
                device = Request.Params["DeviceId"] as string;
                string[] deviceids = device.Split(',');
                device = deviceids[0].ToString();
            }

            Helper.DeviceSession.Get(device).LogUserInDeviceModeforCampus(userSysID, jobType, numPages, new Helper.MyAccountant(), true, false, jobMainType, jobSubType);
            return;

            #region trial
            ACL_DOC_TYPE  xmldocacl;
            LIMITS_TYPE[] xmldoclimits;

            string accid = Session["UserSystemID"] as string;
            if (!Helper.UserAccount.Has(accid))
            {
                Helper.UserAccount.Create(accid, "", "", "Cost Center", "MFP");
            }
            AccountantBase auth = new Helper.MyAccountant();

            string uuid = Session["DeviceID"] as string;
            xmldocacl = Helper.DeviceSession.Get(uuid).xmldocacl;
            ACL_DOC_TYPE acl = auth.BuildXmlDocAclCampus(accid, jobType, xmldocacl);

            xmldoclimits = Helper.DeviceSession.Get(uuid).xmldoclimits;
            LIMITS_DOC_TYPE limitDocType = new LIMITS_DOC_TYPE();
            limitDocType.limits = auth.BuildXmlDocLimit(accid, xmldoclimits);

            MFPCoreWSEx mfpWS = Helper.DeviceSession.Get(uuid).GetConfiguredMfpCoreWS();
            try
            {
                mfpWS.EnableDevice(acl, limitDocType);
                mfpWS.ShowScreen(E_MFP_SHOWSCREEN_TYPE.TOP_LEVEL_SCREEN);
            }
            catch (Exception ex)
            {
                string exception = ex.Message;
            }
            #endregion
        }
Esempio n. 4
0
            public static void Create(DEVICE_INFO_TYPE deviceinfo, MFP_WEBSERVICE_TYPE[] mfpwebservices,
                                      ACL_DOC_TYPE xmldocacl, CREDENTIALS_TYPE Credentials,
                                      LIMITS_TYPE[] xmldoclimits)
            {
                DeviceSession s = new DeviceSession();

                s.deviceinfo     = deviceinfo;
                s.mfpwebservices = mfpwebservices;
                s.xmldocacl      = xmldocacl;
                s.Credentials    = Credentials;
                s.xmldoclimits   = xmldoclimits;
                location         = deviceinfo.location;
                serialNumber     = deviceinfo.serialnumber;;
                modelName        = deviceinfo.modelname;
                ipAddress        = deviceinfo.network_address;
                deviceId         = deviceinfo.uuid;
                localIP          = Gethostip();
                url = "http://" + localIP + "/PrintReleaseMfp/Default.aspx";

                sessionData[deviceinfo.uuid] = s;
            }
Esempio n. 5
0
        //public void EnableDevice(ACL_DOC_TYPE acl, LIMITS_TYPE[] limits)
        //{
        //    base.EnableDevice(acl, limits, ref wsdlGeneric);
        //}

        public void EnableDevice(ACL_DOC_TYPE acl, LIMITS_DOC_TYPE limits)
        {
            base.EnableDevice(acl, limits, ref wsdlGeneric);
        }