Esempio n. 1
0
        //Initialize the system, get the provider and setup default user
        static private void initialize()
        {
            if (!mInitialized)
            {
                //Get the provider. Should be setup in the config
                mProvider = (Simple.Providers.MySQL.MysqlMembershipProvider)(Membership.Providers["3DRAPIMembership"]);

                //Setup the default user
                if (mProvider.GetUser("API_USER", false) == null)
                {
                    MembershipCreateStatus mcs = new MembershipCreateStatus();

                    mProvider.CreateUser("API_USER",
                                         EncodeBytesAsHex(Hash("password")),
                                         "*****@*****.**",
                                         "",
                                         "",
                                         true,
                                         null,
                                         out mcs);
                }
                else
                {
                    //Make sure the password for the default user is password
                    mProvider.GetUser("API_USER", false).ChangePassword(mProvider.GetUser("API_USER", false).GetPassword(), EncodeBytesAsHex(Hash("password")));
                }
                mInitialized = true;
            }
        }
Esempio n. 2
0
        //Initialize the system, get the provider and setup default user
        private static void initialize()
        {
            if (!mInitialized)
            {
                //Get the provider. Should be setup in the config
                mProvider = (Simple.Providers.MySQL.MysqlMembershipProvider)(Membership.Providers["3DRAPIMembership"]);

                //Setup the default user
                if (mProvider.GetUser("API_USER", false) == null)
                {
                    MembershipCreateStatus mcs = new MembershipCreateStatus();

                    mProvider.CreateUser("API_USER",
                                            EncodeBytesAsHex(Hash("password")),
                                            "*****@*****.**",
                                            "",
                                            "",
                                            true,
                                            null,
                                            out mcs);
                }
                else
                {
                    //Make sure the password for the default user is password
                    mProvider.GetUser("API_USER", false).ChangePassword(mProvider.GetUser("API_USER", false).GetPassword(), EncodeBytesAsHex(Hash("password")));
                }
                mInitialized = true;
            }
        }