Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AccessManager.RedirectIfDisabled(AppSettings.TitanFeatures.ReferralPoolRotatorEnabled);

        if (!IsPostBack)
        {            
            Button1.Text = L1.MANAGE;
            Button2.Text = ParticipateButton.Text = L1.BUY;
            int UserId = Member.CurrentId;

            if (PoolRotatorManager.IsInPool(UserId))
            {
                ParticipatePlaceHolder.Visible = true;
                NoParticipatePlaceHolder.Visible = false;

                var linkUser = PoolRotatorManager.Get(UserId);

                LinkOpensLabel.Text = linkUser.ClicksDelivered.ToString();
                //ReferralsGainedLabel.Text = linkUser.ReferralsDelivered.ToString();
                RotatorExpiresLiteral.Text = linkUser.Expires.ToString();
                RotatorLinkLiteral.Text = String.Format("<a href='{0}'>{0}</a>", linkUser.GetLink());
            }

            if (selectedBalance == RotatorBalance.AdCredits)
                PriceLiteral.Text = AppSettings.Referrals.ReferralPoolRotatorPricePerMonthInAdCredits.ToString() + " " + U5006.ADCREDITS;
            else if (selectedBalance == RotatorBalance.AdBalance)
                PriceLiteral.Text = AppSettings.Referrals.ReferralPoolRotatorPricePerMonth.ToString();

            PriceLiteral.Text += " / 30 " + L1.DAYS.ToLower();
            MembersInPoolLabel.Text = PoolRotatorStatistics.MembersInThePool.ToString();
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //TITAN News has its own homepage
        if (AppSettings.TitanFeatures.NewsHomepageEnabled)
        {
            Response.Redirect("~/sites/defaultnews.aspx");
        }

        //Theme redirection for demo
        if (AppSettings.IsDemo && AppSettings.Site.Theme != "titan" && !Request.CurrentExecutionFilePath.StartsWith("/Themes"))
        {
            Server.Transfer(String.Format("~/Themes/{0}/default.aspx", AppSettings.Site.Theme));
        }

        GlobalMasterHelper.PageLoad();
        AdBlockManager.CheckDenyForAll();

        if (Request.QueryString["u"] != null)
        {
            //Save the referer in the cookies
            ReferrerUtils.SetReferrer(Request.QueryString["u"]);

            if (!Page.IsPostBack)
            {
                PoolRotatorManager.TryAddLinkView(ReferrerUtils.GetReferrerName());
            }
        }
        else if (Request.QueryString["ref"] != null)
        {
            //Save the referer in the session
            Session["PaidToPromoteReferer"] = Request.QueryString["ref"];
        }

        TestimonialsLiteral.Text = Testimonial.GetTestimonials();
        if (AppSettings.Site.IsEUCookiePolicyEnabled)
        {
            ScriptLiteral.Text += "<script src=\"Scripts/EU.js\" type=\"text/javascript\"></script>";
        }

        if (AppSettings.Communication.TawkLiveChatEnabled)
        {
            TawkChatPlaceHolder.Visible = true;
            TawkSourceID = AppSettings.Communication.TawkLiveChatKey;
        }

        PaymentProofsLink.Visible = AppSettings.TitanFeatures.PaymentProofsEnabled;
        FooterNewsLink.Visible    = AppSettings.Site.LatestNewsEnabled;

        var cache = new PayoutsScrollingBarCashe().Get();

        LatestPayoutsLiteral.Text = cache.ToString();
    }
