Exemplo n.º 1
0
    public int LoginSubmit(Page page, Sites site, string ID, string Password, string InputCheckCode, Shove.Web.UI.ShoveCheckCode sccCheckCode, ref string ReturnDescription)
    {
        ReturnDescription = "";

        bool Opt_isUseCheckCode = site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);

        ID = ID.Trim();
        Password = Password.Trim();

        if ((ID == "") || (Password == ""))
        {
            ReturnDescription = "用户名和密码都不能为空";

            return -1;
        }

        if ((Opt_isUseCheckCode) && (!sccCheckCode.Valid(InputCheckCode)))
        {
            ReturnDescription = "验证码输入错误";

            return -2;
        }

        System.Threading.Thread.Sleep(500);

        ElectronTicketAgents electronTicketAgents = new ElectronTicketAgents();
        electronTicketAgents.ID = Shove._Convert.StrToInt(ID, 0);
        electronTicketAgents.Password = Password;

        return electronTicketAgents.Login(ref ReturnDescription);
    }
Exemplo n.º 2
0
    public static int SendEmail(Sites Site, string MailTo, string Subject, string Body)
    {
        SendEmailTask sendemailtask = new SendEmailTask(Site, MailTo, Subject, Body);
        sendemailtask.Run();

        return 0;
    }
Exemplo n.º 3
0
    public static int SendSMS(Sites Site, long UserID, string Mobile, string Content)  // UserID 付费用户, < 0 则系统付费
    {
        if ((Site == null) || (Site.ID < 0))
        {
            return -1;
        }

        DAL.Tables.T_SMS sms = new DAL.Tables.T_SMS();

        sms.SiteID.Value = Site.ID;
        sms.SMSID.Value = -1;
        sms.From.Value = "";
        sms.To.Value = Mobile;
        sms.Content.Value = Content;
        sms.IsSent.Value = false;

        sms.Insert();

        return 0;

        //SendSMSTask sendsmstask = new SendSMSTask(Site, UserID, Mobile, Content);
        //sendsmstask.Run();

        //return 0;
    }
Exemplo n.º 4
0
        /// <summary>
        /// Gets an Url for the MediaPortal IPTV filter with user settings of the site applied.
        /// </summary>
        /// <param name="siteUtil">The <see cref="Sites.SiteUtilBase"/> instance with url settings.</param>
        /// <param name="url">A string containing the base64 encoded binary serialized data of a supported <see cref="SimpleUrl"/> inheriting class.</param>
        /// <returns></returns>
        public static String GetFilterUrl(Sites.SiteUtilBase siteUtil, String url)
        {
            int index = url.IndexOf(SimpleUrl.ParameterSeparator);
            SimpleUrl simpleUrl = null;
            
            if (index != -1)
            {
                String encodedContent = url.Substring(index + SimpleUrl.ParameterSeparator.Length);
                simpleUrl = SimpleUrl.FromString(encodedContent);
                if (simpleUrl == null)
                    throw new OnlineVideosException(Translation.Instance.UnableToPlayVideo);
            }
            else
            {
                simpleUrl = UrlFactory.CreateUrl(url);
                if (simpleUrl == null)
                    return url;
            }

            //simpleUrl.CacheFolder =; simpleUrl.MaximumLogSize =; simpleUrl.MaximumPlugins =; simpleUrl.Verbosity =;

            if (siteUtil != null)
                simpleUrl.ApplySettings(siteUtil);

            return simpleUrl.ToFilterString();
        }
Exemplo n.º 5
0
    public void SetCheckCode(Sites site, Shove.Web.UI.ShoveCheckCode sccCheckCode)
    {
        switch (site.SiteOptions["Opt_CheckCodeCharset"].ToShort(0))
        {
            case 0:
                sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.All;
                break;

            case 1:
                sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyLetter;
                break;

            case 2:
                sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyLetterLower;
                break;

            case 3:
                sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyLetterUpper;
                break;

            case 4:
                sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyNumeric;
                break;

            default:
                sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.All;
                break;
        }
    }
Exemplo n.º 6
0
 public SendEmailTask(Sites site, string mailto, string subject, string body)
 {
     this.Site = site;
     this.MailTo = mailto;
     this.Subject = subject;
     this.Body = body;
 }
