Recommended Posts

  • 2 months later...

Could you add daylight savings setting too.

btw c# example

public partial class Login : System.Web.UI.Page

{

private String NeowinLoginPage = "https://www.neowin.net/login/?url={0}";

private String NeowinTicketPage = "https://www.neowin.net/login/checkticket.php?ticket={0}";

protected void Page_Load(object sender, EventArgs e)

{

if (Request.QueryString.Get("ticket") != null)

{

System.Net.HttpWebRequest neowinRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(string.Format(NeowinTicketPage, Request.QueryString.Get("ticket")));

System.Net.HttpWebResponse neowinResponse = (System.Net.HttpWebResponse)neowinRequest.GetResponse();

System.IO.Stream receiveStream = neowinResponse.GetResponseStream();

System.Text.Encoding encode = System.Text.Encoding.GetEncoding("utf-8");

System.IO.StreamReader readStream = new System.IO.StreamReader(receiveStream, encode);

String SiteResponse = readStream.ReadToEnd();

readStream.Close();

neowinResponse.Close();

String[] NeowinData = SiteResponse.Split();

if (NeowinData[0] == "no")

{

Response.Write("Sorry, you could not be logged in, check your username and password.");

}

else

{

//Succesfully logged in.

Response.Write("You've been succesfully logged in..\n");

Response.Write("<br /><br />\n<strong>Username:</strong> " + NeowinData[1] + "<br />\n");

Response.Write("<strong>E-mail:</strong> " + NeowinData[2] + "<br />\n");

Response.Write("<strong>Group:</strong> " + NeowinData[5] + "<br />\n");

Response.Write("<strong>Member ID:</strong> " + NeowinData[4] + "<br />\n");

Response.Write("<strong>Time Offset:</strong> " + DateTime.UtcNow.AddHours(Convert.ToDouble(NeowinData[3])).ToLongTimeString());

}

}

else

{

Response.Redirect(String.Format(NeowinLoginPage, Request.Url.AbsoluteUri));

}

}

}

  • 1 year later...

Is it possible you can edit this so it doesn't strip out the URL encoded querystring?

When you pass a url that has index.php?page=whatever, the ?page=whatever gets stripped and that makes my program stop working. There's no way I can get around this as far as I know.

  • 2 weeks later...
  • 8 months later...

Done a HttpModule for ASP.NET:

Neowin.ExternalUser.zip

Make sure you do the module and configuration plumbing in your web.config:

&lt;?xml version="1.0"?&gt;
&lt;!-- 
	Note: As an alternative to hand editing this file you can use the 
	web admin tool to configure settings for your application. Use
	the Website-&gt;Asp.Net Configuration option in Visual Studio.
	A full list of settings and comments can be found in 
	machine.config.comments usually located in 
	\Windows\Microsoft.Net\Framework\v2.x\Config 
--&gt;
&lt;configuration&gt;
	&lt;configSections&gt;
		&lt;section name="neowin" type="Neowin.ExternalUser.NeowinExternalLoginConfigurationSection, Neowin.ExternalUser"/&gt;
	&lt;/configSections&gt;
	&lt;neowin myUrl="{your url here}"/&gt;
	&lt;appSettings/&gt;
	&lt;connectionStrings/&gt;
	&lt;system.web&gt;
		&lt;!-- 
			Set compilation debug="true" to insert debugging 
			symbols into the compiled page. Because this 
			affects performance, set this value to true only 
			during development.
		--&gt;
		&lt;compilation debug="true"/&gt;
		&lt;!--
			The &lt;authentication&gt; section enables configuration 
			of the security authentication mode used by 
			ASP.NET to identify an incoming user. 
		--&gt;
		&lt;authentication mode="Windows"/&gt;
		&lt;!--
			The &lt;customErrors&gt; section enables configuration 
			of what to do if/when an unhandled error occurs 
			during the execution of a request. Specifically, 
			it enables developers to configure html error pages 
			to be displayed in place of a error stack trace.

		&lt;customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"&gt;
			&lt;error statusCode="403" redirect="NoAccess.htm" /&gt;
			&lt;error statusCode="404" redirect="FileNotFound.htm" /&gt;
		&lt;/customErrors&gt;
		--&gt;
		&lt;httpModules&gt;
			&lt;add name="NeowinLoginModule" type="Neowin.ExternalUser.NeowinLoginModule, Neowin.ExternalUser"/&gt;
		&lt;/httpModules&gt;
	&lt;/system.web&gt;
