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

    • My son is in Monaco right now, and I was checking his location in Apple's Find My app. I noticed that Prince Albert's Palace was blurred out on the satellite imagery in both Find My and Apple Maps. I checked Google Maps, and the palace wasn't blurred there. Does Apple have some kind of process where property owners can request that their homes be blurred on Apple Maps?  
    • No, it was THAT ugly and I’d rather forget it completely existed.
    • There is a lot of reasons not to use Edge but faster fixes and security updates is not one of them.
    • Can't reproduce. I installed Edge, went to neowin.net > accepted the cookie consent > used menu to go to forums, everything loads and I can browse around the forums. If you can't interact with the dialog on the forums for some reason, go to the main site and accept the cookie consent there? It is true that the site will not function properly until the cookie consent is accepted or rejected,. it's a legal requirement and I also know that certain VPN/ad blockers block it, which is a user related issue and not a neowin.net problem.   This is not our cookie consent dialog. Gotta love browser hijacking... /s Edit: this may be what Californians see, I will confirm with our consent provider.
    • Google Chrome 149.0.7827.115 (offline installer) by Razvan Serea The web browser is arguably the most important piece of software on your computer. You spend much of your time online inside a browser: when you search, chat, email, shop, bank, read the news, and watch videos online, you often do all this using a browser. Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. Use one box for everything--type in the address bar and get suggestions for both search and Web pages. Thumbnails of your top sites let you access your favorite pages instantly with lightning speed from any new tab. Desktop shortcuts allow you to launch your favorite Web apps straight from your desktop. Chrome has many useful features built in, including automatic full-page translation and access to thousands of apps, extensions, and themes from the Chrome Web Store. Google Chrome is one of the best solutions for Internet browsing giving you high level of security, speed and great features. Important to know! The offline installer links do not include the automatic update feature. Download web installer: Google Chrome Web 32-bit | Google Chrome 64-bit | Freeware Download: Google Chrome Offline Installer 64-bit | Direct Link | 131.0 MB Download: Google Chrome Offline Installer 32-bit | Direct Link | 119.0 MB Download page: Google Chrome Portable Download: Chrome ARM64 | Direct Link View: Chrome Website | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Month Later
      Clizby earned a badge
      One Month Later
    • One Month Later
      Timaximus earned a badge
      One Month Later
    • Week One Done
      Timaximus earned a badge
      Week One Done
    • Rookie
      FBSPL went up a rank
      Rookie
    • First Post
      davidbazooked earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      491
    2. 2
      PsYcHoKiLLa
      170
    3. 3
      +Edouard
      164
    4. 4
      Steven P.
      85
    5. 5
      ATLien_0
      76
  • Tell a friend

    Love Neowin? Tell a friend!