Exemplo n.º 7
0
    protected override void OnLoad(EventArgs e)
    {
        #region 获取站点

        //_Site = new Sites()[Shove._Web.Utility.GetUrlWithoutHttp()];
        _Site = new Sites()[1];

        if (_Site == null)
        {
            PF.GoError(ErrorNumber.Unknow, "域名无效,限制访问", this.GetType().FullName);

            return;
        }

        #endregion

        #region 获取用户

        _ElectronTicketAgents = ElectronTicketAgents.GetCurrentUser();

        if (isRequestLogin && (_ElectronTicketAgents == null))
        {
            Response.Redirect("Login.aspx");

            return;
        }

        #endregion

        HtmlMeta hm = new HtmlMeta();
        hm.HttpEquiv = "X-UA-Compatible";
        hm.Content = "IE=EmulateIE7";

        base.OnLoad(e);
    }
Exemplo n.º 8
0
        public System.Web.Mvc.ActionResult Submit(Sites.Models.Site site, System.Web.Mvc.ControllerContext controllerContext, Sites.Models.SubmissionSetting submissionSetting)
        {
            var request = controllerContext.HttpContext.Request;
            var action = request["action"];

            var jsonResultData = new JsonResultData();
            object result = null;

            try
            {
                if (action == "get-addresses")
                {
                    result = GetAddresses(site, controllerContext);
                }

                jsonResultData.Success = true;
                jsonResultData.Model = result;
            }
            catch (Exception ex)
            {
                jsonResultData.Success = false;
                jsonResultData.AddException(ex);
            }

            return new JsonResult { Data = jsonResultData, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
        }
Exemplo n.º 9
0
 public int LoginSubmit(Page page, Sites site, string Name, string Password, string InputCheckCode, ShoveCheckCode sccCheckCode, ref string ReturnDescription)
 {
     ReturnDescription = "";
     bool flag = site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);
     Name = Name.Trim();
     Password = Password.Trim();
     if ((Name == "") || (Password == ""))
     {
         ReturnDescription = "用户名和密码都不能为空";
         return -1;
     }
     if (flag)
     {
         if (sccCheckCode == null)
         {
             ReturnDescription = "验证码内部错误";
             return -2;
         }
         if (!sccCheckCode.Valid(InputCheckCode))
         {
             ReturnDescription = "验证码输入错误";
             return -3;
         }
     }
     Thread.Sleep(500);
     return new Users(site.ID) { Name = Name, Password = Password }.Login(ref ReturnDescription);
 }
Exemplo n.º 10
0
 private void InitializeRedirectUrls()
 {
     XmlSerializer deserializer = new XmlSerializer(typeof(Sites));
     TextReader reader = new StreamReader(@"redirect-URLs.xml");
     this.sites = (Sites)deserializer.Deserialize(reader);
     reader.Close();
 }
Exemplo n.º 11
0
    protected override void OnLoad(EventArgs e)
    {
        #region 获取站点

        _Site = new Sites()[1];

        if (_Site == null)
        {
            PF.GoError(ErrorNumber.Unknow, "域名无效,限制访问", this.GetType().FullName);

            return;
        }

        #endregion

        #region 获取用户

        Users users = Users.GetCurrentUser(1);

        if (users == null)
        {
            PF.GoLogin(RequestLoginPage, false);

            return;
        }

        if (_User == null)
        {
            _User = Session["CpsAdminPageBase_Users"] as Users;
        }

        if (_User == null)
        {
            PF.GoLogin(RequestLoginPage, false);

            return;
        }

        #endregion

        #region 判断权限

        if (!users.Competences.IsOwnedCompetences(RequestCompetences))
        {
            PF.GoError(ErrorNumber.NotEnoughCompetence, "对不起,您没有足够的权限访问此页面", this.GetType().FullName);

            return;
        }

        #endregion

        HtmlMeta hm = new HtmlMeta();
        hm.HttpEquiv = "X-UA-Compatible";
        hm.Content = "IE=EmulateIE7";

        PageUrl = this.Request.Url.AbsoluteUri;

        base.OnLoad(e);
    }