Пример #3
0
    public void ParticipateButton_Click(object sender, EventArgs e)
    {
        SPanel.Visible = false;
        EPanel.Visible = false;

        try
        {
            Member user = Member.Current;
            if (selectedBalance == RotatorBalance.AdCredits)
            {
                if (user.PTCCredits < AppSettings.Referrals.ReferralPoolRotatorPricePerMonthInAdCredits)
                    throw new MsgException(L1.NOTENOUGHFUNDS);

                user.SubstractFromPTCCredits(AppSettings.Referrals.ReferralPoolRotatorPricePerMonthInAdCredits, "Rotator Link");
            }

            else if (selectedBalance == RotatorBalance.AdBalance)
            {
                if (user.PurchaseBalance < AppSettings.Referrals.ReferralPoolRotatorPricePerMonth)
                    throw new MsgException(L1.NOTENOUGHFUNDS);

                user.SubtractFromPurchaseBalance(AppSettings.Referrals.ReferralPoolRotatorPricePerMonth, "Rotator Link");
            }
            user.SaveBalances();

            if (PoolRotatorManager.IsInPool(user.Id))
            {
                //Prolong
                var link = PoolRotatorManager.Get(user.Id);
                link.Expires = link.Expires.AddDays(30);
                link.Save();
            }
            else
            {
                PoolRotatorManager.AddToPool(user.Id);
            }

            SPanel.Visible = true;
            SText.Text = L1.OP_SUCCESS;
        }
        catch (MsgException ex)
        {
            EPanel.Visible = true;
            EText.Text = ex.Message;
        }
        catch (Exception ex)
        {
            ErrorLogger.Log(ex);
        }
    }
Пример #4
0
    public static string TryGetUserNameFromPool(string refUsername)
    {
        // With referral link for Pool Rotator
        if (refUsername.StartsWith("*"))
        {
            int userId = PoolRotatorManager.GetUserIdFromPool();
            if (userId != -1)
            {
                HttpContext.Current.Session["ReferralFrom"] = "Rotator Link";
            }

            refUsername = userId == -1 ? String.Empty : new Member(userId).Name;
        }

        return(refUsername);
    }
