/// <summary>
        /// Gets the device information.
        /// </summary>
        /// <returns></returns>
        /// <remarks>
        /// Sequence Diagram:<br/>
        ///     <img src="SequenceDiagrams/SD_PrintReleaseDevice.Browser.LogOn.GetDeviceInformation.jpg"/>
        /// </remarks>
        private DEVICE_INFO_TYPE GetDeviceInformation()
        {
            DEVICE_INFO_TYPE deviceInfo = null;

            try
            {
                CreateWS();
                string             generic           = "1.0.0.23";
                CONFIGURATION_TYPE configurationType = null;
                deviceSettingType = new DEVICE_SETTING_TYPE();
                SCREEN_INFO_TYPE[] screenInfoType = null;

                deviceInfo = _ws.GetDeviceSettings(ref generic, out deviceSettingType, out configurationType, out screenInfoType);

                string deviceAutoClear = System.Configuration.ConfigurationSettings.AppSettings["DeviceAutoClear"];
                if (deviceAutoClear.ToLower() == "off")
                {
                    PROPERTY_TYPE[] acSetting = new PROPERTY_TYPE[1];
                    acSetting[0]         = new PROPERTY_TYPE();
                    acSetting[0].sysname = "enableAutoClear";
                    acSetting[0].Value   = "false"; //or "false" // IF value is set to false, Device auto logout will be removed.
                    string OSASESSIONID = Request.Params["UISessionID"].ToString();
                    _ws.SetDeviceContext(OSASESSIONID, acSetting, ref OsaDirectManager.Core.g_WSDLGeneric);
                }
            }
            catch (Exception)
            {
            }
            return(deviceInfo);
        }
        /// <summary>
        /// Determines whether [is post script enabled] [the specified device ip].
        /// </summary>
        /// <param name="deviceIp">The device ip.</param>
        /// <returns>
        ///     <c>true</c> if [is post script enabled] [the specified device ip]; otherwise, <c>false</c>.
        /// </returns>
        public static bool IsPostScriptEnabled(string deviceIp)
        {
            bool      isPostScriptEnabled = false;
            string    generic             = "1.0.0.21";
            MFPCoreWS ws = new MFPCoreWS();

            ws.Url = OsaDirectManager.Core.GetMFPURL(deviceIp);
            SECURITY_SOAPHEADER_TYPE sec = new SECURITY_SOAPHEADER_TYPE();

            sec.licensekey = OsaDirectManager.Core.OSA_LICENSE_KEY;
            ws.Security    = sec;
            DEVICE_INFO_TYPE    devinfo = new DEVICE_INFO_TYPE();
            DEVICE_SETTING_TYPE devset  = new DEVICE_SETTING_TYPE();
            CONFIGURATION_TYPE  config  = new CONFIGURATION_TYPE();

            SCREEN_INFO_TYPE[] screeninfo;
            devinfo = ws.GetDeviceSettings(ref generic, out devset, out config, out screeninfo);

            if (devset != null)
            {
                foreach (PROPERTY_TYPE prop in devset.osainfo)
                {
                    if (prop.sysname.IndexOf("print-postscript", StringComparison.OrdinalIgnoreCase) >= 0)
                    {
                        if (prop.Value == "enabled")
                        {
                            isPostScriptEnabled = true;
                        }
                    }
                }
            }
            return(isPostScriptEnabled);
        }
Пример #3
0
        /// <summary>
        /// Gets the device information.
        /// </summary>
        /// <returns></returns>
        /// <remarks>
        /// Sequence Diagram:<br/>
        ///     <img src="SequenceDiagrams/SD_PrintReleaseDevice.Browser.LogOn.GetDeviceInformation.jpg"/>
        /// </remarks>
        private DEVICE_INFO_TYPE GetDeviceInformation()
        {
            DEVICE_INFO_TYPE deviceInfo = null;

            try
            {
                CreateWS();
                string             generic           = "1.0.0.23";
                CONFIGURATION_TYPE configurationType = null;
                deviceSettingType = new DEVICE_SETTING_TYPE();
                SCREEN_INFO_TYPE[] screenInfoType = null;

                deviceInfo = _ws.GetDeviceSettings(ref generic, out deviceSettingType, out configurationType, out screenInfoType);

                //PROPERTY_TYPE[] acSetting = new PROPERTY_TYPE[1];

                //acSetting[0] = new PROPERTY_TYPE();
                //acSetting[0].sysname = "enableAutoClear";
                //acSetting[0].Value = "true"; //or "false"

                //string OSASESSIONID = Request.Params["UISessionID"].ToString();

                //_ws.SetDeviceContext(OSASESSIONID, acSetting, ref OsaDirectManager.Core.g_WSDLGeneric);
            }
            catch (Exception ex)
            {
                isValidLicenceFile = true;
                LogManager.RecordMessage(deviceIpAddress, "deviceInfo", LogManager.MessageType.Exception, "Message From MFP Login", "Event Exception", ex.Message, ex.StackTrace);
            }
            return(deviceInfo);
        }