Exemplo n.º 12
0
 public static DownloadInfo Create(VideoInfo video, Category category, Sites.SiteUtilBase site)
 {
     DownloadInfo di = (DownloadInfo)CrossDomain.OnlineVideosAppDomain.Domain.CreateInstanceAndUnwrap(typeof(DownloadInfo).Assembly.FullName, typeof(DownloadInfo).FullName, false, System.Reflection.BindingFlags.CreateInstance | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic, null, null, null, null);
     di.VideoInfo = video;
     di.Category = category;
     di.Util = site;
     return di;
 }
Exemplo n.º 13
0
    public SendEmailTask(Sites site, string mailto, string subject, string body)
    {
        Site = site;

        MailTo = mailto;
        Subject = subject;
        Body = body;
    }
 protected override Sites GetSites()
 {
     List<Site> sites = SiteConfiguration.GetSites();
     Sites clonedSites = new Sites();
     foreach (Site site in sites)
         clonedSites.Add(new Site() { ID = site.ID, Name = site.Name, Url = site.Url, 
             ProductVersion = site.ProductVersion });
     return clonedSites;
 }
Exemplo n.º 15
0
    protected override void OnLoad(EventArgs e)
    {
        string ReturnDescription = "";

        #region 获取站点

        _Site = new Sites()[1];

        if (_Site == null)
        {
            PF.GoError(ErrorNumber.Unknow, "域名无效,限制访问", this.GetType().BaseType.FullName);

            return;
        }

        #endregion

        #region 获取用户

        _User = Users.GetCurrentUser(_Site.ID);

        if (isRequestLogin && (_User == null))
        {
            GoLogin(RequestLoginPage);

            return;
        }

        if (isCpsRequestLogin && (_User.cps.ID < 0))
        {
            _User.Logout(ref ReturnDescription);

            PF.GoError(ErrorNumber.Unknow, "您不是 CPS 用户", this.GetType().BaseType.FullName);

            return;
        }

        if (isCpsRequestLogin && !_User.cps.ON)
        {
            _User.Logout(ref ReturnDescription);

            PF.GoError(ErrorNumber.Unknow, "用户被冻结", this.GetType().BaseType.FullName);

            return;
        }

        #endregion

        HtmlMeta hm = new HtmlMeta();
        hm.HttpEquiv = "X-UA-Compatible";
        hm.Content = "IE=EmulateIE7";

        PageUrl = this.Request.Url.AbsoluteUri;

        base.OnLoad(e);
    }
Exemplo n.º 16
0
        public SiteViewModel(Sites.SiteUtilBase site)
            : base(Consts.KEY_NAME, site.Settings.Name)
        {
            _site = site;

            _nameProperty = new WProperty(typeof(string), site.Settings.Name);
            _languageProperty = new WProperty(typeof(string), site.Settings.Language);
            _descriptionProperty = new WProperty(typeof(string), site.Settings.Description);
            _contextMenuEntriesProperty = new WProperty(typeof(ItemsList), null);
            _settingsListProperty = new WProperty(typeof(ItemsList), null);
        }
Exemplo n.º 17
0
        public static void AddSite(string subscriptionId, Site site)
        {
            Sites sites = GetSites(subscriptionId);
            if (sites == null)
            {
                sites = new Sites();
            }

            sites.Add(site);
            SaveSites(subscriptionId, sites);
        }
Exemplo n.º 18
0
        public void GetSetSitesTest()
        {
            Assert.IsNull(Cache.GetSites(SubscriptionName));

            Sites sites = new Sites(new List<Site> { new Site { Name = "site1" }, new Site { Name = "site2" }});
            Cache.SaveSites(SubscriptionName, sites);

            Sites getSites = Cache.GetSites(SubscriptionName);
            Assert.IsNotNull(getSites.Find(s => s.Name.Equals("site1")));
            Assert.IsNotNull(getSites.Find(s => s.Name.Equals("site2")));
        }
Exemplo n.º 19
0
    public static int SendStationSMS(Sites Site, long SourceUserID, long AimUserID, short StationSMSType, string Content)  // UserID 付费用户, < 0 则系统付费
    {
        DAL.Tables.T_StationSMS T_StationSMS = new DAL.Tables.T_StationSMS(); 
        T_StationSMS.SiteID.Value = Site.ID;
        T_StationSMS.SourceID.Value = SourceUserID;
        T_StationSMS.AimID.Value = AimUserID;
        T_StationSMS.Type.Value = StationSMSType;
        T_StationSMS.Content.Value = Content;
        T_StationSMS.isRead.Value = false;
        T_StationSMS.Insert();

        return 0;
    }
