예제 #1
0
            public override CREDENTIALS_BASE_TYPE ValidateCredential(CREDENTIALS_TYPE userinfo, string password)
            {
                string accid = userinfo.accountid;

                string userAccountIdInDb = "0";
                //DataManager.DataManager.Controller.Users.IsValidUser(accid, password, out userAccountIdInDb);
                DataSet dsUserDetails = OSADataProvider.Device.IsValidUser(accid, password);

                if (dsUserDetails.Tables[0].Rows.Count > 0)
                {
                    userAccountIdInDb = Convert.ToString(dsUserDetails.Tables[0].Rows[0]["USR_ACCOUNT_ID"], CultureInfo.CurrentCulture);
                }
                else
                {
                    userAccountIdInDb = string.Empty;
                }

                if (string.IsNullOrEmpty(userAccountIdInDb))
                {
                    UserAccount.Create(userAccountIdInDb);
                    CREDENTIALS_BASE_TYPE ret = new CREDENTIALS_BASE_TYPE();
                    //ret.accountid = accid;
                    ret.accountid = userAccountIdInDb;

                    return(ret);
                }
                else
                {
                    return(null);
                }
            }
예제 #2
0
            public override CREDENTIALS_BASE_TYPE ValidateCredential(CREDENTIALS_TYPE userinfo, string userID, string userGroup)
            {
                string accid = userinfo.accountid;
                CREDENTIALS_BASE_TYPE ret = new CREDENTIALS_BASE_TYPE();

                //ret.accountid = accid;
                ret.accountid = userID;
                return(ret);
            }
예제 #3
0
        //-------------------------------------------------------------
        // constructors

        public MFPCoreWSEx(string mfpUrl, string vkey, CREDENTIALS_TYPE cred, string uisid)
        {
            base.Url                  = mfpUrl + MFP_CORE_WS_URL;
            base.Security             = new SECURITY_SOAPHEADER_TYPE();
            base.Security.licensekey  = vkey;
            base.Security.Credentials = cred;

            wsdlGeneric = WSDL_BUILD_NUMBER;
            uiSessionId = (uisid == null) ? string.Empty : uisid;
        }
예제 #4
0
            // this is called from Authenticate()
            public override CREDENTIALS_BASE_TYPE ValidateCredential(CREDENTIALS_TYPE userinfo)
            {
                DbDataReader drUser = OSADataProvider.Device.ProvideUserDetails(OSADataProvider.Device.AuthenticationType.AnyOfThem, userinfo.accountid);

                CREDENTIALS_BASE_TYPE ret = new CREDENTIALS_BASE_TYPE();

                if (drUser.HasRows)
                {
                    drUser.Read();

                    if (Helper.UserAccount.Has(drUser["USR_ACCOUNT_ID"].ToString()))
                    {
                        string             printUserGroup = "0";
                        Helper.UserAccount userAccount    = Helper.UserAccount.Get(drUser["USR_ACCOUNT_ID"].ToString()); //(drUser["USR_ACCOUNT_ID"].ToString(), drUser["USR_ID"].ToString(), printUserGroup);
                        userAccount.userGroup    = "0";                                                                  //drUser["USR_DEFAULT_PRINT_PROFILE"].ToString();
                        userAccount.userSystemId = drUser["USR_ACCOUNT_ID"].ToString();
                        userAccount.cardId       = drUser["USR_CARD_ID"].ToString();

                        ret.accountid = drUser["USR_ACCOUNT_ID"].ToString();
                        //Helper.UserAccount.Create(drUser["USR_ACCOUNT_ID"].ToString(), drUser["USR_ID"].ToString());
                    }
                    else
                    {
                        string printUserGroup = "0"; //drUser["USR_DEFAULT_PRINT_PROFILE"].ToString();
                        Helper.UserAccount.Create(drUser["USR_ACCOUNT_ID"].ToString(), drUser["USR_CARD_ID"].ToString(), printUserGroup);
                        ret.accountid = drUser["USR_ACCOUNT_ID"].ToString();
                    }
                    return(ret);
                }
                else
                {
                    if (userinfo != null && userinfo.accountid != null)
                    {
                        Helper.UserAccount.Create("1156", "", "");


                        ret.accountid = "1156";
                    }
                    return(ret);
                }
                if (drUser != null && drUser.IsClosed == false)
                {
                    drUser.Close();
                }
            }
예제 #5
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;
            }
예제 #6
0
 public abstract CREDENTIALS_BASE_TYPE ValidateCredential(CREDENTIALS_TYPE userinfo, string cardID, string userGroup);
예제 #7
0
 public abstract CREDENTIALS_BASE_TYPE ValidateCredential(CREDENTIALS_TYPE userinfo);
예제 #8
0
        //-------------------------------------------------------------
        // framework methods

        public abstract CREDENTIALS_BASE_TYPE ValidateCredential(CREDENTIALS_TYPE userinfo, string password);