Пример #4
0
        /// <summary>
        /// Gets the device information.
        /// </summary>
        /// <returns></returns>
        /// <remarks>
        /// Sequence Diagram:<br/>
        ///     <img src="SequenceDiagrams/SD_PrintReleaseDevice.Browser.LogOn.GetDeviceInformation.jpg"/>
        /// </remarks>
        private DEVICE_INFO_TYPE GetDeviceInformation()
        {
            DEVICE_INFO_TYPE deviceInfo = null;

            try
            {
                CreateWS();
                string             generic           = "1.0.0.23";
                CONFIGURATION_TYPE configurationType = null;
                SCREEN_INFO_TYPE[] screenInfoType    = null;
                deviceInfo = _ws.GetDeviceSettings(ref generic, out deviceSettingType, out configurationType, out screenInfoType);

                PROPERTY_TYPE[] acSetting = new PROPERTY_TYPE[1];
                acSetting[0]         = new PROPERTY_TYPE();
                acSetting[0].sysname = "enableAutoClear";
                acSetting[0].Value   = "false"; //or "false"
                string OSASESSIONID = Request.Params["UISessionId"] as string;

                _ws.SetDeviceContext(OSASESSIONID, acSetting, ref OsaDirectManager.Core.g_WSDLGeneric);
            }
            catch (Exception)
            {
                isValidLicenceFile = true;
            }
            return(deviceInfo);
        }
        /// <summary>
        /// Determines whether [is setting exist] [the specified device ip].
        /// </summary>
        /// <param name="deviceIp">The device ip.</param>
        /// <param name="isStapleEnabled">if set to <c>true</c> [is staple enabled].</param>
        /// <param name="isPunchEnabled">if set to <c>true</c> [is punch enabled].</param>
        internal static void IsSettingExist(string deviceIp, out bool isStapleEnabled, out bool isPunchEnabled, out bool isdocumentFilingSettings)
        {
            isStapleEnabled          = false;
            isPunchEnabled           = false;
            isdocumentFilingSettings = false;
            string    generic = "1.0.0.21";
            MFPCoreWS ws      = new MFPCoreWS();

            ws.Url = OsaDirectManager.Core.GetMFPURL(deviceIp);
            SECURITY_SOAPHEADER_TYPE sec = new SECURITY_SOAPHEADER_TYPE();

            sec.licensekey = OsaDirectManager.Core.OSA_LICENSE_KEY;
            ws.Security    = sec;
            DEVICE_INFO_TYPE    devinfo = new DEVICE_INFO_TYPE();
            DEVICE_SETTING_TYPE devset  = new DEVICE_SETTING_TYPE();
            CONFIGURATION_TYPE  config  = new CONFIGURATION_TYPE();

            SCREEN_INFO_TYPE[] screeninfo;
            devinfo = ws.GetDeviceSettings(ref generic, out devset, out config, out screeninfo);

            if (devset != null)
            {
                foreach (PROPERTY_TYPE prop in config.hardware)
                {
                    if (prop.sysname == "staple")
                    {
                        if (prop.Value == "true")
                        {
                            isStapleEnabled = true;
                        }
                    }
                    if (prop.sysname == "punch")
                    {
                        if (prop.Value == "true")
                        {
                            isPunchEnabled = true;
                        }
                    }
                }
            }
            if (devinfo != null)
            {
                if (devinfo.modelname == "SHARP MX-C310")
                {
                    isdocumentFilingSettings = false;
                }
                else
                {
                    isdocumentFilingSettings = true;
                }
            }
        }
Пример #6
0
        private DEVICE_INFO_TYPE GetDeviceInformation()
        {
            DEVICE_INFO_TYPE deviceInfo = null;

            try
            {
                CreateWS();
                PROPERTY_TYPE[] acSetting = new PROPERTY_TYPE[1];
                acSetting[0]         = new PROPERTY_TYPE();
                acSetting[0].sysname = "enableAutoClear";
                acSetting[0].Value   = "false"; //or "false"
                string OSASESSIONID = Request.Params["UISessionID"].ToString();

                _ws.SetDeviceContext(OSASESSIONID, acSetting, ref OsaDirectManager.Core.g_WSDLGeneric);
            }
            catch (Exception)
            {
            }
            return(deviceInfo);
        }
Пример #7
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;
            }