Exemplo n.º 20
0
 protected override void OnLoad(EventArgs e)
 {
     this.AlipayLoginSrcUrl = base.ResolveUrl("~/Home/Room/images/zfb_button2.jpg");
     this.LoginTopSrcUrl = base.ResolveUrl("~/Home/Room/images/login_top.jpg");
     this.LoginBackSrcUrl = base.ResolveUrl("~/Home/Room/images/login_back.jpg");
     this.RegisterUrl = base.ResolveUrl("~/UserReg.aspx");
     this.ForgetPwdUrl = base.ResolveUrl("~/Home/Room/ForgetPassword.aspx");
     this.AlipayLoginUrl = base.ResolveUrl("~/Home/Room/Login.aspx");
     this.LoginIframeUrl = base.ResolveUrl("~/Home/Room/UserLoginDialog.aspx");
     this._Site = new Sites()[1L];
     this._User = Users.GetCurrentUser(this._Site.ID);
     base.OnLoad(e);
 }
Exemplo n.º 21
0
 public int LoginSubmit(Page page, Sites site, string Name, string Password, ref string ReturnDescription)
 {
     ReturnDescription = "";
     Name = Name.Trim();
     Password = Password.Trim();
     if ((Name == "") || (Password == ""))
     {
         ReturnDescription = "用户名和密码都不能为空";
         return -1;
     }
     Thread.Sleep(500);
     return new Users(site.ID) { Name = Name, Password = Password }.Login(ref ReturnDescription);
 }
 private static void saveSites(Sites sites)
 {
     try
     {
         string configPath = SiteConfigPath;
         
         XmlSerializer writer = new XmlSerializer(typeof(Sites));
         using (StreamWriter file = new StreamWriter(configPath))
         {
             writer.Serialize(file, sites);
         }
     }
     catch { }
 }
Exemplo n.º 23
0
        public static void SaveSites(string subscriptionId, Sites sites)
        {
            try
            {
                string sitesFile = Path.Combine(GlobalPathInfo.GlobalSettingsDirectory,
                                                string.Format("sites.{0}.json", subscriptionId));
                JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();

                // Make sure path exists
                Directory.CreateDirectory(GlobalPathInfo.GlobalSettingsDirectory);
                File.WriteAllText(sitesFile, javaScriptSerializer.Serialize(sites));
            }
            catch
            {
                // Do nothing. Caching is optional.
            }
        }
        public OnlineVideosGuiListItem(Sites.SiteUtilBase item) : base(item.Settings.Name) 
        {
            Label2 = item.Settings.Language;
            IsFolder = true;
            Item = item;
            // use Icon with the same name as the Site
			string image = SiteImageExistenceCache.GetImageForSite(item.Settings.Name, item.Settings.UtilName, "Icon");
            if (!string.IsNullOrEmpty(image))
            {
                ThumbnailImage = image;
                IconImage = image;
                IconImageBig = image;
            }
            else
            {
                MediaPortal.Util.Utils.SetDefaultIcons(this);
            }
        }
Exemplo n.º 25
0
    public Sites this[long siteid]
    {
        get
        {
            Sites site = new Sites();

            site.ID = siteid;

            string ReturnDescription = "";

            if (site.GetSiteInformationByID(ref ReturnDescription) < 0)
            {
                return null;
            }

            return site;
        }
    }
Exemplo n.º 26
0
    protected override void OnLoad(EventArgs e)
    {
        #region 获取站点

        //_Site = new Sites()[Shove._Web.Utility.GetUrlWithoutHttp()];
        _Site = new Sites()[1];

        if (_Site == null)
        {
            PF.GoError(ErrorNumber.Unknow, "域名无效,限制访问", this.GetType().FullName);

            return;
        }

        #endregion

        #region 获取用户

        _User = Users.GetCurrentUser(_Site.ID);

        if (isRequestLogin && (_User == null))
        {
            PF.GoLogin(RequestLoginPage, isAtFramePageLogin);

            return;
        }

        #endregion

        #region 判断权限

        if (isRequestLogin && (RequestCompetences != "") && (!_User.Competences.IsOwnedCompetences(RequestCompetences)))
        {
            PF.GoError(ErrorNumber.NotEnoughCompetence, "对不起,您没有足够的权限访问此页面", this.GetType().FullName);

            return;
        }

        #endregion

        PageUrl = this.Request.Url.AbsoluteUri;

        base.OnLoad(e);
    }