Пример #5
0
    public static void ProceedDailyTasks()
    {
        log = new StringBuilder();

        var Entry = new CronEntry();

        Entry.Date = DateTime.Now;

        try
        {
            Log("Starting CRON procedure");

            //Make sure it runs only once
            if (CanRun())
            {
                AppSettings.IsOffline        = true;
                AppSettings.Misc.LastCRONRun = DateTime.Now;
                AppSettings.Misc.Save();
                stime = DateTime.Now;

                AntiCheatSystem.CRON();
                Log("OK [1] AntiCheatSystem. Elapsed time: " + GetTimeString(stime));

                RentReferralsSystem.CRON();
                Log("OK [2] RentedReferralsSystem. Elapsed time: " + GetTimeString(stime));

                StatisticsManager.CRON();
                Log("OK [3a] StatisticsManager. Elapsed time: " + GetTimeString(stime));

                //MUST BE RUN BEFORE MEMBERMANAGER.CRON() !!!
                CustomFeaturesManager.CRON();
                Log("OK [3b] CustomFeaturesManager. Elapsed time: " + GetTimeString(stime));

                MemberManager.CRON();
                Log("OK [4] Member. Elapsed time: " + GetTimeString(stime));

                SyncedNetworkFactory.SynchronizeAll();
                Log("OK [5] CPA Offers. Elapsed time: " + GetTimeString(stime));

                AppSettings.Payments.CRON();
                Log("OK [6] Payments. Elapsed time: " + GetTimeString(stime));

                ShoutboxManager.CRON();
                Log("OK [7] Shoutbox. Elapsed time: " + GetTimeString(stime));

                CLPManager.CRON();
                Log("OK [8] CLPManager. Elapsed time: " + GetTimeString(stime));

                BannerAuctionManager.CRON();
                Log("OK [10] BannerAuctionManager. Elapsed time: " + GetTimeString(stime));

                PointsLockingManager.CRON();
                Log("OK [11] PointsLockingManager. Elapsed time: " + GetTimeString(stime));

                DBArchiver.CRON();
                Log("OK [12] DBArchiver. Elapsed time: " + GetTimeString(stime));

                RevenueSharesDistributionManager.CRON();
                Log("OK [13] RevenueSharesDistributionManager. Elapsed time: " + GetTimeString(stime));

                CreditLineManager.CRON();
                Log("OK [14] CreditLineManager. Elapsed time: " + GetTimeString(stime));

                PoolRotatorManager.CRON();
                Log("OK [15] PoolRotatorManager. Elapsed time: " + GetTimeString(stime));

                JackpotManager.CRON();
                Log("OK [16] JackpotManager. Elapsed time: " + GetTimeString(stime));

                TrafficExchangeManager.CRON();
                Log("OK [17] TrafficExchangeManager. Elapsed time: " + GetTimeString(stime));

                DailyPoolManager.CRON();
                Log("OK [18] DailyPoolManager. Elapsed time: " + GetTimeString(stime));

                //Matrix
                MatrixBase matrix = MatrixFactory.GetMatrix();
                if (matrix != null)
                {
                    matrix.CRON();
                }
                Log("OK [19] MatrixBase. Elapsed time: " + GetTimeString(stime));

                ApiAccessToken.CRON();
                Log("OK [20] ApiAccessToken. Elapsed time: " + GetTimeString(stime));

                InvestmentPlatformManager.CRON();
                Log("OK [21] InvestmentPlatformManager. Elapsed time: " + GetTimeString(stime));

                MarketplaceBalanceLogManager.CRON();
                Log("OK [22] MarketplaceBalanceLogManager. Elapsed time: " + GetTimeString(stime));

                MiniVideoManager.CRON();
                Log("OK [23] MiniVideoManager. Elapsed time: " + GetTimeString(stime));

                PaidToPromoteManager.CRON();
                Log("OK [24] PaidToPromoteManager. Elapsed time: " + GetTimeString(stime));

                RollDiceLotteryManager.CRON();
                Log("OK [25] RollDiceLotteryManager. Elapsed time: " + GetTimeString(stime));

                WalletManager.CRON();
                Log("OK [26] WalletManager. Elapsed time: " + GetTimeString(stime));

                NewsManager.CRON();
                Log("OK [27] NewsManager. Elapsed time: " + GetTimeString(stime));


                Entry.Type = 1;
                Entry.Text = "Procedure completed successfully (27/27 100%) after " + GetTimeString(stime);
            }
            else
            {
                Entry.Type = 2;
                Entry.Text = "Procedure prevented from multiple run";
            }
        }
        catch (Exception ex)
        {
            ErrorLogger.Log(ex);
            Log("Fatal error (exception thrown)..");
            Entry.Type = 3;
            Entry.Text = "Fatal error during procedure execution. Check logs for more information";
            Mailer.SendCRONFailureMessage();
        }
        finally
        {
            ErrorLogger.Log(log.ToString(), LogType.CRON);
            AppSettings.IsOffline = false;
            Entry.Save();
            HttpContext.Current.Response.Write(Entry.Text);
        }
    }