&lt;/configuration&gt;

  • 9 months later...

We've made some changes to the script. The biggest thing is that it now uses the Finity style, and offers more details. Generally, it feels better.

The other thing is for developers of Neowin-based services. You can now pass &img=http://mydomain.com/neowin-login.png on the login URL, and that image will appear at the top left of the site, like so: https://www.neowin.net/login/?img=http://ww...ser%2Fticket%2F

It offers that extra bit of branding and clarity to the user.

The image you use should be 48px high, and only as wide as you need. There should be 2 or 3 pixels of padding around the image, so really the height is about 42px. Make sure it is a transparent PNG, so our background can be seen through it. Remember, you're branding Neowin, it better look nice :p

It's used for Neorequest, Shift Linux, and Ste's IRC logs. It just lets Neowin users log into an external site, without giving away their username and password, while the external site knows for certain that they are legitimate members.

It's used for Neorequest, Shift Linux, and Ste's IRC logs. It just lets Neowin users log into an external site, without giving away their username and password, while the external site knows for certain that they are legitimate members.

also for Quotes, and the Neowin Gamers Index (going to be doing some work on this at sometime or other).

It's used for Neorequest, Shift Linux, and Ste's IRC logs. It just lets Neowin users log into an external site, without giving away their username and password, while the external site knows for certain that they are legitimate members.

Good work Simon, hopefully we will be putting out a sweet new version of NeoRequest soon so I will whip up a decent logo for it.

Thanks

  • 2 weeks later...
  • 2 years later...
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Any Video Converter Free 9.2.3 by Razvan Serea Any Video Converter is an All-in-One video converting tool with an easy-to-use graphical interface, fast converting speed and excellent video quality. Any Video Converter supports all popular video formats and converts your videos to different video formats including MP4, MOV, MKV, M2TS, M4V, MPEG, AVI, WMV, ASF, OGV, WEBM, and more. It supports converting videos to customized percent (50%, 100%, 200%, and more) or resolution (480p, 720p, 1080p, 4K, and more); It supports encoding videos into x264, x265, h263p, xvid, mpeg, wmv, and more. Any Video Converter Free key features: Compatible with Windows 11/10/8.1/8/7 (32-64bit) User interface are available in 14 languages Convert all kinds of video formats including high-definition videos Extract audio from any videos and save as MP3/WMA for your mp3 player Take snapshot from any videos and build your own picture collection Support high-definition for both input and output Batch add videos from hard drive and batch convert Customize output parameters completely as you like Manage your output videos files by group or output profile Merge several video files into a single and long one Clip a video into segments Free Audio Filter: Adjust audio volume and add audio effects Crop frame size to remove black bars and retain what you want only Adjust the brightness, contrast, saturation Rotate or flip or add noise/sharpen effects Produce output video with subtitles of your own dialogue and much, much more... Any Video Converter Free 9.2.3 changelog: Fixed video download engine auto-update failures. Added custom speed control support in the speed change tool. Added support for downloading YouTube AI-generated subtitles. Added support for preserving original audio stream in the format convert tool (e.g., Dolby Atmos, DTS:X). Fixed other bugs and improved overall performance. Download: Any Video Converter Free 9.2.3 | 7.6 MB (Freeware) View: Any Video Converter Free Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Not sure what country you’re in but in many countries you can absolutely jail the sellers behind businesses… in fact I’d say in most countries you can do that
    • I guess we are done since you refuse to read my comment you replied to or my other comment in another thread you were also a part of here.
    • I hate Slack, but Teams is much worse - maybe they've already optimized it, but it was a huge slog the last time I've checked about half a year ago. I miss my Skype.
    • Just ended up switching to Ubuntu. Not sure why I waited.
  • Recent Achievements

    • Dedicated
      jordanspringer earned a badge
      Dedicated
    • Rookie
      Rimplesnort went up a rank
      Rookie
    • One Year In
      Markus94287 earned a badge
      One Year In
    • One Month Later
      Markus94287 earned a badge
      One Month Later
    • Week One Done
      Markus94287 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      510
    2. 2
      +Edouard
      175
    3. 3
      PsYcHoKiLLa
      155
    4. 4
      ATLien_0
      91
    5. 5
      Steven P.
      79
  • Tell a friend

    Love Neowin? Tell a friend!