Exemplo n.º 27
0
 public int LoginSubmit(Page page, Sites site, string ID, string Password, string InputCheckCode, ShoveCheckCode sccCheckCode, ref string ReturnDescription)
 {
     ReturnDescription = "";
     bool flag = site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);
     ID = ID.Trim();
     Password = Password.Trim();
     if ((ID == "") || (Password == ""))
     {
         ReturnDescription = "用户名和密码都不能为空";
         return -1;
     }
     if (flag && !sccCheckCode.Valid(InputCheckCode))
     {
         ReturnDescription = "验证码输入错误";
         return -2;
     }
     Thread.Sleep(500);
     return new CardPasswordAgentUsers { ID = _Convert.StrToInt(ID, 0), Password = Password }.Login(ref ReturnDescription);
 }
Exemplo n.º 28
0
        /// <summary>
        /// 分享用户
        /// </summary>
        /// <param name="Site"></param>
        /// <param name="uid"></param>
        private void GetShareUserLink(Sites Site, long uid)
        {
            if (this.ShareService == null) return;
            if (uid <= 0) return;

            this.ShareService.GetData(res =>
            {
                var result = res as ShareResult;

                if (result.Ret == 0)
                {
                    this.DoShare(Site, result.PicUrl, result.Content, result.Url);
                }
            }, new ShareParam
            {
                ShareUid = uid,
                tpName = "qq"
            }, TagType.user);
        }
        /// <summary>
        /// 登録
        /// </summary>
        /// <param name="filePath"></param>
        /// <param name="searchWord"></param>
        public TagInfo Regist(string filePath, string searchWord, Sites site)
        {
            TagInfo tag = GetHelper(site).GetItem(searchWord);

            using (TagLib.File file = TagLib.File.Create(filePath)) {
                file.Tag.Title = tag.Title;
                file.Tag.Performers = tag.Casts;
                file.Tag.Album = tag.Series;
                file.Tag.Composers = tag.Makers;
                file.Tag.AlbumArtists = tag.Labels;
                file.Tag.Genres = tag.Genres;
                file.Tag.Comment = tag.Comment;
                file.Tag.Lyrics = tag.CenAvId;
                file.Tag.Disc = tag.Number;
                file.Tag.Pictures = tag.Pictures;
                file.Save();
            };
            return tag;
        }
 protected override void OnLoad(EventArgs e)
 {
     if (!base.IsPostBack)
     {
         new FirstUrl().Save();
     }
     try
     {
         PlaceHolder holder = this.Page.FindControl("phHead") as PlaceHolder;
         if (holder != null)
         {
             UserControl child = this.Page.LoadControl("~/Home/Room/UserControls/WebHead.ascx") as UserControl;
             holder.Controls.Add(child);
         }
         PlaceHolder holder2 = this.Page.FindControl("phFoot") as PlaceHolder;
         if (holder2 != null)
         {
             UserControl control2 = this.Page.LoadControl("~/Home/Room/UserControls/WebFoot.ascx") as UserControl;
             holder2.Controls.Add(control2);
         }
     }
     catch
     {
     }
     if (this.CacheSeconds > 0)
     {
         base.Response.Cache.SetExpires(DateTime.Now.AddSeconds((double)this.CacheSeconds));
         base.Response.Cache.SetCacheability(HttpCacheability.Server);
         base.Response.Cache.VaryByParams["*"] = true;
         base.Response.Cache.SetValidUntilExpires(true);
         base.Response.Cache.SetVaryByCustom("SitePage");
     }
     this._Site = new Sites()[1L];
     if (this._Site == null)
     {
         PF.GoError(1, "域名无效,限制访问", base.GetType().FullName);
     }
     else
     {
         this.PageUrl = base.Request.Url.AbsoluteUri;
         base.OnLoad(e);
     }
 }
Exemplo n.º 31
0
 public ImportSiteModel FindSiteById(int id)
 => Sites.First(s => id.Equals(s.Id));
Exemplo n.º 32
0
 public bool RemoveSite(ImportSiteModel site)
 {
     return(Sites.Remove(site));
 }