Пример #8
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">Source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/>Instance containing the event data.</param>
        /// <remarks>
        /// Sequence Diagram:<br/>
        ///     <img src="SequenceDiagrams/SD_PrintReleaseDevice.Browser.LogOn.Page_Load.jpg"/>
        /// </remarks>
        protected void Page_Load(object sender, EventArgs e)
        {
            AppCode.ApplicationHelper.ClearSqlPools();
            Session["PrintAllJobsOnLogin"] = "";
            Session["BackgroundGenerated"] = false;
            pageWidth     = Session["Width"] as string;
            pageHeight    = Session["Height"] as string;
            deviceCulture = HttpContext.Current.Request.UserLanguages[0];
            bool isSupportedlangauge = DataManagerDevice.ProviderDevice.ApplicationSettings.IsSupportedLanguage(deviceCulture);

            if (!isSupportedlangauge)
            {
                deviceCulture = "en-US";
            }
            deviceModel = Session["OSAModel"] as string;
            if (deviceModel == "FormBrowser")
            {
                Response.AppendHeader("Content-type", "text/xml");
            }

            if (!IsPostBack)
            {
                string isValidLicence = Session["IsValidLicence"] as string;
                if (string.IsNullOrEmpty(isValidLicence))
                {
                    isValidLicence = "NO";
                }
                // Validate licence only once per session or everytime on page load if it is expired
                if (isValidLicence == "NO")
                {
                    try
                    {
                        ValidateApplicationLicence();
                    }
                    catch (Exception ex)
                    {
                        string redirectPath = string.Format("../Mfp/LicenseErrorpage.aspx?ErrorCode={0}", "500");
                        Response.Redirect(redirectPath, true);
                    }
                    string applicationTimeOut = DataManagerDevice.ProviderDevice.ApplicationSettings.ProvideSetting("Time out");
                    Session["ApplicationTimeOut"] = applicationTimeOut;
                    if (!string.IsNullOrEmpty(redirectPage))
                    {
                        Response.Redirect(redirectPage, true);
                    }
                }

                deviceInfo = GetDeviceInformation();
                CheckPrinterMode();
                string domainName = DataManagerDevice.ProviderDevice.ApplicationSettings.ProvideDomainName();
                Session["DomainName"] = domainName;
                deviceIpAddress       = Request.Params["REMOTE_ADDR"].ToString();
                Session["DeviceID"]   = Request.Params["DeviceId"] as string;
                GetLoggedOnUserDetails();
                AuthenticateDevice();

                #region ::Dead Code::

                /*
                 * try
                 * {
                 *  ValidateLicence();
                 *  string solutionRegistred = "False";
                 *
                 *  if (Application["SolutionRegistered"] != null)
                 *  {
                 *      if (!string.IsNullOrEmpty(Application["SolutionRegistered"].ToString()))
                 *      {
                 *          solutionRegistred = Application["SolutionRegistered"].ToString();
                 *      }
                 *      if (bool.Parse(solutionRegistred))
                 *      {
                 *          ValidateDevice();
                 *      }
                 *  }
                 * }
                 * catch (Exception ex)
                 * {
                 *  redirectPage = string.Format("../Mfp/LicenseErrorpage.aspx?ErrorCode={0}", "500");
                 *  Response.Redirect(redirectPage, true);
                 *  if (deviceModel == "FormBrowser")
                 *  {
                 *      Response.Redirect("../SKY/MessageForm.aspx?FROM=../Mfp/DeviceScreen.aspx&MESS=invalidLicense");
                 *  }
                 * }
                 *
                 * if (!string.IsNullOrEmpty(redirectPage))
                 * {
                 *  Response.Redirect(redirectPage, true);
                 * }
                 * else
                 * {
                 *  isValidLicenceFile = true;
                 *  if (!isValidLicenceFile)
                 *  {
                 *      TableDisplayRegisterDevice.Visible = true;
                 *      string localizedText = Localization.GetLabelText("", deviceCulture, "INVALID_LICENCE");
                 *      LabelDisplayRegisterMessage.Text = localizedText;
                 *      LabelLogOnOK.Text = Localization.GetLabelText("", deviceCulture, "OK");
                 *      if (deviceModel == "FormBrowser")
                 *      {
                 *          Response.Redirect("../SKY/MessageForm.aspx?FROM=../Mfp/DeviceScreen.aspx&MESS=invalidLicense");
                 *      }
                 *      return;
                 *  }
                 *
                 *  deviceInfo = GetDeviceInformation();
                 *  CheckPrinterMode();
                 *  string domainName = DataManagerDevice.ProviderDevice.ApplicationSettings.ProvideDomainName();
                 *  Session["DomainName"] = domainName;
                 *  deviceIpAddress = Request.Params["REMOTE_ADDR"].ToString();
                 *  Session["DeviceID"] = Request.Params["DeviceId"] as string;
                 *  GetLoggedOnUserDetails();
                 *  AuthenticateDevice();
                 * }
                 */
                #endregion
            }
        }