public TisSystemUser( string sUserName, AUTHENTICATION_TYPE enAuthType) { m_sName = sUserName; m_sAuthenticationType = enAuthType.ToString(); m_oSystemUser = new GenericIdentity(sUserName, m_sAuthenticationType); }
ITisSystemUser ITisSystemUsers.AddUserByType(string sSystemUserName, AUTHENTICATION_TYPE enAuthenticationType) { ITisSystemUser[] SystemUsers = (this as ITisSystemUsers).AddUsersByType( new string[] { sSystemUserName }, enAuthenticationType); return(SystemUsers [SystemUsers.Length - 1]); }
public TisSystemUser GetByIdentity(string sName, AUTHENTICATION_TYPE enAuthType) { foreach (TisSystemUser oSystemUser in m_oSystemUsers) { if (StringUtil.CompareIgnoreCase(oSystemUser.Name, sName)) { return(oSystemUser); } } return(null); }
public void RemoveAll(AUTHENTICATION_TYPE enAuthType) { TisSystemUser oSystemUser; for (int i = m_oSystemUsers.Count - 1; i >= 0; i--) { oSystemUser = (TisSystemUser)m_oSystemUsers [i]; if (oSystemUser.AuthenticationType == enAuthType) { m_oSystemUsers.Remove(oSystemUser); } } }
public void Remove(string[] UsersName, AUTHENTICATION_TYPE enAuthType) { TisSystemUser oSystemUser; for (int i = m_oSystemUsers.Count - 1; i >= 0; i--) { oSystemUser = (TisSystemUser)m_oSystemUsers [i]; if (Array.IndexOf(UsersName, oSystemUser.Name) > -1 && oSystemUser.AuthenticationType == enAuthType) { m_oSystemUsers.Remove(oSystemUser); } } }
public void CreateUser(AUTHENTICATION_TYPE authType, string authString, onUserLoaded callback = null) { if (!isWebServiceReady) { throw new Exception("WebService is not ready yet."); } isWebServiceReady = false; onUserLoadedEvent = callback; StartCoroutine(CreateNewUser(authType, authString, authString)); }
private TisSystemUser GetGroupByPrincipal(IPrincipal oPrincipal) { AUTHENTICATION_TYPE enPrincipalAuthType = StringToAuthentication(oPrincipal.Identity.AuthenticationType); foreach (TisSystemUser oSystemUser in m_oSystemUsers) { if (oSystemUser.AuthenticationType == enPrincipalAuthType) { if (OnFindSystemUserInNetGroup != null && OnFindSystemUserInNetGroup( new SystemUserInNetGroupArgs(oPrincipal.Identity.Name, oSystemUser.Name))) { return(oSystemUser); } } } return(null); }
public ITisSystemUser[] Add(string[] UsersName, AUTHENTICATION_TYPE enAuthType) { ArrayList oSystemUsers = new ArrayList(); TisSystemUser oSystemUser; foreach (string sUserName in UsersName) { oSystemUser = GetByIdentity(sUserName, enAuthType); if (OnSystemUserAdded != null && oSystemUser == null) { oSystemUser = new TisSystemUser(sUserName, enAuthType); SystemUserArgs oSystemUserArgs = new SystemUserArgs(oSystemUser); OnSystemUserAdded(oSystemUserArgs); if (oSystemUserArgs.IsValid) { m_oSystemUsers.Add(oSystemUser); } else { Log.WriteWarning("{0} : [{1}]", System.Reflection.MethodInfo.GetCurrentMethod(), String.Format("Attempt to add user [{0}] failed", oSystemUser.Name)); continue; } } oSystemUsers.Add(oSystemUser); } return((ITisSystemUser[])ArrayBuilder.CreateArray( oSystemUsers, typeof(ITisSystemUser), new ArrayElementFilter(AddSystemUsersFilter))); }
IEnumerator CreateNewUser(AUTHENTICATION_TYPE authType, string authString, string authString2) { WWW www = null; if (authType == AUTHENTICATION_TYPE.EMAIL) { user.email = authString; WWWForm form = new WWWForm(); form.AddField("SECURITY_STRING", securityString); form.AddField("EMAIL", authString); www = new WWW(webServiceURL + "/update_user.php", form); } else if (authType == AUTHENTICATION_TYPE.FACEBOOK) { user.facebookId = authString; WWWForm form = new WWWForm(); form.AddField("SECURITY_STRING", securityString); form.AddField("FACEBOOK", authString); www = new WWW(webServiceURL + "/update_user.php", form); } yield return(www); isWebServiceReady = true; if (www.text != null) { try { JSONNode n = JSON.Parse(www.text); user.id = n["userId"].AsInt; if (onUserLoadedEvent != null) { onUserLoadedEvent(GetWebServiceReturn(n["success"])); } } catch (Exception e) { Debug.Log("LoadUser Method: " + www.text); } } else { Debug.Log("LoadUser Method: " + www.error); } }
public bool Contains(string SytemUserName, AUTHENTICATION_TYPE enAuthType) { return(Contains(new TisSystemUser(SytemUserName, enAuthType))); }
public ITisSystemUser Add(string UsersName, AUTHENTICATION_TYPE enAuthType) { ITisSystemUser[] SystemUsers = Add(new string[] { UsersName }, enAuthType); return(SystemUsers [0]); }
public bool ContainsByType(string sSystemUserName, AUTHENTICATION_TYPE enAuthenticationType) { return(m_oSystemUserMngr.Contains(sSystemUserName, enAuthenticationType)); }
void ITisSystemUsers.RemoveUserByType(string sSystemUserName, AUTHENTICATION_TYPE enAuthenticationType) { (this as ITisSystemUsers).RemoveUsersByType(new string[] { sSystemUserName }, enAuthenticationType); }
void ITisSystemUsers.RemoveUsersByType(string[] SystemUsersName, AUTHENTICATION_TYPE enAuthenticationType) { m_oSystemUserMngr.Remove(SystemUsersName, enAuthenticationType); }
void ITisSystemUsers.RemoveAllByType(AUTHENTICATION_TYPE enAuthenticationType) { m_oSystemUserMngr.RemoveAll(enAuthenticationType); }
ITisSystemUser[] ITisSystemUsers.AddUsersByType(string[] SystemUsersName, AUTHENTICATION_TYPE enAuthenticationType) { return(m_oSystemUserMngr.Add(SystemUsersName, enAuthenticationType)); }