Пример #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        GlobalMasterHelper.PageLoad();
        AdBlockManager.CheckDenyForAll();

        RegistrationCaptchaPlaceHolder.Visible = AppSettings.Registration.IsRegistrationCaptchaEnabled;
        PINSectionPlaceHolder.Visible          = AppSettings.Registration.IsPINEnabled;

        if (!Page.IsPostBack)
        {
            AppSettings.Authentication.Reload();

            if (Request.QueryString["e"] != null)
            {
                Email.Text = Request.QueryString["e"];
            }

            if (TitanFeatures.IsRetireYoung)
            {
                ReferrerUtils.SetReferrer("RetireYoung");
            }

            if (Request.QueryString["u"] != null || ReferrerUtils.GetReferrerName() != null)
            {
                string refUsername;
                if (Request.QueryString["u"] != null)
                {
                    ReferrerUtils.SetReferrer(Request.QueryString["u"]);
                }

                refUsername = ReferrerUtils.GetReferrerName();

                if (!Page.IsPostBack)
                {
                    PoolRotatorManager.TryAddLinkView(refUsername);
                }

                // With referral link for Pool Rotator
                refUsername = PoolRotatorManager.TryGetUserNameFromPool(refUsername);

                Referer.Text = refUsername;
            }
            else if (Session["PaidToPromoteReferer"] != null)
            {
                var refId       = Convert.ToInt32(Session["PaidToPromoteReferer"].ToString());
                var refUsername = new Member(refId).Name;

                Referer.Text = refUsername;
            }
        }
        FeatureManager Manager = null;

        //Facebook OAuth
        if (IsFromFacebookOAuth)
        {
            //Check if country is eligible for Facebook Register
            Manager = new FeatureManager(GeolocatedFeatureType.FacebookRegistration);

            //Hide unnecessary fields
            FacebookMember fbMember = new FacebookMember(Session["accessToken"].ToString());

            Email.Text = fbMember.Email;

            //Passwords validators
            RegularExpressionValidator2.Enabled = false;
            PasswordRequired.Enabled            = false;
            ConfirmPasswordRequired.Enabled     = false;
            PasswordCompare.Enabled             = false;
            CustomValidator1.Enabled            = false;
            TitanCaptcha.Visible = false;

            FirstName.Text  = fbMember.FirstName;
            SecondName.Text = fbMember.LastName;
        }
        else
        {
            //Check if country is eligible for Standard Register
            Manager = new FeatureManager(GeolocatedFeatureType.Registration);
        }

        if (!Manager.IsAllowed)
        {
            RegistrationPanel.Visible = false;
            CreateUserButton.Visible  = false;
            ErrorMessagePanel.Visible = true;
            ErrorMessage.Text         = U4000.SORRYCOUNTRY;
        }

        //Set up textbox hints
        HintAdder.Add(Username, L1.REG_USERNAME);
        HintAdder.Add(Password, U3501.REG_PASSWORD);
        HintAdder.Add(Email, L1.REG_EMAIL);
        HintAdder.Add(PIN, L1.REG_PIN);
        HintAdder.Add(Referer, L1.REG_REFERER);

        Username.Attributes.Add("placeholder", L1.USERNAME);
        Email.Attributes.Add("placeholder", "Email");
        Password.Attributes.Add("placeholder", L1.PASSWORD);
        ConfirmPassword.Attributes.Add("placeholder", L1.CONFIRMPASSWORD);
        PIN.Attributes.Add("placeholder", L1.DESIREDPIN);
        BirthYear.Attributes.Add("placeholder", L1.BIRTHYEAR);
        FirstName.Attributes.Add("placeholder", L1.FIRSTNAME);
        SecondName.Attributes.Add("placeholder", L1.SECONDNAME);
        City.Attributes.Add("placeholder", L1.CITY);
        StateProvince.Attributes.Add("placeholder", L1.STATEPROVINCE);
        ZipCode.Attributes.Add("placeholder", L1.ZIPCODE);

        Address.Attributes.Add("placeholder", L1.ADDRESS);

        //Add translations
        LangAdder.Add(CreateUserButton, L1.REGISTER);
        LangAdder.Add(RegularExpressionValidator1, L1.ER_INVALIDUSERNAME, true);
        LangAdder.Add(UserNameRequired, L1.REG_REQ_USERNAME, true);
        LangAdder.Add(EmailRequired, L1.REG_REQ_EMAIL, true);
        LangAdder.Add(CorrectEmailRequired, L1.ER_BADEMAILFORMAT, true);
        LangAdder.Add(PasswordRequired, L1.REG_REQ_PASS, true);
        LangAdder.Add(RegularExpressionValidator2, L1.ER_INVALIDPASS, true);
        LangAdder.Add(PasswordCompare, L1.ER_PASSDIFFER, true);
        LangAdder.Add(ConfirmPasswordRequired, L1.REG_REQ_CONFIRM, true);
        LangAdder.Add(RegularExpressionValidator3, L1.ER_BADPIN, true);
        LangAdder.Add(RequiredFieldValidator2, L1.REG_REQ_PIN, true);
        LangAdder.Add(RegularExpressionValidator4, L1.ER_BADYEAR, true);
        LangAdder.Add(RequiredFieldValidator1, L1.REG_REQ_YEAR, true);
        LangAdder.Add(RefererValidator, L1.ER_BADREF, true);
        LangAdder.Add(CustomValidator1, L1.ER_BADCAPTCHA, true);
        LangAdder.Add(CustomValidator4, L1.REG_REQ_TOS, true);

        EarnerCheckBox.Text     = U6000.EARNER;
        AdvertiserCheckBox.Text = L1.ADVERTISER;
        PublisherCheckBox.Text  = U6000.PUBLISHER;

        //Detailed info
        LangAdder.Add(RE_1, L1.DETAILEDNOSPECIAL + " " + L1.FIRSTNAME, true);
        LangAdder.Add(RF_1, L1.FIRSTNAME + " " + U3900.FIELDISREQUIRED, true);
        LangAdder.Add(RE_2, L1.DETAILEDNOSPECIAL + " " + L1.SECONDNAME, true);
        LangAdder.Add(RF_2, L1.SECONDNAME + " " + U3900.FIELDISREQUIRED, true);
        LangAdder.Add(RE_3, L1.DETAILEDNOSPECIAL + " " + L1.ADDRESS, true);
        LangAdder.Add(RF_3, L1.ADDRESS + " " + U3900.FIELDISREQUIRED, true);
        LangAdder.Add(RE_4, L1.DETAILEDNOSPECIAL + " " + L1.CITY, true);
        LangAdder.Add(RF_4, L1.CITY + " " + U3900.FIELDISREQUIRED, true);
        LangAdder.Add(RE_5, L1.DETAILEDNOSPECIAL + " " + L1.STATEPROVINCE, true);
        LangAdder.Add(RF_5, L1.STATEPROVINCE + " " + U3900.FIELDISREQUIRED, true);
        LangAdder.Add(RE_6, L1.DETAILEDNOSPECIAL + " " + L1.ZIPCODE, true);
        LangAdder.Add(RF_6, L1.ZIPCODE + " " + U3900.FIELDISREQUIRED, true);
        LangAdder.Add(AccountTypeValidator, U6000.SELECTACCOUNTTYPE, true);

        //Check detailed info
        if (AppSettings.Authentication.DetailedRegisterFields)
        {
            DetailedPanel.Visible = true;
        }

        AvailableRolesPlaceHolder.Visible     = !AppSettings.Registration.IsDefaultRegistrationStatusEnabled;
        EarnerCheckBoxPlaceHolder.Visible     = AppSettings.TitanFeatures.EarnersRoleEnabled;
        AdvertiserCheckBoxPlaceHolder.Visible = AppSettings.TitanFeatures.AdvertisersRoleEnabled;
        PublisherCheckBoxPlaceHolder.Visible  = AppSettings.TitanFeatures.PublishersRoleEnabled;

        if (AppSettings.Registration.IsDefaultRegistrationStatusEnabled)
        {
            EarnerCheckBox.Checked     = AppSettings.Registration.IsDefaultEarnerStatus;
            AdvertiserCheckBox.Checked = AppSettings.Registration.IsDefaultAdvertiserStatus;
            PublisherCheckBox.Checked  = AppSettings.Registration.IsDefaultPublisherStatus;
        }

        //Custom field
        CustomFields.Controls.Add(RegistrationFieldCreator.Generate());

        CountryInformation CIService = new CountryInformation(IP.Current);

        CountryName.Text = CIService.CountryName;
        Flag.ImageUrl    = "~/Images/Flags/" + CIService.CountryCode.ToLower() + ".png";
    }