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

    • Yes for me, I installed 'old calculator' (Windows 7 calculator) in its place since it is more useful to me. I think paint is the only one I left installed
    • eh I'll wait for the June 2026 MVS ISO downloads which should be coming out next Tuesday June 16 and possibly contain build 8655 instead of 8653
    • read this recent topic in another forum: https://www.askwoody.com/forums/topic/still-on-win-10-and-happy-to-be-there/ some people are happy sticking with Win10
    • Cooler Master MasterFrame 600 PC case is now 33% off on Amazon by Ivan Jenic The Cooler Master MasterFrame 600 is currently $109.99 on Amazon, down from its original $164.99 list price. That's 33% off and $55 saved on this premium aluminum mid-tower case with a modular design. If you're upgrading your PC case and want something that doesn't force you into a rigid layout, the MasterFrame 600 is worth a look. The case is built around the Cooler Master's FreeForm 2.0 platform, which lets you reconfigure the internal structure according to your hardware. Magnetic side panels allow for straightforward adjustments, and the case supports everything from Mini-ITX to E-ATX motherboards without compromise. There's also generous cooling headroom. Four pre-installed PWM fans handle airflow out of the box. GPU clearance goes up to 410mm, and the case supports radiators up to 420mm with room for three simultaneously. Truth be told, this might not be the prettiest case on the market, but it’s highly functional. The aluminum construction keeps the whole thing lightweight despite its size, and the finish looks noticeably better than the plastic mid-towers competing at this price point. If you want a serious, flexible case that prioritizes function over flashy aesthetics like RGB lighting, the MasterFrame 600 delivers at a reasonable price. Cooler Master MasterFrame 600 - $109.99 | 33% off on Amazon This Amazon deal is US-specific and not available in other regions unless specified. This is a first-party seller link (at the time of article publishing); ensure that you also purchase from a first-party seller link only. If you don't like it or want to look at more options, check out the previous deals that we have covered, OR you can also visit Amazon US deals page. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. As an Amazon Associate, we earn from qualifying purchases.
  • Recent Achievements

    • Rookie
      restore went up a rank
      Rookie
    • Very Popular
      AndrewSteel earned a badge
      Very Popular
    • Veteran
      Taliseian went up a rank
      Veteran
    • One Month Later
      Clizby earned a badge
      One Month Later
    • One Month Later
      Timaximus earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      509
    2. 2
      +Edouard
      162
    3. 3
      PsYcHoKiLLa
      155
    4. 4
      ATLien_0
      82
    5. 5
      Steven P.
      79
  • Tell a friend

    Love Neowin? Tell a friend!