Beispiel #1
0
        public virtual XVar getUserData(dynamic _param_username, dynamic _param_password, dynamic _param_skipPasswordCheck = null)
        {
            #region default values
            if (_param_skipPasswordCheck as Object == null)
            {
                _param_skipPasswordCheck = new XVar(false);
            }
            #endregion

            #region pass-by-value parameters
            dynamic username          = XVar.Clone(_param_username);
            dynamic password          = XVar.Clone(_param_password);
            dynamic skipPasswordCheck = XVar.Clone(_param_skipPasswordCheck);
            #endregion

            dynamic bcrypted = null, data = null, loginSet = null, originalPassword = null;
            if (GlobalVars.globalSettings["nLoginMethod"] != Constants.SECURITY_TABLE)
            {
                return(false);
            }
            loginSet            = XVar.Clone(ProjectSettings.getForLogin());
            GlobalVars.cipherer = XVar.Clone(RunnerCipherer.getForLogin((XVar)(loginSet)));
            bcrypted            = XVar.Clone((XVar)(GlobalVars.globalSettings["bEncryptPasswords"]) && (XVar)(GlobalVars.globalSettings["nEncryptPasswordMethod"] == 0));
            originalPassword    = XVar.Clone(password);
            GlobalVars.strSQL   = XVar.Clone(getSelectSQL((XVar)((XVar)(skipPasswordCheck) || (XVar)(bcrypted)), (XVar)(username), (XVar)(password), (XVar)(loginSet), (XVar)(GlobalVars.cipherer)));
            data = XVar.Clone(GlobalVars.cipherer.DecryptFetchedArray((XVar)(this.connection.query((XVar)(GlobalVars.strSQL)).fetchAssoc())));
            if ((XVar)((XVar)(data) && (XVar)(skipPasswordCheck)) || (XVar)(verifyUserFetchedData((XVar)(bcrypted), (XVar)(data), (XVar)(username), (XVar)(password), (XVar)(originalPassword))))
            {
                return(data);
            }
            return(false);
        }
Beispiel #2
0
 protected override XVar assignCipherer()
 {
     this.cipherer = XVar.Clone(RunnerCipherer.getForLogin());
     return(null);
 }