You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(226) |
Nov
(90) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(20) |
May
(29) |
Jun
(22) |
Jul
(13) |
Aug
(6) |
Sep
(21) |
Oct
(4) |
Nov
(160) |
Dec
|
2006 |
Jan
|
Feb
(79) |
Mar
(11) |
Apr
(1) |
May
|
Jun
(73) |
Jul
(261) |
Aug
(83) |
Sep
(50) |
Oct
(52) |
Nov
|
Dec
(67) |
2007 |
Jan
(87) |
Feb
(36) |
Mar
(31) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2011 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2013 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jaben C. <ja...@us...> - 2007-03-20 09:01:16
|
Update of /cvsroot/yafdotnet/yafsrc/pages In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5880/yafsrc/pages Modified Files: Tag: v1_0_2_NETv2 ForumPage.cs Log Message: Minor--cleaned up email send Index: ForumPage.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/Attic/ForumPage.cs,v retrieving revision 1.76.2.17 retrieving revision 1.76.2.18 diff -C2 -d -r1.76.2.17 -r1.76.2.18 *** ForumPage.cs 20 Oct 2006 09:18:05 -0000 1.76.2.17 --- ForumPage.cs 20 Mar 2007 09:01:10 -0000 1.76.2.18 *************** *** 252,278 **** if ( ( int ) m_pageinfo ["MailsPending"] > 0 ) { ! try { ! using ( DataTable dt = DB.mail_list() ) { ! for ( int i = 0; i < dt.Rows.Count; i++ ) { ! // Build a MailMessage ! if ( dt.Rows [i] ["ToUser"].ToString().Trim() != String.Empty ) { ! Utils.SendMail( this, BoardSettings.ForumEmail, ( string ) dt.Rows [i] ["ToUser"], ( string ) dt.Rows [i] ["Subject"], ( string ) dt.Rows [i] ["Body"] ); } ! DB.mail_delete( dt.Rows [i] ["MailID"] ); } if ( IsAdmin ) this.AddAdminMessage( "Sent Mail", String.Format( "Sent {0} mails.", dt.Rows.Count ) ); } } ! catch ( Exception x ) { ! DB.eventlog_create( PageUserID, this, x ); ! if ( IsAdmin ) ! { ! this.AddAdminMessage( "Error sending emails to users", x.ToString() ); ! } } } --- 252,317 ---- if ( ( int ) m_pageinfo ["MailsPending"] > 0 ) { ! SendMailThread(); ! } ! } ! ! private void SendMailThread() ! { ! try ! { ! System.Net.Mail.SmtpClient smtpSend = new System.Net.Mail.SmtpClient( BoardSettings.SmtpServer ); ! // short timeout... ! smtpSend.Timeout = 10000; ! ! if ( BoardSettings.SmtpUserName != null && BoardSettings.SmtpUserPass != null ) { ! smtpSend.Credentials = new System.Net.NetworkCredential( BoardSettings.SmtpUserName, BoardSettings.SmtpUserPass ); ! } ! ! using ( DataTable dt = DB.mail_list() ) ! { ! for ( int i = 0; i < dt.Rows.Count; i++ ) { ! // Build a MailMessage ! if ( dt.Rows [i] ["ToUser"].ToString().Trim() != String.Empty ) { ! try { ! using ( System.Net.Mail.MailMessage emailMessage = new System.Net.Mail.MailMessage() ) ! { ! emailMessage.To.Add( dt.Rows [i] ["ToUser"].ToString() ); ! emailMessage.From = new System.Net.Mail.MailAddress( BoardSettings.ForumEmail ); ! emailMessage.Subject = dt.Rows [i] ["Subject"].ToString(); ! emailMessage.Body = dt.Rows [i] ["Body"].ToString(); ! ! if ( !System.Text.RegularExpressions.Regex.IsMatch( emailMessage.Body, @"^([0-9a-z!@#\$\%\^&\*\(\)\-=_\+])", System.Text.RegularExpressions.RegexOptions.IgnoreCase ) || ! !System.Text.RegularExpressions.Regex.IsMatch( emailMessage.Subject, @"^([0-9a-z!@#\$\%\^&\*\(\)\-=_\+])", System.Text.RegularExpressions.RegexOptions.IgnoreCase ) ) ! { ! emailMessage.BodyEncoding = Encoding.UTF8; ! } ! ! smtpSend.Send( emailMessage ); ! } } ! catch ( System.FormatException ) ! { ! // we still want to continue and delete ! } ! catch ! { ! throw; ! } } + DB.mail_delete( dt.Rows [i] ["MailID"] ); if ( IsAdmin ) this.AddAdminMessage( "Sent Mail", String.Format( "Sent {0} mails.", dt.Rows.Count ) ); } } ! } ! catch ( Exception x ) ! { ! DB.eventlog_create( PageUserID, this, x ); ! if ( IsAdmin ) { ! this.AddAdminMessage( "Error sending emails to users", x.ToString() ); } } |
From: Jaben C. <ja...@us...> - 2007-03-20 08:59:19
|
Update of /cvsroot/yafdotnet/yafsrc/controls In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5328/yafsrc/controls Modified Files: Tag: v1_0_2_NETv2 Pager.cs Log Message: modified so it doesn't use post-backs anymore Index: Pager.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/controls/Attic/Pager.cs,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** Pager.cs 1 Jul 2006 11:02:20 -0000 1.4.2.1 --- Pager.cs 20 Mar 2007 08:59:18 -0000 1.4.2.2 *************** *** 10,57 **** public class Pager : BaseControl, System.Web.UI.IPostBackEventHandler { public Pager() { ! this.Load += new EventHandler(Pager_Load); } ! private void Pager_Load(object sender,EventArgs e) { } ! protected override void Render(HtmlTextWriter output) { ! if(LinkedPager!=null) { ! Pager linkedPager = (Pager)Parent.FindControl(LinkedPager); ! if(linkedPager==null) ! throw new Exception(string.Format("Failed to link pager to '{0}'.",LinkedPager)); ! linkedPager.Render(output); return; } - - if(PageCount<2) return; ! output.WriteLine("<span>"); ! output.WriteLine("{0:N0} pages:",PageCount); int iStart = CurrentPageIndex - 6; int iEnd = CurrentPageIndex + 7; ! if(iStart<0) iStart = 0; ! if(iEnd>PageCount) iEnd = PageCount; ! if(iStart>0) ! output.WriteLine("<a href=\"{0}\">First</a> ...",Page.ClientScript.GetPostBackClientHyperlink(this,"0")); ! for(int i=iStart;i<iEnd;i++) { ! if(i==CurrentPageIndex) ! output.WriteLine("[{0}]",i+1); else output.WriteLine( "<a href=\"{0}\">{1}</a>", Page.ClientScript.GetPostBackClientHyperlink( this, i.ToString() ), i + 1 ); } ! if(iEnd<PageCount) output.WriteLine( "... <a href=\"{0}\">Last</a>", Page.ClientScript.GetPostBackClientHyperlink( this, ( PageCount - 1 ).ToString() ) ); ! output.WriteLine("</span>"); } --- 10,134 ---- public class Pager : BaseControl, System.Web.UI.IPostBackEventHandler { + private bool usePostBack = false; + public Pager() { ! this.Load += new EventHandler( Pager_Load ); } ! private void Pager_Load( object sender, EventArgs e ) { } ! protected override void Render( HtmlTextWriter output ) { ! if ( LinkedPager != null ) { ! Pager linkedPager = ( Pager ) Parent.FindControl( LinkedPager ); ! if ( linkedPager == null ) ! throw new Exception( string.Format( "Failed to link pager to '{0}'.", LinkedPager ) ); ! linkedPager.Render( output ); return; } ! if ( PageCount < 2 ) return; ! ! output.WriteLine( "<span>" ); ! output.WriteLine( "{0:N0} pages:", PageCount ); ! ! if ( UsePostBack ) OutputPostback( output ); ! else OutputLinked( output ); ! ! output.WriteLine( "</span>" ); ! } ! ! private void OutputPostback( HtmlTextWriter output ) ! { int iStart = CurrentPageIndex - 6; int iEnd = CurrentPageIndex + 7; ! if ( iStart < 0 ) iStart = 0; ! if ( iEnd > PageCount ) iEnd = PageCount; ! if ( iStart > 0 ) ! output.WriteLine( "<a href=\"{0}\">First</a> ...", Page.ClientScript.GetPostBackClientHyperlink( this, "0" ) ); ! for ( int i = iStart; i < iEnd; i++ ) { ! if ( i == CurrentPageIndex ) ! output.WriteLine( "[{0}]", i + 1 ); else output.WriteLine( "<a href=\"{0}\">{1}</a>", Page.ClientScript.GetPostBackClientHyperlink( this, i.ToString() ), i + 1 ); } ! if ( iEnd < PageCount ) output.WriteLine( "... <a href=\"{0}\">Last</a>", Page.ClientScript.GetPostBackClientHyperlink( this, ( PageCount - 1 ).ToString() ) ); + } ! private void OutputLinked( HtmlTextWriter output ) ! { ! int iStart = CurrentPageIndex - 6; ! int iEnd = CurrentPageIndex + 7; ! if ( iStart < 0 ) iStart = 0; ! if ( iEnd > PageCount ) iEnd = PageCount; ! ! if ( iStart > 0 ) ! output.WriteLine( "<a href=\"{0}\">First</a> ...", GetPageURL(0) ); ! ! for ( int i = iStart; i < iEnd; i++ ) ! { ! if ( i == CurrentPageIndex ) ! output.WriteLine( "[{0}]", i + 1 ); ! else ! output.WriteLine( "<a href=\"{0}\">{1}</a>", GetPageURL( i+1 ), i + 1 ); ! } ! ! if ( iEnd < PageCount ) ! output.WriteLine( "... <a href=\"{0}\">Last</a>", GetPageURL(PageCount - 1) ); ! } ! ! protected string GetPageURL(int page) ! { ! string url = ""; ! ! // create proper query string... ! SimpleURLParameterParser parser = new SimpleURLParameterParser( System.Web.HttpContext.Current.Request.QueryString.ToString() ); ! ! // get the current page ! Pages currentPage = (Pages) Enum.Parse(typeof(Pages),parser["g"],true); ! ! if ( parser ["m"] != null ) ! { ! // must be converted to by topic... ! parser.Parameters.Remove( "m" ); ! parser.Parameters.Add( "t", ForumPage.PageTopicID.ToString() ); ! } ! ! if ( page > 1 ) ! { ! string tmp = parser.CreateQueryString( new string [] { "g", "p" } ); ! if (tmp.Length > 0) tmp += "&"; ! ! tmp += "p={0}"; ! ! url = Forum.GetLink( currentPage, tmp, page ); ! } ! else ! { ! url = Forum.GetLink( currentPage, parser.CreateQueryString( new string [] { "g", "p" } ) ); ! } ! ! return url; ! } ! ! public bool UsePostBack ! { ! get ! { ! return usePostBack; ! } ! set ! { ! usePostBack = value; ! } } *************** *** 60,65 **** get { ! if(ViewState["Count"]!=null) ! return (int)ViewState["Count"]; else return 0; --- 137,142 ---- get { ! if ( ViewState ["Count"] != null ) ! return ( int ) ViewState ["Count"]; else return 0; *************** *** 67,71 **** set { ! ViewState["Count"] = value; } } --- 144,148 ---- set { ! ViewState ["Count"] = value; } } *************** *** 75,80 **** get { ! if(ViewState["CurrentPageIndex"]!=null) ! return (int)ViewState["CurrentPageIndex"]; else return 0; --- 152,157 ---- get { ! if ( ViewState ["CurrentPageIndex"] != null ) ! return ( int ) ViewState ["CurrentPageIndex"]; else return 0; *************** *** 82,86 **** set { ! ViewState["CurrentPageIndex"] = value; } } --- 159,163 ---- set { ! ViewState ["CurrentPageIndex"] = value; } } *************** *** 90,95 **** get { ! if(ViewState["PageSize"]!=null) ! return (int)ViewState["PageSize"]; else return 20; --- 167,172 ---- get { ! if ( ViewState ["PageSize"] != null ) ! return ( int ) ViewState ["PageSize"]; else return 20; *************** *** 97,101 **** set { ! ViewState["PageSize"] = value; } } --- 174,178 ---- set { ! ViewState ["PageSize"] = value; } } *************** *** 105,109 **** get { ! return (int)Math.Ceiling((double)Count/PageSize); } } --- 182,186 ---- get { ! return ( int ) Math.Ceiling( ( double ) Count / PageSize ); } } *************** *** 113,121 **** get { ! return (string)ViewState["LinkedPager"]; } set { ! ViewState["LinkedPager"] = value; } } --- 190,198 ---- get { ! return ( string ) ViewState ["LinkedPager"]; } set { ! ViewState ["LinkedPager"] = value; } } *************** *** 124,133 **** public event EventHandler PageChange; ! public void RaisePostBackEvent(string eventArgument) { ! if(PageChange!=null) { ! CurrentPageIndex = int.Parse(eventArgument); ! PageChange(this,new EventArgs()); } } --- 201,210 ---- public event EventHandler PageChange; ! public void RaisePostBackEvent( string eventArgument ) { ! if ( PageChange != null ) { ! CurrentPageIndex = int.Parse( eventArgument ); ! PageChange( this, new EventArgs() ); } } |
From: Jaben C. <ja...@us...> - 2007-03-20 08:59:14
|
Update of /cvsroot/yafdotnet/yafsrc/classes In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4832/yafsrc/classes Modified Files: Tag: v1_0_2_NETv2 URLBuilderRewrite.cs Utils.cs Log Message: Refined URL rewriting added search-engine friendly pagination stuff. Index: URLBuilderRewrite.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/classes/Attic/URLBuilderRewrite.cs,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** URLBuilderRewrite.cs 8 Feb 2007 00:49:08 -0000 1.1.2.1 --- URLBuilderRewrite.cs 20 Mar 2007 08:58:18 -0000 1.1.2.2 *************** *** 12,108 **** namespace yaf { - - public class SimpleURLParameterParser - { - private string _urlParameters = ""; - private string _urlAnchor = ""; - private NameValueCollection _nameValues = new NameValueCollection(); - - public SimpleURLParameterParser( string urlParameters ) - { - _urlParameters = urlParameters; - ParseURLParameters(); - } - - private void ParseURLParameters() - { - string urlTemp = _urlParameters; - int index; - - // get the url end anchor (#blah) if there is one... - _urlAnchor = ""; - index = urlTemp.LastIndexOf( '#' ); - - if ( index > 0 ) - { - // there's an anchor - _urlAnchor = urlTemp.Substring( index+1 ); - // remove the anchor from the url... - urlTemp = urlTemp.Remove( index ); - } - - _nameValues.Clear(); - string [] arrayPairs = urlTemp.Split( new char [] { '&' } ); - - foreach ( string tValue in arrayPairs ) - { - if ( tValue.Trim().Length > 0 ) - { - // parse... - string [] nvalue = tValue.Trim().Split( new char [] { '=' } ); - _nameValues.Add( nvalue [0], nvalue [1] ); - } - } - } - - public string Anchor - { - get - { - return _urlAnchor; - } - } - - public bool HasAnchor - { - get - { - return ( _urlAnchor != "" ); - } - } - - public NameValueCollection Parameters - { - get - { - return _nameValues; - } - } - - public int Count - { - get - { - return _nameValues.Count; - } - } - - public string this[string name] - { - get - { - return _nameValues[name]; - } - } - - public string this [int index] - { - get - { - return _nameValues [index]; - } - } - } - public class RewriteUrlBuilder : yaf.IUrlBuilder { --- 12,15 ---- *************** *** 112,118 **** string newURL = string.Format( "{0}?{1}", scriptname, url ); ! if ( scriptname.EndsWith("default.aspx") ) { ! string before = scriptname.Remove( scriptname.LastIndexOf( "default.aspx" ) ); SimpleURLParameterParser parser = new SimpleURLParameterParser( url ); --- 19,25 ---- string newURL = string.Format( "{0}?{1}", scriptname, url ); ! if ( scriptname.EndsWith(".aspx") ) { ! string before = ""; SimpleURLParameterParser parser = new SimpleURLParameterParser( url ); *************** *** 123,126 **** --- 30,34 ---- string useKey = ""; string pageName = parser ["g"]; + string pageNameExtension = string.Empty; bool showKey = false; *************** *** 131,134 **** --- 39,52 ---- if ( parser ["t"] != null ) { useKey = "t"; pageName += "bytopic"; } else if ( parser ["m"] != null ) { useKey = "m"; pageName += "bymessage"; } + if ( parser ["p"] != null ) + { + int page = Convert.ToInt32( parser ["p"] ); + if ( page != 1 ) + { + pageNameExtension = "--p" + page.ToString(); + } + // remove the page + parser.Parameters.Remove( "p" ); + } break; case "profile": useKey = "u"; break; *************** *** 140,144 **** newURL += pageName; ! if (useKey.Length > 0) { if ( !showKey ) --- 58,62 ---- newURL += pageName; ! if ( useKey.Length > 0 ) { if ( !showKey ) *************** *** 148,168 **** } ! newURL += ".aspx"; ! string restURL = ""; ! bool bFirst = true; ! // create url parameters... ! for ( int i = 0; i < parser.Count; i++ ) ! { ! string key = parser.Parameters.Keys [i].ToLower(); ! string value = parser[i]; ! if ( key != "g" && key != useKey ) ! { ! if (bFirst) bFirst = false; ! else restURL += "&"; ! restURL += key + "=" + value; ! } ! } // append to the url if there are additional (unsupported) parameters --- 66,74 ---- } ! if ( pageNameExtension != string.Empty ) newURL += pageNameExtension; ! newURL += ".aspx"; ! string restURL = parser.CreateQueryString( new string [] { "g", useKey } ); // append to the url if there are additional (unsupported) parameters Index: Utils.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/classes/Attic/Utils.cs,v retrieving revision 1.34.2.6 retrieving revision 1.34.2.7 diff -C2 -d -r1.34.2.6 -r1.34.2.7 *** Utils.cs 9 Oct 2006 12:42:25 -0000 1.34.2.6 --- Utils.cs 20 Mar 2007 08:58:18 -0000 1.34.2.7 *************** *** 374,376 **** --- 374,497 ---- } } + + public class SimpleURLParameterParser + { + private string _urlParameters = ""; + private string _urlAnchor = ""; + private NameValueCollection _nameValues = new NameValueCollection(); + + public SimpleURLParameterParser( string urlParameters ) + { + _urlParameters = urlParameters; + ParseURLParameters(); + } + + private void ParseURLParameters() + { + string urlTemp = _urlParameters; + int index; + + // get the url end anchor (#blah) if there is one... + _urlAnchor = ""; + index = urlTemp.LastIndexOf( '#' ); + + if ( index > 0 ) + { + // there's an anchor + _urlAnchor = urlTemp.Substring( index + 1 ); + // remove the anchor from the url... + urlTemp = urlTemp.Remove( index ); + } + + _nameValues.Clear(); + string [] arrayPairs = urlTemp.Split( new char [] { '&' } ); + + foreach ( string tValue in arrayPairs ) + { + if ( tValue.Trim().Length > 0 ) + { + // parse... + string [] nvalue = tValue.Trim().Split( new char [] { '=' } ); + _nameValues.Add( nvalue [0], nvalue [1] ); + } + } + } + + public string CreateQueryString(string [] excludeValues) + { + string queryString = ""; + bool bFirst = true; + + for ( int i = 0; i < _nameValues.Count; i++ ) + { + string key = _nameValues.Keys [i].ToLower(); + string value = _nameValues [i]; + if ( !KeyInsideArray(excludeValues,key) ) + { + if ( bFirst ) bFirst = false; + else queryString += "&"; + queryString += key + "=" + value; + } + } + + return queryString; + } + + private bool KeyInsideArray( string [] array, string key ) + { + foreach ( string tmp in array ) + { + if ( tmp.Equals( key ) ) return true; + } + return false; + } + + public string Anchor + { + get + { + return _urlAnchor; + } + } + + public bool HasAnchor + { + get + { + return ( _urlAnchor != "" ); + } + } + + public NameValueCollection Parameters + { + get + { + return _nameValues; + } + } + + public int Count + { + get + { + return _nameValues.Count; + } + } + + public string this [string name] + { + get + { + return _nameValues [name]; + } + } + + public string this [int index] + { + get + { + return _nameValues [index]; + } + } + } } |
From: Jaben C. <ja...@us...> - 2007-03-19 11:43:26
|
Update of /cvsroot/yafdotnet/yafsrc/pages In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15779/pages Modified Files: login.ascx.cs register.ascx register.ascx.cs Log Message: Localized membership login and registration systems... Index: register.ascx.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/register.ascx.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** register.ascx.cs 13 Mar 2007 09:38:47 -0000 1.20 --- register.ascx.cs 19 Mar 2007 11:42:18 -0000 1.21 *************** *** 55,58 **** --- 55,76 ---- PageLinks.AddLink( GetText("TITLE") ); + Control createUserTemplateRef = CreateUserWizard1.CreateUserStep.ContentTemplateContainer; + + CompareValidator passwordNoMatch = ( CompareValidator ) createUserTemplateRef.FindControl( "PasswordCompare" ); + RequiredFieldValidator usernameRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "UserNameRequired" ); + RequiredFieldValidator passwordRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "PasswordRequired" ); + RequiredFieldValidator confirmPasswordRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "ConfirmPasswordRequired" ); + RequiredFieldValidator emailRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "EmailRequired" ); + RequiredFieldValidator questionRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "QuestionRequired" ); + RequiredFieldValidator answerRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "AnswerRequired" ); + + usernameRequired.ToolTip = usernameRequired.ErrorMessage = GetText( "NEED_USERNAME" ); + passwordRequired.ToolTip = passwordRequired.ErrorMessage = GetText( "NEED_PASSWORD" ); + confirmPasswordRequired.ToolTip = confirmPasswordRequired.ErrorMessage = GetText( "RETYPE_PASSWORD" ); + passwordNoMatch.ToolTip = passwordNoMatch.ErrorMessage = GetText( "NEED_MATCH" ); + emailRequired.ToolTip = emailRequired.ErrorMessage = GetText( "NEED_EMAIL" ); + questionRequired.ToolTip = questionRequired.ErrorMessage = GetText( "NEED_QUESTION" ); + answerRequired.ToolTip = answerRequired.ErrorMessage = GetText( "NEED_ANSWER" ); + DataBind(); } *************** *** 71,74 **** --- 89,93 ---- protected void CreateUserWizard1_PreviousButtonClick( object sender, WizardNavigationEventArgs e ) { + // if they clicked declined, redirect to the main page if ( e.CurrentStepIndex == 0 ) { *************** *** 76,79 **** --- 95,143 ---- } } + + protected void CreateUserWizard1_CreateUserError( object sender, CreateUserErrorEventArgs e ) + { + string createUserError = ""; + // find the type of error + switch ( e.CreateUserError ) + { + case MembershipCreateStatus.DuplicateEmail: + createUserError = GetText( "ALREADY_REGISTERED" ); + break; + case MembershipCreateStatus.DuplicateUserName: + createUserError = GetText( "ALREADY_REGISTERED" ); + break; + case MembershipCreateStatus.InvalidEmail: + createUserError = GetText( "BAD_EMAIL" ); + break; + case MembershipCreateStatus.InvalidPassword: + createUserError = GetText( "BAD_PASSWORD" ); + break; + case MembershipCreateStatus.InvalidQuestion: + createUserError = GetText( "INVALID_QUESTION" ); + break; + case MembershipCreateStatus.InvalidUserName: + createUserError = GetText( "INVALID_USERNAME" ); + break; + case MembershipCreateStatus.InvalidAnswer: + createUserError = GetText( "INVALID_ANSWER" ); + break; + case MembershipCreateStatus.InvalidProviderUserKey: + createUserError = "Invalid provider user key."; + break; + case MembershipCreateStatus.DuplicateProviderUserKey: + createUserError = "Duplicate provider user key."; + break; + case MembershipCreateStatus.ProviderError: + createUserError = "Provider Error"; + break; + case MembershipCreateStatus.UserRejected: + createUserError = "User creation failed: Reason is defined by the provider."; + break; + } + //Display the failure message in a client-side alert box + Page.ClientScript.RegisterStartupScript( Page.GetType(), "CreateUserError", String.Format( "alert('{0}');", createUserError.Replace( "'", "\'" ) ), true ); + + } } } Index: login.ascx.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/login.ascx.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** login.ascx.cs 13 Mar 2007 09:38:47 -0000 1.27 --- login.ascx.cs 19 Mar 2007 11:42:18 -0000 1.28 *************** *** 65,68 **** --- 65,73 ---- Button forumLogin = ( Button ) Login1.FindControl( "LoginButton" ); HyperLink passwordRecovery = ( HyperLink ) Login1.FindControl( "PasswordRecovery" ); + RequiredFieldValidator usernameRequired = ( RequiredFieldValidator ) Login1.FindControl( "UsernameRequired" ); + RequiredFieldValidator passwordRequired = ( RequiredFieldValidator ) Login1.FindControl( "PasswordRequired" ); + + usernameRequired.ToolTip = usernameRequired.ErrorMessage = GetText( "REGISTER", "NEED_USERNAME" ); + passwordRequired.ToolTip = passwordRequired.ErrorMessage = GetText( "REGISTER", "NEED_PASSWORD" ); rememberMe.Text = GetText( "auto" ); Index: register.ascx =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/register.ascx,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** register.ascx 13 Mar 2007 09:38:47 -0000 1.11 --- register.ascx 19 Mar 2007 11:42:18 -0000 1.12 *************** *** 7,11 **** <div align="center"> <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" LoginCreatedUser="False" StartNextButtonText="Agree" StartNextButtonType="Link" ! OnPreviousButtonClick="CreateUserWizard1_PreviousButtonClick"> <WizardSteps> <asp:TemplatedWizardStep runat="server" StepType="Start" Title="Agreement" AllowReturn="False"> --- 7,11 ---- <div align="center"> <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" LoginCreatedUser="False" StartNextButtonText="Agree" StartNextButtonType="Link" ! OnPreviousButtonClick="CreateUserWizard1_PreviousButtonClick" OnCreateUserError="CreateUserWizard1_CreateUserError"> <WizardSteps> <asp:TemplatedWizardStep runat="server" StepType="Start" Title="Agreement" AllowReturn="False"> *************** *** 57,61 **** </tr> <tr> ! <td align="center" class="post" colspan="2"><asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"/> <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match." ValidationGroup="CreateUserWizard1"></asp:CompareValidator> --- 57,61 ---- </tr> <tr> ! <td align="center" class="post" colspan="2"> <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match." ValidationGroup="CreateUserWizard1"></asp:CompareValidator> |
From: Jaben C. <ja...@us...> - 2007-03-14 19:20:02
|
Update of /cvsroot/yafdotnet/yafsrc/YAF.Classes/YAF.Classes.Utils/Localization In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9033/YAF.Classes/YAF.Classes.Utils/Localization Modified Files: Localization.cs Log Message: fixes Index: Localization.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/YAF.Classes/YAF.Classes.Utils/Localization/Localization.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Localization.cs 26 Jan 2007 12:08:14 -0000 1.2 --- Localization.cs 14 Mar 2007 19:19:07 -0000 1.3 *************** *** 38,42 **** } ! public yaf_Localization( string transPage ) { TransPage = transPage; --- 38,42 ---- } ! public yaf_Localization( string transPage ) : this() { TransPage = transPage; *************** *** 50,57 **** get { ! if ( m_transPage != null ) ! return m_transPage; ! throw new ApplicationException( string.Format( "Missing TransPage property for {0}", GetType() ) ); } set --- 50,57 ---- get { ! //if ( m_transPage != null ) ! return m_transPage; ! //throw new ApplicationException( string.Format( "Missing TransPage property for {0}", GetType() ) ); } set |
From: Jaben C. <ja...@us...> - 2007-03-14 19:20:02
|
Update of /cvsroot/yafdotnet/yafsrc/YAF.Classes/YAF.Classes.Utils In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9033/YAF.Classes/YAF.Classes.Utils Modified Files: Context.cs StaticData.cs Log Message: fixes Index: Context.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/YAF.Classes/YAF.Classes.Utils/Context.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Context.cs 31 Jan 2007 13:38:08 -0000 1.4 --- Context.cs 14 Mar 2007 19:19:07 -0000 1.5 *************** *** 648,652 **** public static class yaf_ForumInfo { ! public static string ForumRoot { get --- 648,652 ---- public static class yaf_ForumInfo { ! static public string ForumRoot { get Index: StaticData.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/YAF.Classes/YAF.Classes.Utils/StaticData.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StaticData.cs 26 Jan 2007 12:08:14 -0000 1.2 --- StaticData.cs 14 Mar 2007 19:19:07 -0000 1.3 *************** *** 141,145 **** { DataRow dr = dt.NewRow(); ! dr ["TopicText"] = ( yaf_Context.Current.Localization == null ) ? tTextArrayProp [i] : yaf_Context.Current.Localization.GetText( tTextArray [i] ); dr ["TopicValue"] = i; dt.Rows.Add( dr ); --- 141,145 ---- { DataRow dr = dt.NewRow(); ! dr ["TopicText"] = ( yaf_Context.Current.Localization.TransPage == null ) ? tTextArrayProp [i] : yaf_Context.Current.Localization.GetText( tTextArray [i] ); dr ["TopicValue"] = i; dt.Rows.Add( dr ); |
From: Jaben C. <ja...@us...> - 2007-03-14 19:19:36
|
Update of /cvsroot/yafdotnet/yafsrc/pages/admin In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8969/pages/admin Modified Files: attachments.ascx boardsettings.ascx.cs smilies.ascx smilies.ascx.designer.cs Log Message: Fixes Index: boardsettings.ascx.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/admin/boardsettings.ascx.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** boardsettings.ascx.cs 19 Jan 2007 13:16:17 -0000 1.16 --- boardsettings.ascx.cs 14 Mar 2007 19:18:30 -0000 1.17 *************** *** 31,35 **** using YAF.Classes.Data; ! namespace YAF.Pages.Admin { /// <summary> /// Summary description for settings. --- 31,36 ---- using YAF.Classes.Data; ! namespace YAF.Pages.Admin ! { /// <summary> /// Summary description for settings. *************** *** 37,48 **** public partial class boardsettings : YAF.Classes.Base.AdminPage { ! ! protected void Page_Load(object sender, System.EventArgs e) { ! if(!IsPostBack) { ! PageLinks.AddLink(PageContext.BoardSettings.Name,YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.forum)); ! PageLinks.AddLink("Administration",YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.admin_admin)); ! PageLinks.AddLink("Board Settings",""); // create list boxes by populating datasources from Data class --- 38,49 ---- public partial class boardsettings : YAF.Classes.Base.AdminPage { ! ! protected void Page_Load( object sender, System.EventArgs e ) { ! if ( !IsPostBack ) { ! PageLinks.AddLink( PageContext.BoardSettings.Name, YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.forum ) ); ! PageLinks.AddLink( "Administration", YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.admin_admin ) ); ! PageLinks.AddLink( "Board Settings", "" ); // create list boxes by populating datasources from Data class *************** *** 60,68 **** BindData(); ! ! Theme.Items.FindByValue(PageContext.BoardSettings.Theme).Selected = true; ! Language.Items.FindByValue(PageContext.BoardSettings.Language).Selected = true; ! ShowTopic.Items.FindByValue(PageContext.BoardSettings.ShowTopicsDefault.ToString()).Selected = true; ! AllowThemedLogo.Checked = PageContext.BoardSettings.AllowThemedLogo; } } --- 61,69 ---- BindData(); ! ! Theme.Items.FindByValue( PageContext.BoardSettings.Theme ).Selected = true; ! Language.Items.FindByValue( PageContext.BoardSettings.Language ).Selected = true; ! ShowTopic.Items.FindByValue( PageContext.BoardSettings.ShowTopicsDefault.ToString() ).Selected = true; ! AllowThemedLogo.Checked = PageContext.BoardSettings.AllowThemedLogo; } } *************** *** 71,84 **** { DataRow row; ! using(DataTable dt = YAF.Classes.Data.DB.board_list(PageContext.PageBoardID)) ! row = dt.Rows[0]; DataBind(); ! Name.Text = (string)row["Name"]; ! AllowThreaded.Checked = (bool)row["AllowThreaded"]; } #region Web Form Designer generated code ! override protected void OnInit(EventArgs e) { // --- 72,85 ---- { DataRow row; ! using ( DataTable dt = YAF.Classes.Data.DB.board_list( PageContext.PageBoardID ) ) ! row = dt.Rows [0]; DataBind(); ! Name.Text = ( string ) row ["Name"]; ! AllowThreaded.Checked = ( bool ) row ["AllowThreaded"]; } #region Web Form Designer generated code ! override protected void OnInit( EventArgs e ) { // *************** *** 86,92 **** // InitializeComponent(); ! base.OnInit(e); } ! /// <summary> /// Required method for Designer support - do not modify --- 87,93 ---- // InitializeComponent(); ! base.OnInit( e ); } ! /// <summary> /// Required method for Designer support - do not modify *************** *** 94,110 **** /// </summary> private void InitializeComponent() ! { } #endregion ! protected void Save_Click(object sender, System.EventArgs e) { ! YAF.Classes.Data.DB.board_save(PageContext.PageBoardID, Name.Text, AllowThreaded.Checked); PageContext.BoardSettings.Theme = Theme.SelectedValue; PageContext.BoardSettings.Language = Language.SelectedValue; ! PageContext.BoardSettings.ShowTopicsDefault = Convert.ToInt32(ShowTopic.SelectedValue); ! PageContext.BoardSettings.AllowThemedLogo = AllowThemedLogo.Checked; /// save the settings to the database PageContext.BoardSettings.SaveRegistry(); --- 95,111 ---- /// </summary> private void InitializeComponent() ! { } #endregion ! protected void Save_Click( object sender, System.EventArgs e ) { ! YAF.Classes.Data.DB.board_save( PageContext.PageBoardID, Name.Text, AllowThreaded.Checked ); PageContext.BoardSettings.Theme = Theme.SelectedValue; PageContext.BoardSettings.Language = Language.SelectedValue; ! PageContext.BoardSettings.ShowTopicsDefault = Convert.ToInt32( ShowTopic.SelectedValue ); ! PageContext.BoardSettings.AllowThemedLogo = AllowThemedLogo.Checked; /// save the settings to the database PageContext.BoardSettings.SaveRegistry(); *************** *** 113,117 **** PageContext.BoardSettings = null; ! YAF.Classes.Utils.yaf_BuildLink.Redirect( YAF.Classes.Utils.ForumPages.admin_admin); } } --- 114,118 ---- PageContext.BoardSettings = null; ! YAF.Classes.Utils.yaf_BuildLink.Redirect( YAF.Classes.Utils.ForumPages.admin_admin ); } } Index: smilies.ascx.designer.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/admin/smilies.ascx.designer.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** smilies.ascx.designer.cs 21 Dec 2006 16:01:57 -0000 1.3 --- smilies.ascx.designer.cs 14 Mar 2007 19:18:30 -0000 1.4 *************** *** 2,6 **** // <auto-generated> // This code was generated by a tool. ! // Runtime Version:2.0.50727.42 // // Changes to this file may cause incorrect behavior and will be lost if --- 2,6 ---- // <auto-generated> // This code was generated by a tool. ! // Runtime Version:2.0.50727.91 // // Changes to this file may cause incorrect behavior and will be lost if Index: attachments.ascx =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/admin/attachments.ascx,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** attachments.ascx 31 Jan 2007 13:37:10 -0000 1.11 --- attachments.ascx 14 Mar 2007 19:18:30 -0000 1.12 *************** *** 1,49 **** ! <%@ Control language="c#" Codebehind="attachments.ascx.cs" AutoEventWireup="True" Inherits="YAF.Pages.Admin.attachments" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Controls" Assembly="YAF" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Classes.UI" Assembly="YAF.Classes.UI" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Classes.Utils" Assembly="YAF.Classes.Utils" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Controls" Assembly="YAF.Controls" %> ! ! <YAF:PageLinks runat="server" id="PageLinks"/> ! ! <YAF:adminmenu runat="server"> ! ! <table class=content width="100%" cellspacing=1 cellpadding=0> ! <tr> ! <td class=header1 colspan="8">Attachments</td> ! </tr> ! ! <asp:repeater runat="server" id="List"> ! <HeaderTemplate> ! <tr class="header2"> ! <td>Forum</td> ! <td>Topic</td> ! <td>Posted</td> ! <td>File Name</td> ! <td align="right">Downloads</td> ! <td>Content Type</td> ! <td align="right">Size</td> ! <td> </td> ! </tr> ! </HeaderTemplate> ! <ItemTemplate> ! <tr class=post> ! <td><a target="_top" href='<%# YAF.Classes.Utils.yaf_BuildLink.GetLink(YAF.Classes.Utils.ForumPages.topics,"f={0}",Eval("ForumID")) %>'><%# Eval("ForumName") %></a></td> ! <td><a target="_top" href='<%# YAF.Classes.Utils.yaf_BuildLink.GetLink(YAF.Classes.Utils.ForumPages.posts,"t={0}",Eval("TopicID")) %>'><%# Eval("TopicName") %></a></td> ! <td><%# FormatDateTimeShort(Eval( "Posted")) %></td> ! <td><%# Eval( "FileName") %></td> ! <td align="right"><%# Eval( "Downloads") %></td> ! <td><%# Eval( "ContentType") %></td> ! <td align="right"><%# Eval( "Bytes") %></td> ! <td> ! <asp:linkbutton runat="server" onload="Delete_Load" commandname="delete" commandargument='<%# Eval( "AttachmentID") %>'>Delete</asp:linkbutton> ! </td> ! </tr> ! </ItemTemplate> ! </asp:repeater> ! ! </table> ! ! </YAF:adminmenu> ! ! <YAF:SmartScroller id="SmartScroller1" runat = "server" /> --- 1,69 ---- ! <%@ Control Language="c#" Codebehind="attachments.ascx.cs" AutoEventWireup="True" Inherits="YAF.Pages.Admin.attachments" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Controls" Assembly="YAF" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Classes.UI" Assembly="YAF.Classes.UI" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Classes.Utils" Assembly="YAF.Classes.Utils" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Controls" Assembly="YAF.Controls" %> ! <YAF:PageLinks runat="server" ID="PageLinks" /> ! <YAF:AdminMenu runat="server"> ! <table class="content" width="100%" cellspacing="1" cellpadding="0"> ! <tr> ! <td class="header1" colspan="8"> ! Attachments</td> ! </tr> ! <asp:Repeater runat="server" ID="List"> ! <HeaderTemplate> ! <tr class="header2"> ! <td> ! Forum</td> ! <td> ! Topic</td> ! <td> ! Posted</td> ! <td> ! File Name</td> ! <td align="right"> ! Downloads</td> ! <td> ! Content Type</td> ! <td align="right"> ! Size</td> ! <td> ! </td> ! </tr> ! </HeaderTemplate> ! <ItemTemplate> ! <tr class="post"> ! <td> ! <a target="_top" href='<%# yaf_BuildLink.GetLink(YAF.Classes.Utils.ForumPages.topics,"f={0}",Eval("ForumID")) %>'> ! <%# Eval("ForumName") %> ! </a> ! </td> ! <td> ! <a target="_top" href='<%# yaf_BuildLink.GetLink(YAF.Classes.Utils.ForumPages.posts,"t={0}",Eval("TopicID")) %>'> ! <%# Eval("TopicName") %> ! </a> ! </td> ! <td> ! <%# yaf_DateTime.FormatDateTimeShort(Eval( "Posted")) %> ! </td> ! <td> ! <%# Eval( "FileName") %> ! </td> ! <td align="right"> ! <%# Eval( "Downloads") %> ! </td> ! <td> ! <%# Eval( "ContentType") %> ! </td> ! <td align="right"> ! <%# Eval( "Bytes") %> ! </td> ! <td> ! <asp:LinkButton runat="server" OnLoad="Delete_Load" CommandName="delete" CommandArgument='<%# Eval( "AttachmentID") %>'>Delete</asp:LinkButton> ! </td> ! </tr> ! </ItemTemplate> ! </asp:Repeater> ! </table> ! </YAF:AdminMenu> ! <YAF:SmartScroller ID="SmartScroller1" runat="server" /> Index: smilies.ascx =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/admin/smilies.ascx,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** smilies.ascx 31 Jan 2007 13:37:11 -0000 1.12 --- smilies.ascx 14 Mar 2007 19:18:30 -0000 1.13 *************** *** 30,34 **** <tr> <td class="post"><%# Eval("Code") %></td> ! <td class="post" align="center"><img src='<%# YAF.Data.ForumRoot %>images/emoticons/<%# Eval("Icon") %>'/></td> <td class="post"><%# Eval("Emoticon") %></td> <td class="post"> --- 30,34 ---- <tr> <td class="post"><%# Eval("Code") %></td> ! <td class="post" align="center"><img src="<%# yaf_ForumInfo.ForumRoot %>images/emoticons/<%# Eval("Icon") %>"/></td> <td class="post"><%# Eval("Emoticon") %></td> <td class="post"> |
From: Jaben C. <ja...@us...> - 2007-03-14 18:13:01
|
Update of /cvsroot/yafdotnet/yafsrc/pages In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24930/pages Modified Files: mod_forumuser.ascx.cs Log Message: Fixed bug Index: mod_forumuser.ascx.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/mod_forumuser.ascx.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** mod_forumuser.ascx.cs 19 Jan 2007 13:16:16 -0000 1.18 --- mod_forumuser.ascx.cs 14 Mar 2007 18:12:05 -0000 1.19 *************** *** 97,101 **** ToList.DataValueField = "UserID"; ToList.DataTextField = "Name"; ! ToList.SelectedIndex = 0; ToList.Visible = true; UserName.Visible = false; --- 97,101 ---- ToList.DataValueField = "UserID"; ToList.DataTextField = "Name"; ! //ToList.SelectedIndex = 0; ToList.Visible = true; UserName.Visible = false; |
From: Jaben C. <ja...@us...> - 2007-03-13 09:38:49
|
Update of /cvsroot/yafdotnet/yafsrc/pages In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23235/pages Modified Files: login.ascx login.ascx.cs recoverpassword.ascx recoverpassword.ascx.cs register.ascx register.ascx.cs Log Message: Integrating Membership for real in YAF. Work in progress... Index: register.ascx.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/register.ascx.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** register.ascx.cs 19 Jan 2007 13:16:16 -0000 1.19 --- register.ascx.cs 13 Mar 2007 09:38:47 -0000 1.20 *************** *** 39,71 **** public partial class register : YAF.Classes.Base.ForumPage { ! ! public register() : base("REGISTER") { } ! protected void Page_Load(object sender, System.EventArgs e) { ! if(!CanLogin || PageContext.BoardSettings.DisableRegistrations) yaf_BuildLink.AccessDenied(); ! if(!IsPostBack) { ! PageLinks.AddLink(PageContext.BoardSettings.Name,YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.forum)); } } ! override protected void OnInit(EventArgs e) { - this.Load += new System.EventHandler(this.Page_Load); - base.OnInit(e); - } - - static public string CreatePassword(int length) { string valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#%&()@${[]}"; string res = ""; Random rnd = new Random(); ! while(0<length--) ! res += valid[rnd.Next(valid.Length)]; return res; } } } --- 39,79 ---- public partial class register : YAF.Classes.Base.ForumPage { ! ! public register() ! : base( "REGISTER" ) { } ! protected void Page_Load( object sender, System.EventArgs e ) { ! if ( !CanLogin || PageContext.BoardSettings.DisableRegistrations ) yaf_BuildLink.AccessDenied(); ! if ( !IsPostBack ) ! { ! PageLinks.AddLink( PageContext.BoardSettings.Name, YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.forum ) ); ! PageLinks.AddLink( GetText("TITLE") ); ! ! DataBind(); } } ! static public string CreatePassword( int length ) { string valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#%&()@${[]}"; string res = ""; Random rnd = new Random(); ! while ( 0 < length-- ) ! res += valid [rnd.Next( valid.Length )]; return res; } + + protected void CreateUserWizard1_PreviousButtonClick( object sender, WizardNavigationEventArgs e ) + { + if ( e.CurrentStepIndex == 0 ) + { + yaf_BuildLink.Redirect( ForumPages.forum ); + } + } } } Index: login.ascx =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/login.ascx,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** login.ascx 31 Jan 2007 13:37:10 -0000 1.13 --- login.ascx 13 Mar 2007 09:38:47 -0000 1.14 *************** *** 8,55 **** <div align="center"> ! <asp:Login ID="Login1" runat="server"> <LayoutTemplate> ! <table border="0" cellpadding="1" cellspacing="0" class="content" style="border-collapse: collapse"> <tr> <td> ! <table border="0" cellpadding="0"> <tr> ! <td align="center" colspan="2"> ! Log In</td> </tr> <tr> ! <td align="right"> ! <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td> ! <td> <asp:TextBox ID="UserName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ! ToolTip="User Name is required." ValidationGroup="ctl00$Login1">*</asp:RequiredFieldValidator> </td> </tr> <tr> ! <td align="right"> ! <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td> ! <td> <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ! ToolTip="Password is required." ValidationGroup="ctl00$Login1">*</asp:RequiredFieldValidator> ! </td> ! </tr> ! <tr> ! <td colspan="2"> ! <asp:CheckBox ID="RememberMe" runat="server" Text="Remember me next time." /> </td> </tr> <tr> ! <td align="center" colspan="2" style="color: red"> ! <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal> </td> </tr> <tr> ! <td align="right" colspan="2"> ! <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="ctl00$Login1" /> </td> </tr> </table> </td> </tr> --- 8,51 ---- <div align="center"> ! <asp:Login ID="Login1" runat="server" RememberMeSet="True" OnLoggedIn="Login1_LoggedIn" OnLoginError="Login1_LoginError"> <LayoutTemplate> ! <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"> <tr> <td> ! <table border="0" cellpadding="0" class="content" width="400"> <tr> ! <td align="center" colspan="2" class="header1"><%# GetText("title") %></td> </tr> <tr> ! <td align="right" class="postheader"> ! <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName"><%# GetText("username") %></asp:Label></td> ! <td class="post"> <asp:TextBox ID="UserName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ! ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator> </td> </tr> <tr> ! <td align="right" class="postheader"> ! <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password"><%# GetText("password") %></asp:Label></td> ! <td class="post"> <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ! ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator> </td> </tr> <tr> ! <td colspan="2" class="post"> ! <asp:CheckBox ID="RememberMe" runat="server"></asp:CheckBox> </td> </tr> <tr> ! <td align="center" colspan="2" class="postfooter" style="height: 24px"> ! <asp:HyperLink ID="PasswordRecovery" runat="server" /> | ! <asp:Button ID="LoginButton" runat="server" CommandName="Login" ValidationGroup="Login1" /> </td> </tr> </table> + <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True" ValidationGroup="Login1" ShowSummary="False" /> </td> </tr> *************** *** 57,61 **** </LayoutTemplate> </asp:Login> ! </div> <YAF:SmartScroller id="SmartScroller1" runat = "server" /> --- 53,57 ---- </LayoutTemplate> </asp:Login> ! </div> <YAF:SmartScroller id="SmartScroller1" runat = "server" /> Index: recoverpassword.ascx =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/recoverpassword.ascx,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** recoverpassword.ascx 31 Jan 2007 13:37:10 -0000 1.4 --- recoverpassword.ascx 13 Mar 2007 09:38:47 -0000 1.5 *************** *** 7,11 **** --- 7,101 ---- <YAF:PageLinks runat="server" id="PageLinks"/> + <div align="center"> <asp:PasswordRecovery ID="PasswordRecovery1" runat="server"> + <UserNameTemplate> + <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse"> + <tr> + <td> + <table class="content" cellspacing="1" cellpadding="0" border="0" width="600"> + <tr> + <td align="center" colspan="2" class="header1"> + Forgot Your Password?</td> + </tr> + <tr> + <td align="center" colspan="2" class="post"> + Enter your User Name to receive your password.</td> + </tr> + <tr> + <td align="right" class="postheader"> + <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td> + <td class="post"> + <asp:TextBox ID="UserName" runat="server"></asp:TextBox> + <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." + ToolTip="User Name is required." ValidationGroup="PasswordRecovery1">*</asp:RequiredFieldValidator> + </td> + </tr> + <tr> + <td align="center" colspan="2" style="color: red"> + <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal> + </td> + </tr> + <tr> + <td align="right" colspan="2" class="postfooter"> + <asp:Button ID="SubmitButton" runat="server" CommandName="Submit" Text="Submit" ValidationGroup="PasswordRecovery1" /> + </td> + </tr> + </table> + </td> + </tr> + </table> + </UserNameTemplate> + <QuestionTemplate> + <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse"> + <tr> + <td> + <table border="0" cellpadding="0"> + <tr> + <td align="center" colspan="2"> + Identity Confirmation</td> + </tr> + <tr> + <td align="center" colspan="2"> + Answer the following question to receive your password.</td> + </tr> + <tr> + <td align="right"> + User Name:</td> + <td> + <asp:Literal ID="UserName" runat="server"></asp:Literal> + </td> + </tr> + <tr> + <td align="right"> + Question:</td> + <td> + <asp:Literal ID="Question" runat="server"></asp:Literal> + </td> + </tr> + <tr> + <td align="right"> + <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Answer:</asp:Label></td> + <td> + <asp:TextBox ID="Answer" runat="server"></asp:TextBox> + <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer" ErrorMessage="Answer is required." ToolTip="Answer is required." + ValidationGroup="ctl00$PasswordRecovery1">*</asp:RequiredFieldValidator> + </td> + </tr> + <tr> + <td align="center" colspan="2" style="color: red"> + <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal> + </td> + </tr> + <tr> + <td align="right" colspan="2"> + <asp:Button ID="SubmitButton" runat="server" CommandName="Submit" Text="Submit" ValidationGroup="ctl00$PasswordRecovery1" /> + </td> + </tr> + </table> + </td> + </tr> + </table> + </QuestionTemplate> </asp:PasswordRecovery> + </div> Index: recoverpassword.ascx.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/recoverpassword.ascx.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** recoverpassword.ascx.cs 19 Jan 2007 13:16:16 -0000 1.3 --- recoverpassword.ascx.cs 13 Mar 2007 09:38:47 -0000 1.4 *************** *** 14,25 **** namespace YAF.Pages // YAF.Pages { ! public partial class recoverpassword : YAF.Classes.Base.ForumPage ! { ! public recoverpassword() ! : base("RECOVERPASSWORD") ! { ! } ! protected void Page_Load(object sender, EventArgs e) { if (!CanLogin) --- 14,25 ---- namespace YAF.Pages // YAF.Pages { ! public partial class recoverpassword : YAF.Classes.Base.ForumPage ! { ! public recoverpassword() ! : base( "RECOVERPASSWORD" ) ! { ! } ! protected void Page_Load( object sender, EventArgs e ) { if (!CanLogin) *************** *** 29,34 **** { PageLinks.AddLink(PageContext.BoardSettings.Name, YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.forum)); } } ! } } \ No newline at end of file --- 29,35 ---- { PageLinks.AddLink(PageContext.BoardSettings.Name, YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.forum)); + PageLinks.AddLink( GetText( "title" ) ); } } ! } } \ No newline at end of file Index: login.ascx.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/login.ascx.cs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** login.ascx.cs 19 Jan 2007 13:16:16 -0000 1.26 --- login.ascx.cs 13 Mar 2007 09:38:47 -0000 1.27 *************** *** 41,45 **** public login() : base( "LOGIN" ) ! { } --- 41,45 ---- public login() : base( "LOGIN" ) ! { } *************** *** 49,81 **** YAF.Classes.Utils.yaf_BuildLink.Redirect( YAF.Classes.Utils.ForumPages.forum ); - if ( !IsPostBack ) { PageLinks.AddLink( PageContext.BoardSettings.Name, YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.forum ) ); Login1.CreateUserText = "Sign up for a new account."; ! Login1.CreateUserUrl = YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.register ); Login1.PasswordRecoveryText = GetText( "lostpassword" ); Login1.PasswordRecoveryUrl = YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.recoverpassword ); ! //ForumLogin.Text = GetText( "forum_login" ); ! //LostPassword.Text = GetText( "lostpassword" ); ! //Recover.Text = GetText( "sendpassword" ); // set the focus using Damien McGivern client-side focus class ! //ClientSideFocus.setFocus( UserName ); ! } ! } ! override protected void OnInit( EventArgs e ) ! { ! // ! // CODEGEN: This call is required by the ASP.NET Web Form Designer. ! // ! Login1.LoggedIn += new EventHandler( Login1_LoggedIn ); ! this.Load += new System.EventHandler( this.Page_Load ); ! base.OnInit( e ); } ! void Login1_LoggedIn( object sender, EventArgs e ) { if ( Request.QueryString ["ReturnUrl"] != null ) --- 49,82 ---- YAF.Classes.Utils.yaf_BuildLink.Redirect( YAF.Classes.Utils.ForumPages.forum ); if ( !IsPostBack ) { PageLinks.AddLink( PageContext.BoardSettings.Name, YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.forum ) ); + PageLinks.AddLink( GetText( "title" ) ); + Login1.CreateUserText = "Sign up for a new account."; ! //Login1.CreateUserUrl = YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.register ); Login1.PasswordRecoveryText = GetText( "lostpassword" ); Login1.PasswordRecoveryUrl = YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.recoverpassword ); + Login1.FailureText = GetText( "password_error" ); ! // localize controls ! CheckBox rememberMe = ( CheckBox )Login1.FindControl( "RememberMe" ); ! TextBox userName = ( TextBox ) Login1.FindControl( "UserName" ); ! Button forumLogin = ( Button ) Login1.FindControl( "LoginButton" ); ! HyperLink passwordRecovery = ( HyperLink ) Login1.FindControl( "PasswordRecovery" ); ! ! rememberMe.Text = GetText( "auto" ); ! forumLogin.Text = GetText( "forum_login" ); ! passwordRecovery.Text = GetText( "lostpassword" ); ! passwordRecovery.NavigateUrl = YAF.Classes.Utils.yaf_BuildLink.GetLink( YAF.Classes.Utils.ForumPages.recoverpassword ); // set the focus using Damien McGivern client-side focus class ! YAF.Classes.UI.ClientSideFocus.setFocus( userName ); ! DataBind(); ! } } ! protected void Login1_LoggedIn( object sender, EventArgs e ) { if ( Request.QueryString ["ReturnUrl"] != null ) *************** *** 84,87 **** --- 85,94 ---- YAF.Classes.Utils.yaf_BuildLink.Redirect( YAF.Classes.Utils.ForumPages.forum ); } + + protected void Login1_LoginError( object sender, EventArgs e ) + { + //Display the failure message in a client-side alert box + Page.ClientScript.RegisterStartupScript( Page.GetType(), "LoginError", String.Format( "alert('{0}');", Login1.FailureText.Replace( "'", "\'" ) ), true ); + } } } Index: register.ascx =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/register.ascx,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** register.ascx 31 Jan 2007 13:37:10 -0000 1.10 --- register.ascx 13 Mar 2007 09:38:47 -0000 1.11 *************** *** 1,18 **** ! <%@ Control language="c#" Codebehind="register.ascx.cs" AutoEventWireup="True" Inherits="YAF.Pages.register" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Controls" Assembly="YAF" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Classes.UI" Assembly="YAF.Classes.UI" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Classes.Utils" Assembly="YAF.Classes.Utils" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Controls" Assembly="YAF.Controls" %> ! ! <YAF:PageLinks runat="server" id="PageLinks"/> ! ! <asp:CreateUserWizard ID="CreateUserWizard1" runat="server"> ! <WizardSteps> ! <asp:CreateUserWizardStep runat="server"> ! </asp:CreateUserWizardStep> ! <asp:CompleteWizardStep runat="server"> ! </asp:CompleteWizardStep> ! </WizardSteps> ! </asp:CreateUserWizard> ! ! <YAF:SmartScroller id="SmartScroller1" runat="server" /> --- 1,145 ---- ! <%@ Control Language="c#" Codebehind="register.ascx.cs" AutoEventWireup="True" Inherits="YAF.Pages.register" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Controls" Assembly="YAF" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Classes.UI" Assembly="YAF.Classes.UI" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Classes.Utils" Assembly="YAF.Classes.Utils" %> <%@ Register TagPrefix="YAF" Namespace="YAF.Controls" Assembly="YAF.Controls" %> ! <YAF:PageLinks runat="server" ID="PageLinks" /> ! <div align="center"> ! <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" LoginCreatedUser="False" StartNextButtonText="Agree" StartNextButtonType="Link" ! OnPreviousButtonClick="CreateUserWizard1_PreviousButtonClick"> ! <WizardSteps> ! <asp:TemplatedWizardStep runat="server" StepType="Start" Title="Agreement" AllowReturn="False"> ! <ContentTemplate> ! <table class="content" cellspacing="1" cellpadding="0" border="0" width="600"> ! <tr> ! <td class="header1" colspan="2"> ! Terms and Conditions:</td> ! </tr> ! <tr> ! <td class="post" colspan="2"> ! <p> ! It is impossible for owners and operators of this forum to confirm the validity of all posts on this forum. ! Posts reflect the views and opinion of the author, but not necessarily of the forum owners and operators. If you feel that ! a posted message is questionable, is encouraged to notify an administrator of this forum immediately.</p> ! <p> ! You agree not to post any abusive, vulgar, obscene, hateful, slanderous, threatening, sexually-oriented or any other material ! that may violate any applicable laws. Doing so may lead to you being permanently banned from this forum. ! Note that all IP address are logged and may aid in enforcing these conditions.</p> ! <p> ! You agree that the owners and operators of this forum have the right to remove, edit, move or close any topic ! at any time should they see fit. As a user you agree to any information you have entered above being stored in a database. While ! this information will not be disclosed to any third party without your consent the owners and operators cannot ! be held responsible for any hacking attempt that may lead to the data being compromised.</p> ! <p> ! This forum system uses cookies to store information on your local computer. These cookies do not contain any of the information ! you have entered above; they serve only to improve your viewing pleasure. The e-mail address is used only for confirming your ! registration details and password (and for sending new passwords should you forget your current one).</p> ! <p> ! You agree not to use any automated tools for registering and/or posting on this bulletin board. By failing to obey this rule ! you would be granting us permission to repeatedly query your web server.</p> ! <p> ! By clicking "Agree" below you will to be bound by the terms and conditions for using this forum</p> ! ! <p align="center"> ! <asp:LinkButton ID="StartNextButton" runat="server" CommandName="MoveNext">I Agree to these Terms and Conditions</asp:LinkButton><br /><br /> ! <asp:LinkButton ID="StartDisagreeButton" runat="server" CommandName="MovePrevious">I DO NOT Agree to these Terms and Conditions</asp:LinkButton> ! </p> ! </td> ! </tr> ! </table> ! </ContentTemplate> ! </asp:TemplatedWizardStep> ! <asp:CreateUserWizardStep runat="server"> ! <ContentTemplate> ! <table class="content" cellspacing="1" cellpadding="0" border="0" width="600"> ! <tr> ! <td align="center" class="header1" colspan="2"><%# GetText("TITLE") %></td> ! </tr> ! <tr> ! <td align="center" class="post" colspan="2"><asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"/> ! <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword" Display="Dynamic" ! ErrorMessage="The Password and Confirmation Password must match." ValidationGroup="CreateUserWizard1"></asp:CompareValidator> ! </td> ! </tr> ! <tr> ! <td align="right" class="postheader"> ! <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td> ! <td class="post"> ! <asp:TextBox ID="UserName" runat="server"></asp:TextBox> ! <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ! ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> ! </td> ! </tr> ! <tr> ! <td align="right" class="postheader"> ! <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td> ! <td class="post"> ! <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox> ! <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ! ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> ! </td> ! </tr> ! <tr> ! <td align="right" class="postheader"> ! <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label></td> ! <td class="post"> ! <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox> ! <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword" ErrorMessage="Confirm Password is required." ! ToolTip="Confirm Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> ! </td> ! </tr> ! <tr> ! <td align="right" class="postheader"> ! <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label></td> ! <td class="post"> ! <asp:TextBox ID="Email" runat="server"></asp:TextBox> ! <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" ErrorMessage="E-mail is required." ToolTip="E-mail is required." ! ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> ! </td> ! </tr> ! <tr> ! <td align="right" class="postheader"> ! <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label></td> ! <td class="post"> ! <asp:TextBox ID="Question" runat="server"></asp:TextBox> ! <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question" ErrorMessage="Security question is required." ! ToolTip="Security question is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> ! </td> ! </tr> ! <tr> ! <td align="right" class="postheader"> ! <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label></td> ! <td class="post"> ! <asp:TextBox ID="Answer" runat="server"></asp:TextBox> ! <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer" ErrorMessage="Security answer is required." ! ToolTip="Security answer is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> ! </td> ! </tr> ! <tr align="right"> ! <td align="center" colspan="2" class="postfooter"> ! <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" Text="Create User" ValidationGroup="CreateUserWizard1" /> ! </td> ! </tr> ! </table> ! <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True" ValidationGroup="CreateUserWizard1" ShowSummary="False" /> ! </ContentTemplate> ! <CustomNavigationTemplate> ! <!-- moved nav to Content Template --> ! </CustomNavigationTemplate> ! </asp:CreateUserWizardStep> ! <asp:CompleteWizardStep runat="server"> ! </asp:CompleteWizardStep> ! </WizardSteps> ! <StepNavigationTemplate> ! <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious" Text="Previous" /> ! <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" Text="Next" /> ! </StepNavigationTemplate> ! <StartNavigationTemplate> ! </StartNavigationTemplate> ! <FinishNavigationTemplate> ! <asp:Button ID="FinishPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious" Text="Previous" /> ! <asp:Button ID="FinishButton" runat="server" CommandName="MoveComplete" Text="Finish" /> ! </FinishNavigationTemplate> ! </asp:CreateUserWizard> ! </div> ! <YAF:SmartScroller ID="SmartScroller1" runat="server" /> |
From: Jaben C. <ja...@us...> - 2007-03-12 13:15:35
|
Update of /cvsroot/yafdotnet/yafsrc In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13442 Modified Files: YAF.csproj default.config Added Files: Global.asax Global.asax.cs Log Message: Minor modifications... --- NEW FILE: Global.asax --- <%@ Application Codebehind="Global.asax.cs" Inherits="YAF.Global" Language="C#" %> Index: YAF.csproj =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/YAF.csproj,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** YAF.csproj 10 Feb 2007 06:22:09 -0000 1.10 --- YAF.csproj 12 Mar 2007 13:14:40 -0000 1.11 *************** *** 155,158 **** --- 155,159 ---- <SubType>Form</SubType> </Content> + <Content Include="Global.asax" /> <Content Include="images\delete_icon.gif" /> <Content Include="images\eventError.gif" /> *************** *** 171,176 **** <SubType>Form</SubType> </Content> - <Content Include="install\version-1.0.1.sql" /> - <Content Include="install\version-1.0.2.sql" /> <Content Include="languages\china.xml" /> <Content Include="languages\danish.xml" /> --- 172,175 ---- *************** *** 809,812 **** --- 808,812 ---- <Compile Include="controls\DisplayPost.ascx.cs"> <DependentUpon>DisplayPost.ascx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\DisplayPost.ascx.designer.cs"> *************** *** 815,818 **** --- 815,819 ---- <Compile Include="controls\EditUsersAvatar.ascx.cs"> <DependentUpon>EditUsersAvatar.ascx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersAvatar.ascx.designer.cs"> *************** *** 821,824 **** --- 822,826 ---- <Compile Include="controls\EditUsersGroups.ascx.cs"> <DependentUpon>EditUsersGroups.ascx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersGroups.ascx.designer.cs"> *************** *** 827,830 **** --- 829,833 ---- <Compile Include="controls\EditUsersInfo.ascx.cs"> <DependentUpon>EditUsersInfo.ascx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersInfo.ascx.designer.cs"> *************** *** 833,836 **** --- 836,840 ---- <Compile Include="controls\EditUsersPoints.ascx.cs"> <DependentUpon>EditUsersPoints.ascx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersPoints.ascx.designer.cs"> *************** *** 839,842 **** --- 843,847 ---- <Compile Include="controls\EditUsersProfile.ascx.cs"> <DependentUpon>EditUsersProfile.ascx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersProfile.ascx.designer.cs"> *************** *** 845,848 **** --- 850,854 ---- <Compile Include="controls\EditUsersSignature.ascx.cs"> <DependentUpon>EditUsersSignature.ascx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersSignature.ascx.designer.cs"> *************** *** 851,854 **** --- 857,861 ---- <Compile Include="controls\EditUsersSuspend.ascx.cs"> <DependentUpon>EditUsersSuspend.ascx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersSuspend.ascx.designer.cs"> *************** *** 857,860 **** --- 864,868 ---- <Compile Include="controls\ForumList.ascx.cs"> <DependentUpon>ForumList.ascx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\ForumList.ascx.designer.cs"> *************** *** 863,866 **** --- 871,875 ---- <Compile Include="controls\smileys.ascx.cs"> <DependentUpon>smileys.ascx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\smileys.ascx.designer.cs"> *************** *** 884,887 **** --- 893,899 ---- <DependentUpon>error.aspx</DependentUpon> </Compile> + <Compile Include="Global.asax.cs"> + <DependentUpon>Global.asax</DependentUpon> + </Compile> <Compile Include="install\default.aspx.cs"> <DependentUpon>default.aspx</DependentUpon> --- NEW FILE: Global.asax.cs --- using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.SessionState; using System.Threading; namespace YAF { public class Global : System.Web.HttpApplication { protected void Application_Start( object sender, EventArgs e ) { // TODO: start e-mailing thread... } protected void Application_End( object sender, EventArgs e ) { } } } Index: default.config =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/default.config,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** default.config 9 Mar 2007 12:15:55 -0000 1.7 --- default.config 12 Mar 2007 13:14:40 -0000 1.8 *************** *** 4,8 **** <connectionStrings> <add name="yafnet" connectionString="data source=(local);initial catalog=yafnet;user id=sa;pwd=xxx;" /> - <add name="AspNetCS" connectionString="data source=(local);initial catalog=aspnetdb;user id=sa;pwd=xxx;" /> </connectionStrings> --- 4,7 ---- *************** *** 12,19 **** --- 11,20 ---- <system.web> + <globalization requestEncoding="utf-8" responseEncoding="utf-8"/> <authentication mode="Forms"> <forms name=".YAFNET_Authentication" protection="All" timeout="43200" cookieless="UseCookies"/> </authentication> + <machineKey validationKey="9FFB939631CC043153ADAD5CEBB14950BE0DA4D904BE58CF36003F5B0C3D1F570080E60425BAEE253919118175BE363D3B52FF217459736FD820451AC928F32E" decryptionKey="320615E71D6E5CA923E41B70205AE37B003A328383FA8EA3" validation="SHA1" /> <compilation defaultLanguage="c#" /> <customErrors defaultRedirect="error.aspx" mode="RemoteOnly" /> *************** *** 23,27 **** <providers> <clear/> ! <add name="Forum" type="System.Web.Security.SqlRoleProvider" connectionStringName="AspNetCS" applicationName="Forum" /> </providers> </roleManager> --- 24,28 ---- <providers> <clear/> ! <add connectionStringName="yafnet" applicationName="YetAnotherForum" name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" /> </providers> </roleManager> *************** *** 30,35 **** <providers> <clear/> ! <add name="Forum" type="System.Web.Security.SqlMembershipProvider" connectionStringName="AspNetCS" applicationName="Forum"/> ! <add name="YAFForum" type="yaf.Providers.YAFMembershipProvider" connectionStringName="AspNetCS" applicationName="Forum" /> </providers> </membership> --- 31,35 ---- <providers> <clear/> ! <add connectionStringName="yafnet" name="YAFMembershipProvider" applicationName="YetAnotherForum" type="YAF.Providers.YAFMembershipProvider" /> </providers> </membership> *************** *** 38,46 **** <providers> <clear/> ! <add name="Forum" type="System.Web.Profile.SqlProfileProvider" connectionStringName="AspNetCS" applicationName="Forum"/> </providers> </profile> </system.web> <system.net> <mailSettings> --- 38,47 ---- <providers> <clear/> ! <add name="SqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="yafnet" applicationName="YetAnotherForum"/> </providers> </profile> </system.web> + <system.net> <mailSettings> |
From: Jaben C. <ja...@us...> - 2007-03-12 10:49:35
|
Update of /cvsroot/yafdotnet/yafsrc/install In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17951/yafsrc/install Modified Files: Tag: v1_0_2_NETv2 procedures.sql Log Message: yaf_Registry fixes Index: procedures.sql =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/install/procedures.sql,v retrieving revision 1.3.2.10 retrieving revision 1.3.2.11 diff -C2 -d -r1.3.2.10 -r1.3.2.11 *** procedures.sql 8 Feb 2007 00:48:14 -0000 1.3.2.10 --- procedures.sql 12 Mar 2007 10:48:33 -0000 1.3.2.11 *************** *** 918,923 **** declare @UserFlags int ! SET @TimeZone = (SELECT CAST(Value as int) FROM yaf_Registry WHERE LOWER(Name) = LOWER('TimeZone')) ! SET @ForumEmail = (SELECT Value FROM yaf_Registry WHERE LOWER(Name) = LOWER('ForumEmail')) -- yaf_Board --- 918,923 ---- declare @UserFlags int ! SET @TimeZone = (SELECT CAST(CAST([Value] as nvarchar(50)) as int) FROM yaf_Registry WHERE LOWER([Name]) = LOWER('TimeZone')) ! SET @ForumEmail = (SELECT CAST([Value] as nvarchar(50)) FROM yaf_Registry WHERE LOWER([Name]) = LOWER('ForumEmail')) -- yaf_Board *************** *** 2970,2980 **** @Version int, @VersionName nvarchar(50) ! ) as ! begin ! EXEC yaf_registry_save 'Version', @Version EXEC yaf_registry_save 'VersionName',@VersionName - end - GO CREATE procedure [dbo].[yaf_topic_active](@BoardID int,@UserID int,@Since datetime,@CategoryID int=null) as --- 2970,2984 ---- @Version int, @VersionName nvarchar(50) ! ) ! AS ! BEGIN ! ! DECLARE @tmpValue AS nvarchar(100) ! SET @tmpValue = CAST(@Version AS nvarchar(100)) ! EXEC yaf_registry_save 'Version', @tmpValue EXEC yaf_registry_save 'VersionName',@VersionName + END + GO CREATE procedure [dbo].[yaf_topic_active](@BoardID int,@UserID int,@Since datetime,@CategoryID int=null) as |
From: Jaben C. <ja...@us...> - 2007-03-09 12:16:50
|
Update of /cvsroot/yafdotnet/yafsrc In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8606 Modified Files: default.config Log Message: removed configPassword Index: default.config =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/default.config,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** default.config 4 Jan 2007 13:34:16 -0000 1.6 --- default.config 9 Mar 2007 12:15:55 -0000 1.7 *************** *** 9,13 **** <appSettings> <add key="boardid" value="1" /> - <add key="configPassword" value="" /> </appSettings> --- 9,12 ---- |
From: Jaben C. <ja...@us...> - 2007-03-09 12:15:19
|
Update of /cvsroot/yafdotnet/yafsrc/install In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8174/install Modified Files: default.aspx.cs procedures.sql Log Message: fixes Index: default.aspx.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/install/default.aspx.cs,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** default.aspx.cs 26 Jan 2007 12:13:22 -0000 1.38 --- default.aspx.cs 9 Mar 2007 12:14:25 -0000 1.39 *************** *** 59,65 **** { if ( IsInstalled ) ! InstallWizard.ActiveStepIndex = 1; else ! InstallWizard.ActiveStepIndex = 0; TimeZones.DataSource = yaf_StaticData.TimeZones(); --- 59,65 ---- { if ( IsInstalled ) ! InstallWizard.ActiveStepIndex = 1; else ! InstallWizard.ActiveStepIndex = 0; TimeZones.DataSource = yaf_StaticData.TimeZones(); *************** *** 90,97 **** void Wizard_ActiveStepChanged( object sender, EventArgs e ) { ! if (InstallWizard.ActiveStepIndex == 1 && !IsInstalled) ! InstallWizard.ActiveStepIndex++; ! else if (InstallWizard.ActiveStepIndex == 3 && IsForumInstalled) ! InstallWizard.ActiveStepIndex++; } --- 90,97 ---- void Wizard_ActiveStepChanged( object sender, EventArgs e ) { ! if ( InstallWizard.ActiveStepIndex == 1 && !IsInstalled ) ! InstallWizard.ActiveStepIndex++; ! else if ( InstallWizard.ActiveStepIndex == 3 && IsForumInstalled ) ! InstallWizard.ActiveStepIndex++; } *************** *** 166,173 **** { this.Load += new System.EventHandler( this.Page_Load ); ! InstallWizard.NextButtonClick += new WizardNavigationEventHandler(Wizard_NextButtonClick); ! InstallWizard.PreviousButtonClick += new WizardNavigationEventHandler(Wizard_PreviousButtonClick); ! InstallWizard.ActiveStepChanged += new EventHandler(Wizard_ActiveStepChanged); ! InstallWizard.FinishButtonClick += new WizardNavigationEventHandler(Wizard_FinishButtonClick); base.OnInit( e ); } --- 166,173 ---- { this.Load += new System.EventHandler( this.Page_Load ); ! InstallWizard.NextButtonClick += new WizardNavigationEventHandler( Wizard_NextButtonClick ); ! InstallWizard.PreviousButtonClick += new WizardNavigationEventHandler( Wizard_PreviousButtonClick ); ! InstallWizard.ActiveStepChanged += new EventHandler( Wizard_ActiveStepChanged ); ! InstallWizard.FinishButtonClick += new WizardNavigationEventHandler( Wizard_FinishButtonClick ); base.OnInit( e ); } Index: procedures.sql =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/install/procedures.sql,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** procedures.sql 7 Mar 2007 11:58:59 -0000 1.9 --- procedures.sql 9 Mar 2007 12:14:25 -0000 1.10 *************** *** 951,956 **** declare @UserFlags int ! SET @TimeZone = (SELECT CAST(Value as int) FROM yaf_Registry WHERE LOWER(Name) = LOWER('TimeZone')) ! SET @ForumEmail = (SELECT Value FROM yaf_Registry WHERE LOWER(Name) = LOWER('ForumEmail')) -- yaf_Board --- 951,956 ---- declare @UserFlags int ! SET @TimeZone = (SELECT CAST(CAST([Value] as nvarchar(50)) as int) FROM yaf_Registry WHERE LOWER([Name]) = LOWER('TimeZone')) ! SET @ForumEmail = (SELECT CAST([Value] as nvarchar(50)) FROM yaf_Registry WHERE LOWER([Name]) = LOWER('ForumEmail')) -- yaf_Board *************** *** 3074,3085 **** GO ! create procedure [dbo].[yaf_system_updateversion]( @Version int, @VersionName nvarchar(50) ! ) as ! begin ! EXEC yaf_registry_save 'Version', @Version EXEC yaf_registry_save 'VersionName',@VersionName ! end GO --- 3074,3091 ---- GO ! CREATE PROCEDURE [dbo].[yaf_system_updateversion] ! ( @Version int, @VersionName nvarchar(50) ! ) ! AS ! BEGIN ! ! DECLARE @tmpValue AS nvarchar(100) ! SET @tmpValue = CAST(@Version AS nvarchar(100)) ! EXEC yaf_registry_save 'Version', @tmpValue EXEC yaf_registry_save 'VersionName',@VersionName ! ! END GO |
From: Jaben C. <ja...@us...> - 2007-03-07 12:35:56
|
Update of /cvsroot/yafdotnet/yafsrc/install In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15011/install Modified Files: tables.sql Log Message: not exists should have been exists... always do that! Index: tables.sql =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/install/tables.sql,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tables.sql 7 Mar 2007 11:58:59 -0000 1.5 --- tables.sql 7 Mar 2007 12:35:55 -0000 1.6 *************** *** 623,627 **** GO ! if not exists(select 1 from syscolumns where id=object_id(N'yaf_Registry') and name=N'Value' and xtype<>99) alter table yaf_Registry alter column Value ntext null GO --- 623,627 ---- GO ! if exists(select 1 from syscolumns where id=object_id(N'yaf_Registry') and name=N'Value' and xtype<>99) alter table yaf_Registry alter column Value ntext null GO |
From: Jaben C. <ja...@us...> - 2007-03-07 11:59:56
|
Update of /cvsroot/yafdotnet/yafsrc/install In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv31297/install Modified Files: procedures.sql tables.sql triggers.sql Log Message: Made yaf_registry table bigger and added support for that increase. Index: tables.sql =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/install/tables.sql,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tables.sql 21 Dec 2006 16:01:51 -0000 1.4 --- tables.sql 7 Mar 2007 11:58:59 -0000 1.5 *************** *** 361,365 **** RegistryID int IDENTITY(1, 1) NOT NULL, Name nvarchar(50) NOT NULL, ! Value nvarchar(400), BoardID int, CONSTRAINT PK_Registry PRIMARY KEY (RegistryID) --- 361,365 ---- RegistryID int IDENTITY(1, 1) NOT NULL, Name nvarchar(50) NOT NULL, ! Value ntext, BoardID int, CONSTRAINT PK_Registry PRIMARY KEY (RegistryID) *************** *** 623,626 **** --- 623,630 ---- GO + if not exists(select 1 from syscolumns where id=object_id(N'yaf_Registry') and name=N'Value' and xtype<>99) + alter table yaf_Registry alter column Value ntext null + GO + if not exists(select 1 from syscolumns where id=object_id('yaf_PMessage') and name='Flags') begin Index: triggers.sql =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/install/triggers.sql,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** triggers.sql 28 Jun 2006 11:04:03 -0000 1.1 --- triggers.sql 7 Mar 2007 11:58:59 -0000 1.2 *************** *** 9,13 **** create trigger yaf_Active_insert on dbo.yaf_Active for insert as begin ! declare @BoardID int, @count int, @max int -- Assumes only one row was inserted - shouldn't be a problem? --- 9,13 ---- create trigger yaf_Active_insert on dbo.yaf_Active for insert as begin ! declare @BoardID int, @count int, @max int, @maxStr nvarchar(255), @countStr nvarchar(255), @dtStr nvarchar(255) -- Assumes only one row was inserted - shouldn't be a problem? *************** *** 15,27 **** select @count = count(distinct IP) from yaf_Active with(nolock) where BoardID=@BoardID ! select @max = cast(Value as int) from yaf_Registry where BoardID=@BoardID and Name=N'maxusers' if @@rowcount=0 begin ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxusers',cast(@count as nvarchar)) ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxuserswhen',convert(nvarchar,getdate(),126)) end else if @count>@max begin ! update yaf_Registry set Value=cast(@count as nvarchar) where BoardID=@BoardID and Name=N'maxusers' ! update yaf_Registry set Value=convert(nvarchar,getdate(),126) where BoardID=@BoardID and Name=N'maxuserswhen' end end --- 15,31 ---- select @count = count(distinct IP) from yaf_Active with(nolock) where BoardID=@BoardID ! select @maxStr = cast(Value as nvarchar) from yaf_Registry where BoardID=@BoardID and Name=N'maxusers' ! select @max = cast(@maxStr as int) ! select @countStr = cast(@count as nvarchar) ! select @dtStr = convert(nvarchar,getdate(),126) ! if @@rowcount=0 begin ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxusers',cast(@countStr as ntext)) ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxuserswhen',cast(@dtStr as ntext)) end else if @count>@max begin ! update yaf_Registry set Value=cast(@countStr as ntext) where BoardID=@BoardID and Name=N'maxusers' ! update yaf_Registry set Value=cast(@dtStr as ntext) where BoardID=@BoardID and Name=N'maxuserswhen' end end Index: procedures.sql =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/install/procedures.sql,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** procedures.sql 4 Jan 2007 13:18:17 -0000 1.8 --- procedures.sql 7 Mar 2007 11:58:59 -0000 1.9 *************** *** 1,4 **** /* ! YAF SQL Stored Procedures File Created 10/19/06 --- 1,4 ---- /* ! YAF SQL Stored Procedures File Created 03/01/06 *************** *** 2948,2952 **** create procedure [dbo].[yaf_registry_save]( @Name nvarchar(50), ! @Value nvarchar(400) = NULL, @BoardID int = null ) AS --- 2948,2952 ---- create procedure [dbo].[yaf_registry_save]( @Name nvarchar(50), ! @Value ntext = NULL, @BoardID int = null ) AS |
From: Jaben C. <ja...@us...> - 2007-02-22 08:34:50
|
Update of /cvsroot/yafdotnet/yafsrc/install In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20603/yafsrc/install Modified Files: Tag: v1_0_2_NETv2 triggers.sql Log Message: fixed issues with updated registry table being ntext now Index: triggers.sql =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/install/triggers.sql,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** triggers.sql 13 Sep 2006 11:03:27 -0000 1.1.2.2 --- triggers.sql 22 Feb 2007 08:33:52 -0000 1.1.2.3 *************** *** 9,13 **** create trigger yaf_Active_insert on dbo.yaf_Active for insert as begin ! declare @BoardID int, @count int, @max int -- Assumes only one row was inserted - shouldn't be a problem? --- 9,13 ---- create trigger yaf_Active_insert on dbo.yaf_Active for insert as begin ! declare @BoardID int, @count int, @max int, @maxStr nvarchar(255), @countStr nvarchar(255), @dtStr nvarchar(255) -- Assumes only one row was inserted - shouldn't be a problem? *************** *** 15,27 **** select @count = count(distinct IP) from yaf_Active with(nolock) where BoardID=@BoardID ! select @max = cast(Value as int) from yaf_Registry where BoardID=@BoardID and Name=N'maxusers' if @@rowcount=0 begin ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxusers',cast(@count as nvarchar)) ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxuserswhen',convert(nvarchar,getdate(),126)) end else if @count>@max begin ! update yaf_Registry set Value=cast(@count as nvarchar) where BoardID=@BoardID and Name=N'maxusers' ! update yaf_Registry set Value=convert(nvarchar,getdate(),126) where BoardID=@BoardID and Name=N'maxuserswhen' end end --- 15,31 ---- select @count = count(distinct IP) from yaf_Active with(nolock) where BoardID=@BoardID ! select @maxStr = cast(Value as nvarchar) from yaf_Registry where BoardID=@BoardID and Name=N'maxusers' ! select @max = cast(@maxStr as int) ! select @countStr = cast(@count as nvarchar) ! select @dtStr = convert(nvarchar,getdate(),126) ! if @@rowcount=0 begin ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxusers',cast(@countStr as ntext)) ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxuserswhen',cast(@dtStr as ntext)) end else if @count>@max begin ! update yaf_Registry set Value=cast(@countStr as ntext) where BoardID=@BoardID and Name=N'maxusers' ! update yaf_Registry set Value=cast(@dtStr as ntext) where BoardID=@BoardID and Name=N'maxuserswhen' end end |
From: <bru...@on...> - 2007-02-12 23:13:32
|
Hello everyone, I'm a student at Oregon State University getting ready to graduate with a BS in CS. I have 2 years experience with .NET and I stumbled upon this project on SourceForge, so I figured I'd contribute with some general commenting and a small fix. Nothing too major in here, mostly commenting, as I already said. There was one change I made in the GetActionText method in the file deletemessage.ascx.cs : both if branches were returning the same string. I commented out the if branch and inserted a return with the string. Anyways, hope this helps. I'll be trying to contribute more, so let me know what I can do to help out or anything else. See attached: patch_diff Regards, Joe |
From: Jaben C. <ja...@us...> - 2007-02-10 06:23:37
|
Update of /cvsroot/yafdotnet/yafsrc/YAF.Controls/Base In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22386/YAF.Controls/Base Removed Files: BaseUserControl.cs Log Message: no need to be here.. --- BaseUserControl.cs DELETED --- |
From: Jaben C. <ja...@us...> - 2007-02-10 06:23:03
|
Update of /cvsroot/yafdotnet/yafsrc In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22274 Modified Files: YAF.csproj Log Message: oh yeah Index: YAF.csproj =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/YAF.csproj,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** YAF.csproj 26 Jan 2007 12:18:09 -0000 1.9 --- YAF.csproj 10 Feb 2007 06:22:09 -0000 1.10 *************** *** 809,813 **** <Compile Include="controls\DisplayPost.ascx.cs"> <DependentUpon>DisplayPost.ascx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\DisplayPost.ascx.designer.cs"> --- 809,812 ---- *************** *** 816,820 **** <Compile Include="controls\EditUsersAvatar.ascx.cs"> <DependentUpon>EditUsersAvatar.ascx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersAvatar.ascx.designer.cs"> --- 815,818 ---- *************** *** 823,827 **** <Compile Include="controls\EditUsersGroups.ascx.cs"> <DependentUpon>EditUsersGroups.ascx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersGroups.ascx.designer.cs"> --- 821,824 ---- *************** *** 830,834 **** <Compile Include="controls\EditUsersInfo.ascx.cs"> <DependentUpon>EditUsersInfo.ascx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersInfo.ascx.designer.cs"> --- 827,830 ---- *************** *** 837,841 **** <Compile Include="controls\EditUsersPoints.ascx.cs"> <DependentUpon>EditUsersPoints.ascx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersPoints.ascx.designer.cs"> --- 833,836 ---- *************** *** 844,848 **** <Compile Include="controls\EditUsersProfile.ascx.cs"> <DependentUpon>EditUsersProfile.ascx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersProfile.ascx.designer.cs"> --- 839,842 ---- *************** *** 851,855 **** <Compile Include="controls\EditUsersSignature.ascx.cs"> <DependentUpon>EditUsersSignature.ascx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersSignature.ascx.designer.cs"> --- 845,848 ---- *************** *** 858,862 **** <Compile Include="controls\EditUsersSuspend.ascx.cs"> <DependentUpon>EditUsersSuspend.ascx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\EditUsersSuspend.ascx.designer.cs"> --- 851,854 ---- *************** *** 865,869 **** <Compile Include="controls\ForumList.ascx.cs"> <DependentUpon>ForumList.ascx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\ForumList.ascx.designer.cs"> --- 857,860 ---- *************** *** 872,876 **** <Compile Include="controls\smileys.ascx.cs"> <DependentUpon>smileys.ascx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="controls\smileys.ascx.designer.cs"> --- 863,866 ---- |
From: Jaben C. <ja...@us...> - 2007-02-10 06:22:41
|
Update of /cvsroot/yafdotnet/yafsrc/YAF.Classes/YAF.Classes.Base In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21934/YAF.Classes/YAF.Classes.Base Modified Files: YAF.Classes.Base.csproj Added Files: BaseUserControl.cs Log Message: oops... BaseUserControl is now added --- NEW FILE: BaseUserControl.cs --- using System; using System.Data; using YAF.Classes.Utils; namespace YAF.Classes.Base { /// <summary> /// Summary description for ForumUsers. /// </summary> public class BaseUserControl : System.Web.UI.UserControl { public yaf_Context PageContext { get { return yaf_Context.Current; } } } } Index: YAF.Classes.Base.csproj =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/YAF.Classes/YAF.Classes.Base/YAF.Classes.Base.csproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** YAF.Classes.Base.csproj 1 Feb 2007 10:42:05 -0000 1.5 --- YAF.Classes.Base.csproj 10 Feb 2007 06:21:47 -0000 1.6 *************** *** 38,41 **** --- 38,44 ---- <SubType>ASPXCodeBehind</SubType> </Compile> + <Compile Include="BaseUserControl.cs"> + <SubType>ASPXCodeBehind</SubType> + </Compile> <Compile Include="ForumPage.cs"> <SubType>ASPXCodeBehind</SubType> |
Update of /cvsroot/yafdotnet/yafsrc/URLRewriter.NET/Parsers In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25871/yafsrc/URLRewriter.NET/Parsers Added Files: Tag: v1_0_2_NETv2 AddHeaderActionParser.cs AddressConditionParser.cs ConditionActionParser.cs ExistsConditionParser.cs ForbiddenActionParser.cs GoneActionParser.cs HeaderMatchConditionParser.cs IRewriteActionParser.cs IRewriteConditionParser.cs IfRedirectActionParser.cs IfRewriteActionParser.cs MethodConditionParser.cs NotAllowedActionParser.cs NotFoundActionParser.cs NotImplementedActionParser.cs PropertyMatchConditionParser.cs RedirectActionParser.cs RewriteActionParser.cs RewriteActionParserBase.cs SetCookieActionParser.cs SetPropertyActionParser.cs SetStatusActionParser.cs UrlMatchConditionParser.cs Log Message: URL Rewriter class --- NEW FILE: IfRewriteActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Parses the rewrite portion of the IF and IFNOT elements. /// </summary> public sealed class IfRewriteActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public IfRewriteActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return String.Format(Constants.AttributeAction, Constants.ElementIf, Constants.ElementRewrite); } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return true; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return true; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { XmlNode rewriteAttribute = node.Attributes.GetNamedItem(Constants.AttrRewrite); if (rewriteAttribute != null) { RewriteProcessing processing = RewriteProcessing.ContinueProcessing; XmlNode processingNode = node.Attributes.GetNamedItem(Constants.AttrProcessing); if (processingNode != null) { if (processingNode.Value == Constants.AttrValueRestart) { processing = RewriteProcessing.RestartProcessing; } else if (processingNode.Value == Constants.AttrValueStop) { processing = RewriteProcessing.StopProcessing; } else if (processingNode.Value != Constants.AttrValueContinue) { throw new ConfigurationException(MessageProvider.FormatString(Message.ValueOfProcessingAttribute, processingNode.Value, Constants.AttrValueContinue, Constants.AttrValueRestart, Constants.AttrValueStop), node); } } return new RewriteAction(rewriteAttribute.Value, processing); } else { return null; } } } } --- NEW FILE: GoneActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Summary description for GoneActionParser. /// </summary> public sealed class GoneActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public GoneActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementGone; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return false; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return false; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { return new GoneAction(); } } } --- NEW FILE: UrlMatchConditionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using Intelligencia.UrlRewriter.Conditions; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Parser for url match conditions. /// </summary> public sealed class UrlMatchConditionParser : IRewriteConditionParser { /// <summary> /// Parses the condition. /// </summary> /// <param name="node">The node to parse.</param> /// <returns>The condition parsed, or null if nothing parsed.</returns> public IRewriteCondition Parse(XmlNode node) { XmlNode matchAttr = node.Attributes.GetNamedItem(Constants.AttrUrl); if (matchAttr != null) { return new UrlMatchCondition(matchAttr.Value); } return null; } } } --- NEW FILE: NotImplementedActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Summary description for ForbiddenActionParser. /// </summary> public sealed class NotImplementedActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public NotImplementedActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementNotImplemented; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return false; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return false; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { return new NotImplementedAction(); } } } --- NEW FILE: ForbiddenActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Summary description for ForbiddenActionParser. /// </summary> public sealed class ForbiddenActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public ForbiddenActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementForbidden; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return false; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return false; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { return new ForbiddenAction(); } } } --- NEW FILE: IfRedirectActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Configuration; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Parses the redirect portion of the IF and IFNOT elements. /// </summary> public sealed class IfRedirectActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public IfRedirectActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return String.Format(Constants.AttributeAction, Constants.ElementIf, Constants.ElementRedirect); } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return true; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return true; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { XmlNode redirectAttribute = node.Attributes.GetNamedItem(Constants.AttrRedirect); if (redirectAttribute != null) { bool permanent = true; XmlNode permanentNode = node.Attributes.GetNamedItem(Constants.AttrPermanent); if (permanentNode != null) { permanent = Convert.ToBoolean(permanentNode.Value); } return new RedirectAction(redirectAttribute.Value, permanent); } else { return null; } } } } --- NEW FILE: RedirectActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Summary description for RedirectActionParser. /// </summary> public sealed class RedirectActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public RedirectActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementRedirect; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return false; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return true; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { XmlNode toNode = node.Attributes.GetNamedItem(Constants.AttrTo); if (toNode == null) { throw new ConfigurationException(MessageProvider.FormatString(Message.AttributeRequired, Constants.AttrTo), node); } bool permanent = true; XmlNode permanentNode = node.Attributes.GetNamedItem(Constants.AttrPermanent); if (permanentNode != null) { permanent = Convert.ToBoolean(permanentNode.Value); } RedirectAction action = new RedirectAction(toNode.Value, permanent); ParseConditions(node, action.Conditions, false, config); return action; } } } --- NEW FILE: IRewriteConditionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using Intelligencia.UrlRewriter.Conditions; namespace Intelligencia.UrlRewriter { /// <summary> /// Interface defining a parser which parses an XML node and returns the correct /// IRewriteCondition instance based on the node. /// </summary> public interface IRewriteConditionParser { /// <summary> /// Parses the node if possible. The parser may be called on a condition /// that it cannot parse, if it is registered on a common verb /// which is shared by several condition parsers (e.g., and). /// </summary> /// <param name="node">The node to parse.</param> /// <returns>The condition parsed. If the parser could not parse the node, /// it <strong>must</strong> return null.</returns> IRewriteCondition Parse(XmlNode node); } } --- NEW FILE: ConditionActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Net; using System.Xml; using System.Text.RegularExpressions; using System.Collections; using System.Configuration; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Conditions; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Parses the IF and IFNOT nodes. /// </summary> public sealed class ConditionActionParser : RewriteActionParserBase { /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementIf; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return true; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return true; } } /// <summary> /// Parses the action. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { ConditionalAction rule = new ConditionalAction(); // Process the conditions on the element. bool negative = (node.LocalName == Constants.ElementIfNot); ParseConditions(node, rule.Conditions, negative, config); // Process attribute-based actions. ReadAttributeActions(node, false, rule.Actions, (RewriterConfiguration)config); // Next, process the nested <if> and <ifnot> and non-final actions. ReadActions(node, false, rule.Actions, (RewriterConfiguration)config); // Finish off with any final actions. ReadAttributeActions(node, true, rule.Actions, (RewriterConfiguration)config); ReadActions(node, true, rule.Actions, (RewriterConfiguration)config); return rule; } private void ReadAttributeActions(XmlNode node, bool allowFinal, IList actions, RewriterConfiguration config) { int i = 0; while (i < node.Attributes.Count) { XmlNode attrNode = node.Attributes[i++]; IList parsers = config.ActionParserFactory.GetParsers(String.Format(Constants.AttributeAction, node.LocalName, attrNode.LocalName)); if (parsers != null) { foreach (IRewriteActionParser parser in parsers) { IRewriteAction action = parser.Parse(node, config); if (action != null) { if (action.Processing == RewriteProcessing.ContinueProcessing || allowFinal) { actions.Add(action); break; } } } } } } private void ReadActions(XmlNode node, bool allowFinal, IList actions, RewriterConfiguration config) { XmlNode childNode = node.FirstChild; while (childNode != null) { if (childNode.NodeType == XmlNodeType.Element) { IList parsers = config.ActionParserFactory.GetParsers(childNode.LocalName); if (parsers != null) { bool parsed = false; foreach (IRewriteActionParser parser in parsers) { IRewriteAction action = parser.Parse(childNode, config); if (action != null) { parsed = true; if ((action.Processing == RewriteProcessing.ContinueProcessing) ^ allowFinal) { actions.Add(action); break; } } } if (!parsed) { throw new ConfigurationException(MessageProvider.FormatString(Message.ElementNotAllowed, node.FirstChild.Name), node); } } } childNode = childNode.NextSibling; } } } } --- NEW FILE: IRewriteActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter { /// <summary> /// Interface defining a parser which parses an XML node and returns the correct /// IRewriteAction instance based on the node. /// </summary> public interface IRewriteActionParser { /// <summary> /// Parses the node if possible. The parser may be called on an action node /// that it cannot parse, if it is registered on a common verb /// which is shared by several action parsers (e.g., set). /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The action parsed. If the parser could not parse the node, /// it <strong>must</strong> return null.</returns> IRewriteAction Parse(XmlNode node, object config); /// <summary> /// The name of the action. /// </summary> string Name { get; } /// <summary> /// Whether the action allows nested actions. /// </summary> bool AllowsNestedActions { get; } /// <summary> /// Whether the action allows attributes. /// </summary> bool AllowsAttributes { get; } } } --- NEW FILE: RewriteActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Summary description for RewriteActionParser. /// </summary> public sealed class RewriteActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public RewriteActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementRewrite; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return false; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return true; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { XmlNode toNode = node.Attributes[Constants.AttrTo]; if (toNode.Value == null) { throw new ConfigurationException(MessageProvider.FormatString(Message.AttributeRequired, Constants.AttrTo), node); } XmlNode processingNode = node.Attributes[Constants.AttrProcessing]; RewriteProcessing processing = RewriteProcessing.ContinueProcessing; if (processingNode != null) { if (processingNode.Value == Constants.AttrValueRestart) { processing = RewriteProcessing.RestartProcessing; } else if (processingNode.Value == Constants.AttrValueStop) { processing = RewriteProcessing.StopProcessing; } else if (processingNode.Value != Constants.AttrValueContinue) { throw new ConfigurationException(MessageProvider.FormatString(Message.ValueOfProcessingAttribute, processingNode.Value, Constants.AttrValueContinue, Constants.AttrValueRestart, Constants.AttrValueStop), node); } } RewriteAction action = new RewriteAction(toNode.Value, processing); ParseConditions(node, action.Conditions, false, config); return action; } } } --- NEW FILE: AddHeaderActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Action parser for the add-header action. /// </summary> public sealed class AddHeaderActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public AddHeaderActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementAdd; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return false; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return true; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { XmlNode headerNameNode = node.Attributes.GetNamedItem(Constants.AttrHeader); if (headerNameNode == null) { throw new ConfigurationException(MessageProvider.FormatString(Message.AttributeRequired, Constants.AttrHeader), node); } XmlNode headerValueNode = node.Attributes.GetNamedItem(Constants.AttrValue); if (headerValueNode == null) { throw new ConfigurationException(MessageProvider.FormatString(Message.AttributeRequired, Constants.AttrValue), node); } return new AddHeaderAction(headerNameNode.Value, headerValueNode.Value); } } } --- NEW FILE: MethodConditionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using Intelligencia.UrlRewriter.Conditions; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Parser for method conditions. /// </summary> public sealed class MethodConditionParser : IRewriteConditionParser { /// <summary> /// Parses the condition. /// </summary> /// <param name="node">The node to parse.</param> /// <returns>The condition parsed, or null if nothing parsed.</returns> public IRewriteCondition Parse(XmlNode node) { XmlNode methodAttr = node.Attributes.GetNamedItem(Constants.AttrMethod); if (methodAttr != null) { return new MethodCondition(methodAttr.Value); } return null; } } } --- NEW FILE: PropertyMatchConditionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Conditions; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Parser for property match conditions. /// </summary> public sealed class PropertyMatchConditionParser : IRewriteConditionParser { /// <summary> /// Parses the condition. /// </summary> /// <param name="node">The node to parse.</param> /// <returns>The condition parsed, or null if nothing parsed.</returns> public IRewriteCondition Parse(XmlNode node) { XmlNode propertyAttr = node.Attributes.GetNamedItem(Constants.AttrProperty); if (propertyAttr != null) { string propertyName = propertyAttr.Value; XmlNode matchAttr = node.Attributes.GetNamedItem(Constants.AttrMatch); if (matchAttr != null) { return new PropertyMatchCondition(propertyName, matchAttr.Value); } else { throw new ConfigurationException(MessageProvider.FormatString(Message.AttributeRequired, Constants.AttrMatch), node); } } return null; } } } --- NEW FILE: HeaderMatchConditionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Conditions; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Parser for header match conditions. /// </summary> public sealed class HeaderMatchConditionParser : IRewriteConditionParser { /// <summary> /// Parses the condition. /// </summary> /// <param name="node">The node to parse.</param> /// <returns>The condition parsed, or null if nothing parsed.</returns> public IRewriteCondition Parse(XmlNode node) { XmlNode headerAttr = node.Attributes.GetNamedItem(Constants.AttrHeader); if (headerAttr != null) { string headerName = headerAttr.Value; XmlNode matchAttr = node.Attributes.GetNamedItem(Constants.AttrMatch); if (matchAttr != null) { return new PropertyMatchCondition(headerName, matchAttr.Value); } else { throw new ConfigurationException(MessageProvider.FormatString(Message.AttributeRequired, Constants.AttrMatch), node); } } return null; } } } --- NEW FILE: SetStatusActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Net; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Action parser for the set-status action. /// </summary> public sealed class SetStatusActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public SetStatusActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementSet; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return false; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return true; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { XmlNode statusCodeNode = node.Attributes.GetNamedItem(Constants.AttrStatus); if (statusCodeNode == null) { return null; } return new SetStatusAction((HttpStatusCode)Convert.ToInt32(statusCodeNode.Value)); } } } --- NEW FILE: AddressConditionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using Intelligencia.UrlRewriter.Conditions; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Parser for address conditions. /// </summary> public sealed class AddressConditionParser : IRewriteConditionParser { /// <summary> /// Parses the condition. /// </summary> /// <param name="node">The node to parse.</param> /// <returns>The condition parsed, or null if nothing parsed.</returns> public IRewriteCondition Parse(XmlNode node) { XmlNode addressAttr = node.Attributes.GetNamedItem(Constants.AttrAddress); if (addressAttr != null) { return new AddressCondition(addressAttr.Value); } return null; } } } --- NEW FILE: NotAllowedActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Summary description for NotAllowedActionParser. /// </summary> public sealed class NotAllowedActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public NotAllowedActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementNotAllowed; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return false; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return false; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { return new MethodNotAllowedAction(); } } } --- NEW FILE: RewriteActionParserBase.cs --- using System; using System.Xml; using System.Collections; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Conditions; using Intelligencia.UrlRewriter.Configuration; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Summary description for RewriteActionParserBase. /// </summary> public abstract class RewriteActionParserBase : IRewriteActionParser { /// <summary> /// Parses the action. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, null if no action parsed.</returns> public abstract IRewriteAction Parse(XmlNode node, object config); /// <summary> /// The name of the action. /// </summary> public abstract string Name { get; } /// <summary> /// Whether the action allows nested actions. /// </summary> public abstract bool AllowsNestedActions { get; } /// <summary> /// Whether the action allows attributes. /// </summary> public abstract bool AllowsAttributes { get; } /// <summary> /// Parses conditions from the node. /// </summary> /// <param name="node">The node.</param> /// <param name="conditions">Conditions list to add new conditions to.</param> /// <param name="negative">Whether the conditions should be negated.</param> /// <param name="config">Rewriter configuration</param> protected void ParseConditions(XmlNode node, IList conditions, bool negative, object config) { if ((config == null) || !(config is RewriterConfiguration)) { return; } // Parse attribute-based conditions. foreach (IRewriteConditionParser parser in ((RewriterConfiguration)config).ConditionParserPipeline) { IRewriteCondition condition = parser.Parse(node); if (condition != null) { conditions.Add(condition); } } // Now, process the nested <and> conditions. XmlNode childNode = node.FirstChild; while (childNode != null) { if (childNode.NodeType == XmlNodeType.Element) { if (childNode.LocalName == Constants.ElementAnd) { ParseConditions(childNode, conditions, negative, config); XmlNode childNode2 = childNode.NextSibling; node.RemoveChild(childNode); childNode = childNode2; continue; } } childNode = childNode.NextSibling; } } } } --- NEW FILE: NotFoundActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Summary description for NotFoundActionParser. /// </summary> public sealed class NotFoundActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public NotFoundActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementNotFound; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return false; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return false; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { return new NotFoundAction(); } } } --- NEW FILE: ExistsConditionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using Intelligencia.UrlRewriter.Conditions; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Parser for exists conditions. /// </summary> public sealed class ExistsConditionParser : IRewriteConditionParser { /// <summary> /// Parses the condition. /// </summary> /// <param name="node">The node to parse.</param> /// <returns>The condition parsed, or null if nothing parsed.</returns> public IRewriteCondition Parse(XmlNode node) { XmlNode existsAttr = node.Attributes.GetNamedItem(Constants.AttrExists); if (existsAttr != null) { return new ExistsCondition(existsAttr.Value); } return null; } } } --- NEW FILE: SetPropertyActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Action parser for the set-Property action. /// </summary> public sealed class SetPropertyActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public SetPropertyActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementSet; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return false; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return true; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { XmlNode propertyNameNode = node.Attributes.GetNamedItem(Constants.AttrProperty); if (propertyNameNode == null) { return null; } XmlNode propertyValueNode = node.Attributes.GetNamedItem(Constants.AttrValue); if (propertyValueNode == null) { throw new ConfigurationException(MessageProvider.FormatString(Message.AttributeRequired, Constants.AttrValue), node); } return new SetPropertyAction(propertyNameNode.Value, propertyValueNode.Value); } } } --- NEW FILE: SetCookieActionParser.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Xml; using System.Configuration; using Intelligencia.UrlRewriter.Utilities; using Intelligencia.UrlRewriter.Actions; using Intelligencia.UrlRewriter.Configuration; namespace Intelligencia.UrlRewriter.Parsers { /// <summary> /// Action parser for the set-cookie action. /// </summary> public sealed class SetCookieActionParser : RewriteActionParserBase { /// <summary> /// Default constructor. /// </summary> public SetCookieActionParser() { } /// <summary> /// The name of the action. /// </summary> public override string Name { get { return Constants.ElementSet; } } /// <summary> /// Whether the action allows nested actions. /// </summary> public override bool AllowsNestedActions { get { return false; } } /// <summary> /// Whether the action allows attributes. /// </summary> public override bool AllowsAttributes { get { return true; } } /// <summary> /// Parses the node. /// </summary> /// <param name="node">The node to parse.</param> /// <param name="config">The rewriter configuration.</param> /// <returns>The parsed action, or null if no action parsed.</returns> public override IRewriteAction Parse(XmlNode node, object config) { XmlNode cookieNameNode = node.Attributes.GetNamedItem(Constants.AttrCookie); if (cookieNameNode == null) { return null; } XmlNode cookieValueNode = node.Attributes.GetNamedItem(Constants.AttrValue); if (cookieValueNode == null) { throw new ConfigurationException(MessageProvider.FormatString(Message.AttributeRequired, Constants.AttrValue), node); } return new SetCookieAction(cookieNameNode.Value, cookieValueNode.Value); } } } |
From: Jaben C. <ja...@us...> - 2007-02-08 00:49:49
|
Update of /cvsroot/yafdotnet/yafsrc/URLRewriter.NET/Transforms In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25871/yafsrc/URLRewriter.NET/Transforms Added Files: Tag: v1_0_2_NETv2 Base64DecodeTransform.cs Base64Transform.cs DecodeTransform.cs EncodeTransform.cs IRewriteTransform.cs LowerTransform.cs StaticMappingTransform.cs UpperTransform.cs Log Message: URL Rewriter class --- NEW FILE: UpperTransform.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Transforms { /// <summary> /// Transforms the input to upper case. /// </summary> public sealed class UpperTransform : IRewriteTransform { /// <summary> /// Applies a transformation to the input string. /// </summary> /// <param name="input">The input string.</param> /// <returns>The transformed string.</returns> public string ApplyTransform(string input) { return input.ToUpper(); } /// <summary> /// The name of the action. /// </summary> public string Name { get { return Constants.TransformUpper; } } } } --- NEW FILE: Base64DecodeTransform.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Text; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Transforms { /// <summary> /// Base 64 encodes the input. /// </summary> public sealed class Base64Transform : IRewriteTransform { /// <summary> /// Applies a transformation to the input string. /// </summary> /// <param name="input">The input string.</param> /// <returns>The transformed string.</returns> public string ApplyTransform(string input) { return Convert.ToBase64String(Encoding.UTF8.GetBytes(input)); } /// <summary> /// The name of the action. /// </summary> public string Name { get { return Constants.TransformBase64Decode; } } } } --- NEW FILE: DecodeTransform.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Web; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Transforms { /// <summary> /// Url decodes the input. /// </summary> public sealed class DecodeTransform : IRewriteTransform { /// <summary> /// Applies a transformation to the input string. /// </summary> /// <param name="input">The input string.</param> /// <returns>The transformed string.</returns> public string ApplyTransform(string input) { return HttpUtility.UrlDecode(input); } /// <summary> /// The name of the action. /// </summary> public string Name { get { return Constants.TransformDecode; } } } } --- NEW FILE: IRewriteTransform.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; namespace Intelligencia.UrlRewriter { /// <summary> /// Interface for transforming replacements. /// </summary> public interface IRewriteTransform { /// <summary> /// Applies a transformation to the input string. /// </summary> /// <param name="input">The input string.</param> /// <returns>The transformed string.</returns> string ApplyTransform(string input); /// <summary> /// The name of the transform. /// </summary> string Name { get; } } } --- NEW FILE: EncodeTransform.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Web; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Transforms { /// <summary> /// Url encodes the input. /// </summary> public sealed class EncodeTransform : IRewriteTransform { /// <summary> /// Applies a transformation to the input string. /// </summary> /// <param name="input">The input string.</param> /// <returns>The transformed string.</returns> public string ApplyTransform(string input) { return HttpUtility.UrlEncode(input); } /// <summary> /// The name of the action. /// </summary> public string Name { get { return Constants.TransformEncode; } } } } --- NEW FILE: LowerTransform.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Transforms { /// <summary> /// Transforms the input to lower case. /// </summary> public sealed class LowerTransform : IRewriteTransform { /// <summary> /// Applies a transformation to the input string. /// </summary> /// <param name="input">The input string.</param> /// <returns>The transformed string.</returns> public string ApplyTransform(string input) { return input.ToLower(); } /// <summary> /// The name of the action. /// </summary> public string Name { get { return Constants.TransformLower; } } } } --- NEW FILE: StaticMappingTransform.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Collections.Specialized; namespace Intelligencia.UrlRewriter.Transforms { /// <summary> /// Default RewriteMapper, reads its maps from config. /// Note that the mapping is CASE-INSENSITIVE. /// </summary> public sealed class StaticMappingTransform : IRewriteTransform { /// <summary> /// Default constructor. /// </summary> /// <param name="name">The name of the mapping.</param> /// <param name="map">The mappings.</param> public StaticMappingTransform(string name, StringDictionary map) { _name = name; _map = map; } /// <summary> /// Maps the specified value in the specified map to its replacement value. /// </summary> /// <param name="input">The value being mapped.</param> /// <returns>The value mapped to, or null if no mapping could be performed.</returns> public string ApplyTransform(string input) { return _map[input]; } /// <summary> /// The name of the action. /// </summary> public string Name { get { return _name; } } private string _name; private StringDictionary _map; } } --- NEW FILE: Base64Transform.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Text; using Intelligencia.UrlRewriter.Utilities; namespace Intelligencia.UrlRewriter.Transforms { /// <summary> /// Base 64 encodes the input. /// </summary> public sealed class Base64DecodeTransform : IRewriteTransform { /// <summary> /// Applies a transformation to the input string. /// </summary> /// <param name="input">The input string.</param> /// <returns>The transformed string.</returns> public string ApplyTransform(string input) { return Encoding.UTF8.GetString(Convert.FromBase64String(input)); } /// <summary> /// The name of the action. /// </summary> public string Name { get { return Constants.TransformBase64; } } } } |
From: Jaben C. <ja...@us...> - 2007-02-08 00:49:49
|
Update of /cvsroot/yafdotnet/yafsrc/URLRewriter.NET/Utilities In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25871/yafsrc/URLRewriter.NET/Utilities Added Files: Tag: v1_0_2_NETv2 Constants.cs HttpContextFacade.cs IContextFacade.cs IPRange.cs Message.cs MessageProvider.cs TypeHelper.cs Log Message: URL Rewriter class --- NEW FILE: Message.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; namespace Intelligencia.UrlRewriter.Utilities { /// <summary> /// Message ids /// </summary> internal enum Message { AttributeNotAllowed, ElementNotAllowed, ElementNoAttributes, ElementNoElements, MappedValuesNotAllowed, ValueOfProcessingAttribute, AttributeRequired, FullTypeNameRequiresAssemblyName, AssemblyNameRequired, TypeNameRequired, MapAlreadyDefined, InvalidTypeSpecified, InputIsNotHex, AddressesNotOfSameType, ProductName, StoppingBecauseOfRule, RestartingBecauseOfRule, ResultNotFound, CallingErrorHandler, RewritingXtoY, RedirectingXtoY, TooManyRestarts } } --- NEW FILE: IContextFacade.cs --- using System; using System.Web; using System.Collections.Specialized; namespace Intelligencia.UrlRewriter.Utilities { /// <summary> /// Interface for a facade to the context. Useful for plugging out the HttpContext object /// in unit tests. /// </summary> public interface IContextFacade { /// <summary> /// Retrieves the application path. /// </summary> /// <returns>The application path.</returns> string GetApplicationPath(); /// <summary> /// Retrieves the raw url. /// </summary> /// <returns>The raw url.</returns> string GetRawUrl(); /// <summary> /// Retrieves the current request url. /// </summary> /// <returns>The request url.</returns> Uri GetRequestUrl(); /// <summary> /// Maps the url to the local file path. /// </summary> /// <param name="url">The url to map.</param> /// <returns>The local file path.</returns> string MapPath(string url); /// <summary> /// Sets the status code for the response. /// </summary> /// <param name="code">The status code.</param> void SetStatusCode(int code); /// <summary> /// Rewrites the request to the new url. /// </summary> /// <param name="url">The new url to rewrite to.</param> void RewritePath(string url); /// <summary> /// Sets the redirection location to the given url. /// </summary> /// <param name="url">The url of the redirection location.</param> void SetRedirectLocation(string url); /// <summary> /// Appends a header to the response. /// </summary> /// <param name="name">The header name.</param> /// <param name="value">The header value.</param> void AppendHeader(string name, string value); /// <summary> /// Adds a cookie to the response. /// </summary> /// <param name="cookie">The cookie to add.</param> void AppendCookie(HttpCookie cookie); /// <summary> /// Handles an error with the error handler. /// </summary> /// <param name="handler">The error handler to use.</param> void HandleError(IRewriteErrorHandler handler); /// <summary> /// Sets a context item. /// </summary> /// <param name="item">The item key</param> /// <param name="value">The item value</param> void SetItem(object item, object value); /// <summary> /// Retrieves a context item. /// </summary> /// <param name="item">The item key.</param> /// <returns>The item value.</returns> object GetItem(object item); /// <summary> /// Retrieves the HTTP method used by the request. /// </summary> /// <returns>The HTTP method.</returns> string GetHttpMethod(); /// <summary> /// Gets a collection of server variables. /// </summary> /// <returns></returns> NameValueCollection GetServerVariables(); /// <summary> /// Gets a collection of headers. /// </summary> /// <returns></returns> NameValueCollection GetHeaders(); /// <summary> /// Gets a collection of cookies. /// </summary> /// <returns></returns> HttpCookieCollection GetCookies(); } } --- NEW FILE: HttpContextFacade.cs --- using System; using System.Web; using System.Collections.Specialized; namespace Intelligencia.UrlRewriter.Utilities { /// <summary> /// A naive pass-through implementation of the ContextFacade on the HttpContext. /// Mock implementations would want to do something more interesting like implement checks that /// the actions were called. /// </summary> public class HttpContextFacade : IContextFacade { /// <summary> /// Retrieves the application path. /// </summary> /// <returns>The application path.</returns> public string GetApplicationPath() { return HttpContext.Current.Request.ApplicationPath; } /// <summary> /// Retrieves the raw url. /// </summary> /// <returns>The raw url.</returns> public string GetRawUrl() { return HttpContext.Current.Request.RawUrl; } /// <summary> /// Retrieves the current request url. /// </summary> /// <returns>The request url.</returns> public Uri GetRequestUrl() { return HttpContext.Current.Request.Url; } /// <summary> /// Maps the url to the local file path. /// </summary> /// <param name="url">The url to map.</param> /// <returns>The local file path.</returns> public string MapPath(string url) { return HttpContext.Current.Server.MapPath(url); } /// <summary> /// Sets the status code for the response. /// </summary> /// <param name="code">The status code.</param> public void SetStatusCode(int code) { HttpContext.Current.Response.StatusCode = code; } /// <summary> /// Rewrites the request to the new url. /// </summary> /// <param name="url">The new url to rewrite to.</param> public void RewritePath(string url) { HttpContext.Current.RewritePath(url); } /// <summary> /// Sets the redirection location to the given url. /// </summary> /// <param name="url">The url of the redirection location.</param> public void SetRedirectLocation(string url) { HttpContext.Current.Response.RedirectLocation = url; } /// <summary> /// Appends a header to the response. /// </summary> /// <param name="name">The header name.</param> /// <param name="value">The header value.</param> public void AppendHeader(string name, string value) { HttpContext.Current.Response.AppendHeader(name, value); } /// <summary> /// Adds a cookie to the response. /// </summary> /// <param name="cookie">The cookie to add.</param> public void AppendCookie(HttpCookie cookie) { HttpContext.Current.Response.AppendCookie(cookie); } /// <summary> /// Handles an error with the error handler. /// </summary> /// <param name="handler">The error handler to use.</param> public void HandleError(IRewriteErrorHandler handler) { handler.HandleError(HttpContext.Current); } /// <summary> /// Sets a context item. /// </summary> /// <param name="item">The item key</param> /// <param name="value">The item value</param> public void SetItem(object item, object value) { HttpContext.Current.Items[item] = value; } /// <summary> /// Retrieves a context item. /// </summary> /// <param name="item">The item key.</param> /// <returns>The item value.</returns> public object GetItem(object item) { return HttpContext.Current.Items[item]; } /// <summary> /// Retrieves the HTTP method used by the request. /// </summary> /// <returns>The HTTP method.</returns> public string GetHttpMethod() { return HttpContext.Current.Request.HttpMethod; } /// <summary> /// Gets a collection of server variables. /// </summary> /// <returns></returns> public NameValueCollection GetServerVariables() { return HttpContext.Current.Request.ServerVariables; } /// <summary> /// Gets a collection of headers. /// </summary> /// <returns></returns> public NameValueCollection GetHeaders() { return HttpContext.Current.Request.Headers; } /// <summary> /// Gets a collection of cookies. /// </summary> /// <returns></returns> public HttpCookieCollection GetCookies() { return HttpContext.Current.Request.Cookies; } } } --- NEW FILE: TypeHelper.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; namespace Intelligencia.UrlRewriter.Utilities { /// <summary> /// Helper class for dealing with types. /// </summary> internal sealed class TypeHelper { private TypeHelper() { } /// <summary> /// Loads and activates a type /// </summary> /// <param name="fullTypeName">The full name of the type to activate "TypeName, AssemblyName"</param> /// <param name="args">Arguments to pass to the constructor</param> /// <returns>The object</returns> public static object Activate(string fullTypeName, object[] args) { string[] components = fullTypeName.Split(",".ToCharArray(), 2); if (components.Length != 2) { throw new ArgumentOutOfRangeException("fullTypeName", fullTypeName, MessageProvider.FormatString(Message.FullTypeNameRequiresAssemblyName)); } return Activate(components[1].Trim(), components[0].Trim(), args); } /// <summary> /// Loads and activates a type /// </summary> /// <param name="assemblyName">The assembly name</param> /// <param name="typeName">The type name</param> /// <param name="args">Arguments to pass to the constructor</param> /// <returns>The object</returns> public static object Activate(string assemblyName, string typeName, object[] args) { if (assemblyName.Length == 0) { throw new ArgumentOutOfRangeException("assembly", assemblyName, MessageProvider.FormatString(Message.AssemblyNameRequired)); } if (typeName.Length == 0) { throw new ArgumentOutOfRangeException("typeName", typeName, MessageProvider.FormatString(Message.TypeNameRequired)); } return AppDomain.CurrentDomain.CreateInstanceAndUnwrap(assemblyName, typeName, false, 0, null, args, null, null, null); } } } --- NEW FILE: MessageProvider.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Resources; using System.Reflection; using System.Collections; namespace Intelligencia.UrlRewriter.Utilities { /// <summary> /// Message provider. /// </summary> internal sealed class MessageProvider { private MessageProvider() { } public static string FormatString(Message message, params object[] args) { string format; if (_messageCache.ContainsKey(message)) { format = (string)_messageCache[message]; } else { ResourceManager resources = new ResourceManager(Constants.Messages, Assembly.GetExecutingAssembly()); format = resources.GetString(message.ToString()); _messageCache.Add(message, format); } return String.Format(format, args); } private static Hashtable _messageCache = new Hashtable(); } } --- NEW FILE: IPRange.cs --- using System; using System.Net; using System.Text.RegularExpressions; namespace Intelligencia.UrlRewriter.Utilities { /// <summary> /// Represents a range of IP addresses. /// </summary> public sealed class IPRange { /// <summary> /// Constructor. /// </summary> /// <param name="address">A range of 1 ip address.</param> public IPRange(IPAddress address) { _minimumAddress = address; _maximumAddress = address; } /// <summary> /// Constructor. /// </summary> /// <param name="minimumAddress">Lowest IP address.</param> /// <param name="maximumAddress">Highest IP address.</param> public IPRange(IPAddress minimumAddress, IPAddress maximumAddress) { if (IPRange.Compare(minimumAddress, maximumAddress) == -1) { _minimumAddress = minimumAddress; _maximumAddress = maximumAddress; } else { _minimumAddress = maximumAddress; _maximumAddress = minimumAddress; } } /// <summary> /// Parses an IP address range. /// </summary> /// <remarks> /// ddd.ddd.ddd.ddd - single IP address /// ddd.ddd.ddd.* - class C range /// ddd.ddd.* - class B range /// ddd.* - class A range /// ddd.ddd.ddd.ddd - ccc.ccc.ccc.ccc - specific range /// </remarks> /// <param name="pattern">The pattern</param> /// <returns>The IPRange instance.</returns> public static IPRange Parse(string pattern) { pattern = Regex.Replace(pattern, @"([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\.\*", @"$1.0-$1.255"); pattern = Regex.Replace(pattern, @"([0-9]{1,3}\.[0-9]{1,3})\.\*", @"$1.0.0-$1.255.255"); pattern = Regex.Replace(pattern, @"([0-9]{1,3})\.\*", @"$1.0.0.0-$1.255.255.255"); string[] parts = pattern.Split('-'); if (parts.Length > 1) { return new IPRange(IPAddress.Parse(parts[0].Trim()), IPAddress.Parse(parts[1].Trim())); } else { return new IPRange(IPAddress.Parse(pattern.Trim())); } } /// <summary> /// Deteremines if the given IP address is in the range. /// </summary> /// <param name="address">The IP address.</param> /// <returns>True if the address is in the range.</returns> public bool InRange(IPAddress address) { return IPRange.Compare(MinimumAddress, address) <= 0 && IPRange.Compare(address, MaximumAddress) <= 0; } /// <summary> /// Minimum address (inclusive). /// </summary> public IPAddress MinimumAddress { get { return _minimumAddress; } } /// <summary> /// Maximum address (inclusive). /// </summary> public IPAddress MaximumAddress { get { return _maximumAddress; } } /// <summary> /// Compares two IPAddresses. /// Less than zero {left} is less than {right}. /// Zero {left} equals {right}. /// Greater than zero {left} is greater than {right}. /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <returns></returns> public static int Compare(IPAddress left, IPAddress right) { byte[] leftBytes = left.GetAddressBytes(); byte[] rightBytes = right.GetAddressBytes(); if (leftBytes.Length != rightBytes.Length) { throw new ArgumentOutOfRangeException(MessageProvider.FormatString(Message.AddressesNotOfSameType)); } for (int i = 0; i < leftBytes.Length; i++) { if (leftBytes[i] < rightBytes[i]) return -1; else if (leftBytes[i] > rightBytes[i]) return 1; } return 0; } private IPAddress _minimumAddress; private IPAddress _maximumAddress; } } --- NEW FILE: Constants.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; namespace Intelligencia.UrlRewriter.Utilities { /// <summary> /// Constants for the parser. /// </summary> internal sealed class Constants { private Constants() { } public static readonly string Messages = "Intelligencia.UrlRewriter.Messages"; public static readonly string RewriterNode = "rewriter"; public static readonly string RemoteAddressHeader = "REMOTE_ADDR"; public static readonly string Localhost = "localhost"; public static readonly string AttributeAction = "{0}-{1}"; public static readonly string HeaderXPoweredBy = "X-Powered-By"; public static readonly string AttrID = "id"; public static readonly string AttrAction = "action"; public static readonly string AttrExists = "exists"; public static readonly string AttrFile = "file"; public static readonly string AttrAddress = "address"; public static readonly string AttrHeader = "header"; public static readonly string AttrMethod = "method"; public static readonly string AttrMatch = "match"; public static readonly string AttrValue = "value"; public static readonly string AttrProperty = "property"; public static readonly string AttrStatus = "status"; public static readonly string AttrCookie = "cookie"; public static readonly string AttrRewrite = "rewrite"; public static readonly string AttrRedirect = "redirect"; public static readonly string AttrProcessing = "processing"; public static readonly string AttrPermanent = "permanent"; public static readonly string AttrValueContinue = "continue"; public static readonly string AttrValueRestart = "restart"; public static readonly string AttrValueStop = "stop"; public static readonly string AttrFrom = "from"; public static readonly string AttrName = "name"; public static readonly string AttrTo = "to"; public static readonly string AttrType = "type"; public static readonly string AttrVerb = "verb"; public static readonly string AttrCode = "code"; public static readonly string AttrUrl = "url"; public static readonly string AttrParser = "parser"; public static readonly string AttrTransform = "transform"; public static readonly string AttrLogger = "logger"; public static readonly string ElementIf = "if"; public static readonly string ElementIfNot = "ifnot"; public static readonly string ElementAnd = "and"; public static readonly string ElementAdd = "add"; public static readonly string ElementSet = "set"; public static readonly string ElementErrorHandler = "error-handler"; public static readonly string ElementForbidden = "forbidden"; public static readonly string ElementNotImplemented = "not-implemented"; public static readonly string ElementNotAllowed = "not-allowed"; public static readonly string ElementGone = "gone"; public static readonly string ElementNotFound = "not-found"; public static readonly string ElementRewrite = "rewrite"; public static readonly string ElementRedirect = "redirect"; public static readonly string ElementMap = "map"; public static readonly string ElementMapping = "mapping"; public static readonly string ElementDomain = "domain"; public static readonly string ElementServer = "server"; public static readonly string ElementVersion = "version"; public static readonly string ElementRegister = "register"; public static readonly string ElementExpires = "expires"; public static readonly string TransformDecode = "decode"; public static readonly string TransformEncode = "encode"; public static readonly string TransformBase64 = "base64"; public static readonly string TransformBase64Decode = "base64decode"; public static readonly string TransformLower = "lower"; public static readonly string TransformUpper = "upper"; } } |
From: Jaben C. <ja...@us...> - 2007-02-08 00:49:44
|
Update of /cvsroot/yafdotnet/yafsrc/URLRewriter.NET/Logging In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25871/yafsrc/URLRewriter.NET/Logging Added Files: Tag: v1_0_2_NETv2 DebugLogger.cs IRewriteLogger.cs NullLogger.cs Log Message: URL Rewriter class --- NEW FILE: NullLogger.cs --- using System; namespace Intelligencia.UrlRewriter.Logging { /// <summary> /// A logger which does nothing. /// </summary> public class NullLogger : IRewriteLogger { /// <summary> /// Writes a debug message. /// </summary> /// <param name="message">The message to write.</param> public void Debug(object message) {} /// <summary> /// Writes an informational message. /// </summary> /// <param name="message">The message to write.</param> public void Info(object message) {} /// <summary> /// Writes a warning message. /// </summary> /// <param name="message">The message to write.</param> public void Warn(object message) {} /// <summary> /// Writes an error. /// </summary> /// <param name="message">The message to write.</param> public void Error(object message) {} /// <summary> /// Writes an error. /// </summary> /// <param name="message">The message to write.</param> /// <param name="exception">The exception</param> public void Error(object message, Exception exception) {} /// <summary> /// Writes a fatal error. /// </summary> /// <param name="message">The message to write.</param> /// <param name="exception">The exception</param> public void Fatal(object message, Exception exception) {} } } --- NEW FILE: IRewriteLogger.cs --- using System; namespace Intelligencia.UrlRewriter.Logging { /// <summary> /// Interface for logging info from the Rewriter. /// </summary> public interface IRewriteLogger { /// <summary> /// Writes a debug message. /// </summary> /// <param name="message">The message to write.</param> void Debug(object message); /// <summary> /// Writes an informational message. /// </summary> /// <param name="message">The message to write.</param> void Info(object message); /// <summary> /// Writes a warning message. /// </summary> /// <param name="message">The message to write.</param> void Warn(object message); /// <summary> /// Writes an error. /// </summary> /// <param name="message">The message to write.</param> void Error(object message); /// <summary> /// Writes an error. /// </summary> /// <param name="message">The message to write.</param> /// <param name="exception">The exception</param> void Error(object message, Exception exception); /// <summary> /// Writes a fatal error. /// </summary> /// <param name="message">The message to write.</param> /// <param name="exception">The exception</param> void Fatal(object message, Exception exception); } } --- NEW FILE: DebugLogger.cs --- using System; namespace Intelligencia.UrlRewriter.Logging { /// <summary> /// A logger which writes out to the Debug window. /// </summary> public class DebugLogger : IRewriteLogger { /// <summary> /// Writes a debug message. /// </summary> /// <param name="message">The message to write.</param> public void Debug(object message) { System.Diagnostics.Debug.WriteLine(message); } /// <summary> /// Writes an informational message. /// </summary> /// <param name="message">The message to write.</param> public void Info(object message) { System.Diagnostics.Debug.WriteLine(message); } /// <summary> /// Writes a warning message. /// </summary> /// <param name="message">The message to write.</param> public void Warn(object message) { System.Diagnostics.Debug.WriteLine(message); } /// <summary> /// Writes an error. /// </summary> /// <param name="message">The message to write.</param> public void Error(object message) { System.Diagnostics.Debug.WriteLine(message); } /// <summary> /// Writes an error. /// </summary> /// <param name="message">The message to write.</param> /// <param name="exception">The exception</param> public void Error(object message, Exception exception) { System.Diagnostics.Debug.WriteLine(message); } /// <summary> /// Writes a fatal error. /// </summary> /// <param name="message">The message to write.</param> /// <param name="exception">The exception</param> public void Fatal(object message, Exception exception) { System.Diagnostics.Debug.WriteLine(message); } } } |
Update of /cvsroot/yafdotnet/yafsrc/URLRewriter.NET/Actions In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25871/yafsrc/URLRewriter.NET/Actions Added Files: Tag: v1_0_2_NETv2 AddHeaderAction.cs ConditionalAction.cs ForbiddenAction.cs GoneAction.cs IRewriteAction.cs MethodNotAllowedAction.cs NotFoundAction.cs NotImplementedAction.cs RedirectAction.cs RewriteAction.cs SetCookieAction.cs SetLocationAction.cs SetPropertyAction.cs SetStatusAction.cs Log Message: URL Rewriter class --- NEW FILE: IRewriteAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; namespace Intelligencia.UrlRewriter { /// <summary> /// Interface for executable actions. /// </summary> public interface IRewriteAction { /// <summary> /// Executes the action. /// </summary> /// <remarks> /// Note that it is important to set the correct properties on the context /// (e.g., StatusCode, Location), rather than directly implementing the action /// (e.g., RewritePath). This allows for the correct pipeline processing of /// all the specified rules. /// </remarks> /// <param name="context">The context to execute the action on.</param> void Execute(RewriteContext context); /// <summary> /// The Processing directive determines how the rewriter should continue /// processing after this action has executed. /// </summary> RewriteProcessing Processing { get; } } } --- NEW FILE: ForbiddenAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Net; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Returns a 403 Forbidden HTTP status code. /// </summary> public sealed class ForbiddenAction : SetStatusAction { /// <summary> /// Default constructor. /// </summary> public ForbiddenAction() : base(HttpStatusCode.Forbidden) { } } } --- NEW FILE: GoneAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Net; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Returns a 410 Gone HTTP status code. /// </summary> public sealed class GoneAction : SetStatusAction { /// <summary> /// Default constructor. /// </summary> public GoneAction() : base(HttpStatusCode.Gone) { } } } --- NEW FILE: AddHeaderAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Action that adds a given header. /// </summary> public class AddHeaderAction : IRewriteAction { /// <summary> /// Default constructor. /// </summary> /// <param name="header">The header name.</param> /// <param name="value">The header value.</param> public AddHeaderAction(string header, string value) { _header = header; _value = value; } /// <summary> /// The header name. /// </summary> public string Header { get { return _header; } set { _header = value; } } /// <summary> /// The header value. /// </summary> public string Value { get { return _value; } set { _value = value; } } /// <summary> /// Executes the action. /// </summary> /// <param name="context">The rewrite context.</param> public void Execute(RewriteContext context) { context.Headers.Add(Header, Value); } /// <summary> /// The Processing directive. /// </summary> public RewriteProcessing Processing { get { return RewriteProcessing.ContinueProcessing; } } private string _header; private string _value; } } --- NEW FILE: MethodNotAllowedAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Net; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Returns a 405 Method Not Allowed HTTP status code. /// </summary> public sealed class MethodNotAllowedAction : SetStatusAction { /// <summary> /// Default constructor. /// </summary> public MethodNotAllowedAction() : base(HttpStatusCode.MethodNotAllowed) { } } } --- NEW FILE: NotImplementedAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Net; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Returns a 501 Not Implemented HTTP status code. /// </summary> public sealed class NotImplementedAction : SetStatusAction { /// <summary> /// Default constructor. /// </summary> public NotImplementedAction() : base(HttpStatusCode.NotImplemented) { } } } --- NEW FILE: NotFoundAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Net; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Returns a 404 Not Found HTTP status code. /// </summary> public sealed class NotFoundAction : SetStatusAction { /// <summary> /// Default constructor. /// </summary> public NotFoundAction() : base(HttpStatusCode.NotFound) { } } } --- NEW FILE: SetPropertyAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Action that sets properties in the context. /// </summary> public class SetPropertyAction : IRewriteAction { /// <summary> /// Default constructor. /// </summary> /// <param name="name">The name of the variable.</param> /// <param name="value">The name of the value.</param> public SetPropertyAction(string name, string value) { _name = name; _value = value; } /// <summary> /// The name of the variable. /// </summary> public string Name { get { return _name; } set { _name = value; } } /// <summary> /// The value of the variable. /// </summary> public string Value { get { return _value; } set { _value = value; } } /// <summary> /// Executes the action. /// </summary> /// <param name="context">The rewrite context.</param> public void Execute(RewriteContext context) { context.Properties.Set(Name, Value); } /// <summary> /// The Processing directive. /// </summary> public RewriteProcessing Processing { get { return RewriteProcessing.ContinueProcessing; } } private string _name; private string _value; } } --- NEW FILE: SetCookieAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Web; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Action that sets a cookie. /// </summary> public class SetCookieAction : IRewriteAction { /// <summary> /// Default constructor. /// </summary> /// <param name="cookieName">The cookie name.</param> /// <param name="cookieValue">The cookie value.</param> public SetCookieAction(string cookieName, string cookieValue) { _name = cookieName; _value = cookieValue; } /// <summary> /// The name of the variable. /// </summary> public string Name { get { return _name; } set { _name = value; } } /// <summary> /// The value of the variable. /// </summary> public string Value { get { return _value; } set { _value = value; } } /// <summary> /// Executes the action. /// </summary> /// <param name="context">The rewrite context.</param> public void Execute(RewriteContext context) { HttpCookie cookie = new HttpCookie(Name, Value); context.Cookies.Add(cookie); } /// <summary> /// The Processing directive. /// </summary> public RewriteProcessing Processing { get { return RewriteProcessing.ContinueProcessing; } } private string _name; private string _value; } } --- NEW FILE: RedirectAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Net; using System.Web; using System.Collections; using Intelligencia.UrlRewriter.Conditions; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Redirect using 302 temporary redirect. /// </summary> public sealed class RedirectAction : SetLocationAction, IRewriteCondition { /// <summary> /// Default constructor. /// </summary> /// <param name="location">The location to set.</param> /// <param name="permanent">Whether the redirection is permanent.</param> public RedirectAction(string location, bool permanent) : base(location) { _permanent = permanent; } /// <summary> /// Executes the action. /// </summary> /// <param name="context">The rewriting context.</param> public override void Execute(RewriteContext context) { base.Execute(context); if (_permanent) { context.StatusCode = HttpStatusCode.Moved; } else { context.StatusCode = HttpStatusCode.Found; } } /// <summary> /// The Processing directive. /// </summary> public override RewriteProcessing Processing { get { return RewriteProcessing.StopProcessing; } } /// <summary> /// Determines if the rewrite rule matches. /// </summary> /// <param name="context"></param> /// <returns></returns> public bool IsMatch(RewriteContext context) { // Ensure the conditions are met. foreach (IRewriteCondition condition in Conditions) { if (!condition.IsMatch(context)) { return false; } } return true; } /// <summary> /// Conditions that must hold for the rule to fire. /// </summary> public IList Conditions { get { return _conditions; } } private ArrayList _conditions = new ArrayList(); private bool _permanent; } } --- NEW FILE: SetLocationAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Sets the Location. /// </summary> public abstract class SetLocationAction : IRewriteAction { /// <summary> /// Default constructor. /// </summary> /// <param name="location">The location (pattern) to set.</param> public SetLocationAction(string location) { _location = location; } /// <summary> /// The location to set. This can include replacements referencing the matched pattern, /// for example $1, $2, ... $n and ${group} as well as ${ServerVariable} and mapping, e.g., /// ${MapName:$1}. /// </summary> public string Location { get { return _location; } set { _location = value; } } /// <summary> /// Executes the action. /// </summary> /// <param name="context">The rewriting context.</param> public virtual void Execute(RewriteContext context) { context.Location = context.ResolveLocation(context.Expand(Location)); } /// <summary> /// The Processing directive. /// </summary> public virtual RewriteProcessing Processing { get { return RewriteProcessing.ContinueProcessing; } } private string _location; } } --- NEW FILE: SetStatusAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Net; using System.Web; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Sets the StatusCode. /// </summary> public class SetStatusAction : IRewriteAction { /// <summary> /// Default constructor. /// </summary> /// <param name="statusCode">The status code to set.</param> public SetStatusAction(HttpStatusCode statusCode) { _statusCode = statusCode; } /// <summary> /// The status code. /// </summary> public HttpStatusCode StatusCode { get { return _statusCode; } set { _statusCode = value; } } /// <summary> /// Executes the action. /// </summary> /// <param name="context">The rewriting context.</param> public virtual void Execute(RewriteContext context) { context.StatusCode = StatusCode; } /// <summary> /// The Processing directive. /// </summary> public RewriteProcessing Processing { get { if ((int)StatusCode >= 300) { return RewriteProcessing.StopProcessing; } else { return RewriteProcessing.ContinueProcessing; } } } private HttpStatusCode _statusCode; } } --- NEW FILE: ConditionalAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Collections; using Intelligencia.UrlRewriter.Conditions; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// A Conditional Action /// </summary> public class ConditionalAction : IRewriteAction, IRewriteCondition { /// <summary> /// Default constructor. /// </summary> public ConditionalAction() { } /// <summary> /// Conditions that must hold for the rule to fire. /// </summary> public IList Conditions { get { return _conditions; } } /// <summary> /// Child rules. /// </summary> public IList Actions { get { return _actions; } } /// <summary> /// Determines if the action matches the current context. /// </summary> /// <param name="context">The context to match on.</param> /// <returns>True if the condition matches.</returns> public virtual bool IsMatch(RewriteContext context) { // Ensure the conditions are met. foreach (IRewriteCondition condition in Conditions) { if (!condition.IsMatch(context)) { return false; } } return true; } /// <summary> /// Executes the rule. /// </summary> /// <param name="context"></param> public virtual void Execute(RewriteContext context) { // Execute the actions. for (int i = 0; i < Actions.Count; i++) { IRewriteCondition condition = Actions[i] as IRewriteCondition; if (condition == null || condition.IsMatch(context)) { IRewriteAction action = Actions[i] as IRewriteAction; action.Execute(context); if (action.Processing != RewriteProcessing.ContinueProcessing) { _processing = action.Processing; return; } } } } /// <summary> /// Processing directive. /// </summary> public RewriteProcessing Processing { get { return _processing; } } private RewriteProcessing _processing = RewriteProcessing.ContinueProcessing; private ArrayList _actions = new ArrayList(); private ArrayList _conditions = new ArrayList(); } } --- NEW FILE: RewriteAction.cs --- // UrlRewriter - A .NET URL Rewriter module // Version 1.7 // // Copyright 2006 Intelligencia // Copyright 2006 Seth Yates // using System; using System.Web; using System.Collections; using Intelligencia.UrlRewriter.Conditions; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Rewrites in-place. /// </summary> public sealed class RewriteAction : SetLocationAction, IRewriteCondition { /// <summary> /// Default constructor. /// </summary> /// <param name="location">The location to set.</param> /// <param name="processing">The processing directive.</param> public RewriteAction(string location, RewriteProcessing processing) : base(location) { _processing = processing; } /// <summary> /// Executes the action. /// </summary> /// <param name="context">The rewrite context.</param> public override void Execute(RewriteContext context) { base.Execute(context); } /// <summary> /// The Processing directive. /// </summary> public override RewriteProcessing Processing { get { return _processing; } } /// <summary> /// Determines if the rewrite rule matches. /// </summary> /// <param name="context"></param> /// <returns></returns> public bool IsMatch(RewriteContext context) { // Ensure the conditions are met. foreach (IRewriteCondition condition in Conditions) { if (!condition.IsMatch(context)) { return false; } } return true; } /// <summary> /// Conditions that must hold for the rule to fire. /// </summary> public IList Conditions { get { return _conditions; } } private ArrayList _conditions = new ArrayList(); private RewriteProcessing _processing; } } |