Custom SQL Queries |
Post Reply ![]() |
Author | |
Desperado ![]() Senior Member ![]() ![]() Joined: 27 January 2005 Location: United States Status: Offline Points: 1143 |
![]() ![]() ![]() ![]() ![]() Posted: 04 February 2005 at 10:38am |
All,
Edited by Desperado |
|
The Desperado
Dan Seligmann. Work: http://www.mags.net Personal: http://www.desperado.com |
|
![]() |
|
kspare ![]() Senior Member ![]() Joined: 26 January 2005 Location: Canada Status: Offline Points: 334 |
![]() ![]() ![]() ![]() ![]() |
heh, I know what you mean Dan, since i've gotten your code, i've gone miles and miles with it! I'll see if I can get some screen shots of mine up. I've gone as far as domain admins having complete control over editting users, lost passwords. A daily email notification of spam, hourly notification or none at all. Password retrieval, auto logins from the email notification, I actually developed a way to have it integrated into outlook 2000-2003 as a folder. so you just simply click on it and your logged in. Like Dan says..once you get going it's VERY hard to stop! |
|
![]() |
|
Desperado ![]() Senior Member ![]() ![]() Joined: 27 January 2005 Location: United States Status: Offline Points: 1143 |
![]() ![]() ![]() ![]() ![]() |
Kevin, Can you "Expand" on "I actually developed a way to have it integrated into outlook 2000-2003 as a folder. so you just simply click on it and your logged in."? Dan |
|
The Desperado
Dan Seligmann. Work: http://www.mags.net Personal: http://www.desperado.com |
|
![]() |
|
kspare ![]() Senior Member ![]() Joined: 26 January 2005 Location: Canada Status: Offline Points: 334 |
![]() ![]() ![]() ![]() ![]() |
Try this out, it will actually work. In outlook. Create a new folder called "spam" or whatever you want. Right click on the folder and click properties. Go to Homepage Tab Click show homepage by default for this folder. paste in this link: http://www.ksphosting.com/spam/autoauth.asp?username=spamdem o@ksphosting.com&password=demo click ok. Each time you click on that folder, it will automatically bring up your spam page.
|
|
![]() |
|
Desperado ![]() Senior Member ![]() ![]() Joined: 27 January 2005 Location: United States Status: Offline Points: 1143 |
![]() ![]() ![]() ![]() ![]() |
Kevin, Outlook works and it is very cool ... need to see if there is any way to coerce OE to do the same. Dan |
|
The Desperado
Dan Seligmann. Work: http://www.mags.net Personal: http://www.desperado.com |
|
![]() |
|
kspare ![]() Senior Member ![]() Joined: 26 January 2005 Location: Canada Status: Offline Points: 334 |
![]() ![]() ![]() ![]() ![]() |
from what I could see...OE doesn't support the homepage function. |
|
![]() |
|
LogSat ![]() Admin Group ![]() ![]() Joined: 25 January 2005 Location: United States Status: Offline Points: 4104 |
![]() ![]() ![]() ![]() ![]() |
Kevin,
Awesome idea for Outlook! VERY cool, thanks for the tip! |
|
![]() |
|
kspare ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
kinda cool hey :) I guess it would work with a manual login, but I am trying to simplify the lives of my users as much as I can when it comes to spam.
|
|
![]() |
|
fclass ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
What does the autoauth.asp page look like?
|
|
![]() |
|
Desperado ![]() Senior Member ![]() ![]() Joined: 27 January 2005 Location: United States Status: Offline Points: 1143 |
![]() ![]() ![]() ![]() ![]() |
I do not know what Kevin did but ... All I did was take my original authenticate.asp and stripped all the html out then:
Replaced the request.form entries with request.querystring as: EmailTo = Request.QueryString("UserName") Password = Request.QueryString("Password") Then did all my usual SQL queries and security tests and id all was well, redirected to my menu and if it failed redirected to the original authenticate.asp Does that help?
Regards, |
|
The Desperado
Dan Seligmann. Work: http://www.mags.net Personal: http://www.desperado.com |
|
![]() |
|
LogSat ![]() Admin Group ![]() ![]() Joined: 25 January 2005 Location: United States Status: Offline Points: 4104 |
![]() ![]() ![]() ![]() ![]() |
Dan,
Two possible problems. If that is really all you modified, then: 1. You should have Request.QueryString("EmailAddress") not "UserName" unless you changed the property in the edit field. 2. The form submits a POST request, not a GET, so the Request.QueryString will not have any information in it. We modified the authenticate.asp as follows (and will soon update the one on the website). It has code at the top to generalize the Request collection, adapting it so it can read data both if there's a GET or a POST request. The new code is as follows. It will allow users to bookmark the ListSpam.asp page as follows: ListSpam.asp?EmailAddress=JohnDoe@somewhere.com&Passwo rd=123456 <!--#include file="db_connect.asp"--> <% if StrComp("POST", Request.ServerVariables("REQUEST_METHOD"), vbTextCompare) = 0 then Set RequestCollection = Request.Form else Set RequestCollection = Request.QueryString End if If Len(Session("EmailTo")) < 1 Then EmailTo = RequestCollection("EmailAddress") If Len(EmailTo) < 3 Then %> <html> <head> <title>Spam Filter - Login</title> </head> <body> <form method="post" name="Login"> <table align="center" border="1" cellpadding="1" cellspacing="1"> <tr><td align="center" colspan="2"><h2>Please Login</h2></td></tr> <tr> <td align="right">Email Address:</td> <td><input type="text" size="15" name="EmailAddress"></td> </tr> <tr> <td align="right">Password:</td> <td><input type="password" size="15" name="Password"></td> </tr> <tr> <td align="center" colspan="2"> <input type="submit" value="Login"> <input type="reset" value="Clear"> </td> </tr> <tr><td align="center" colspan="2"><a href="Register.asp"> ; ;Register</a></td></tr> </table> </form> </body> </html> <% Response.End Else 'Generate query. SQL = "SELECT Password " SQL = SQL & "FROM tblLogins " SQL = SQL & "WHERE EMail = '" & EmailTo & "'" Set rs = con.Execute(SQL) Failure = False If rs.EOF Then Failure = True ElseIf IsNull(rs("Password")) Then Failure = True ElseIf Len(rs("Password")) < 1 Then Failure = True ElseIf rs("Password") <> RequestCollection("Password") Then Failure = True End If If Failure Then %> <html> <head> <title>Spam Filter - Failed Login</title> </head> <body> <h2 align="center">The password you entered was incorrect!</h2> <p align="center"><a href="ListSpam.asp">Try Again</a></p> </body> </html> <% Response.End Else Session("EmailTo") = EmailTo End If End If End If %> Edited by LogSat |
|
![]() |
|
Desperado ![]() Senior Member ![]() ![]() Joined: 27 January 2005 Location: United States Status: Offline Points: 1143 |
![]() ![]() ![]() ![]() ![]() |
Roberto, Indeed it is not everything I changed and I have changed the Field name BUT ... I just had set up a "Quickie" independent login script from the normal one just to test out Kevins "Cool" Outlook" inclusion. The unfortunate problem is that nearly all our customers use Outlook Express and that simply won't work unless I just can not find the options. Our Login script needed to be IDENTICAL to 2 other login we have and it does not require an email address for the login and the rest of the ASP code gets the users email address from our master accounting database based on their login and also retrieves their account status as well as their "Privilege Level" It also will not let them login if their account is not paid up to date so ... As I had stated before, I am so far away from the originam that I do not even remember what the original was! Dan. S. |
|
The Desperado
Dan Seligmann. Work: http://www.mags.net Personal: http://www.desperado.com |
|
![]() |
|
kspare ![]() Senior Member ![]() Joined: 26 January 2005 Location: Canada Status: Offline Points: 334 |
![]() ![]() ![]() ![]() ![]() |
Here is my code. You'll see I also collect stats on when people automatically login as well. <!--#include file="db_connect.asp"-->
If rs.EOF Then If Failure Then SessionGet SessionImpersonate ClearSession Session.Abandon %> AutoLogins = rs("AutoLogins") + 1 SQL = "UPDATE tblLogins " %> Edited by kspare |
|
![]() |
|
kspare ![]() Senior Member ![]() Joined: 26 January 2005 Location: Canada Status: Offline Points: 334 |
![]() ![]() ![]() ![]() ![]() |
I also added a notification field for everyone profile in the database. Here are the notification scripts. The script registers you in, then passes you onto the authentication.asp page, which reads the info and then logs you in. Basically this allows me the have multiple methods of logins come to a central location so I don't have to change things in other places. I also have my spam in frames, so our logo sits at the top and never has to change, with only the bottom frame changing. It also allows us to always have the address as www.ksphosting.com/spam in the address bar, instead of having all the extra asp parameters showing. <!--#include file="db_connect.asp"--> END IF SUB SendMessage1(strEmail, lMessageCount) SQL = "SELECT Password " MessageDate = Now END SUB SUB SendMessage2(strEmail, lMessageCount) END SUB
Edited by kspare |
|
![]() |
|
kspare ![]() Senior Member ![]() Joined: 26 January 2005 Location: Canada Status: Offline Points: 334 |
![]() ![]() ![]() ![]() ![]() |
I also modified the register page to work with autoauth, so once you register, you can click the link on the screen and it will automatically log you in. This also works with the notification email page, everyone in the database will recieve an email, if you have setup an account it delivers the email according to your notfication setting, which is off, hourly and daily. If you haven't registered, the notification email will include a link to the register page which will automatically fill in your email address for you, requiring you to only enter your full name. <!--#include file="db_connect.asp"--> END IF SUB SendMessage1(strEmail, lMessageCount) SQL = "SELECT Password " MessageDate = Now END SUB SUB SendMessage2(strEmail, lMessageCount) END SUB
Edited by kspare |
|
![]() |
|
kspare ![]() Senior Member ![]() Joined: 26 January 2005 Location: Canada Status: Offline Points: 334 |
![]() ![]() ![]() ![]() ![]() |
This is my listspam.asp code. I've modified it with the following features: a Cell mouseover color change for the line your one. During the mouse over it will show a popup with the reasons why the message was caught. You can also click anywhere on the line to check the message. Notice the security I put at the top of every page, so joe blow can't just access the asp code. <%If Session("User") = "" Then </script>
<% 'Theoretically, this should never happen. LoopCount = 0 %> function FP_swapImg() {//v1.0 function FP_getObjectByID(id,o) {//v1.0 <font face="Arial"> <script> <script> <% If order_by = "" Then Select Case order_by 'Generate query. <font face="Arial"> </tr> </font> <table width="396"> <td height="15" style="padding-left: 4px; padding-right: 4px"> </tr> <td style="padding-left: 4px; padding-right: 4px" width="263" align="right"> <td style="padding-left: 4px; padding-right: 4px" width="111" align="left"> </tr> <td style="padding-left: 4px; padding-right: 4px" width="263" align="right"> <td style="padding-left: 4px; padding-right: 4px" width="111" align="left"> </tr> <td style="padding-left: 4px; padding-right: 4px" width="263" align="right"> <td style="padding-left: 4px; padding-right: 4px" width="111" align="left"> <tr> ELSEIF Session("Notification") = 1 THEN ELSEIF Session("Notification") = 2 THEN END IF <td style="padding-left: 4px; padding-right: 4px" width="111" align="left"> ELSEIF Session("Notification") = 1 THEN ELSEIF Session("Notification") = 2 THEN END IF </tr> <tr> </tr>
</tbody> <%
<td align="center"> <td align="center">
<table border="1" cellpadding="2" cellspacing="0" width="100%"> While (Not rs.EOF) AND (LoopCount < MaxLoop)
<td align="center"><font face="Century Gothic"><input type="checkbox" name="<%="chk_" & QuarID%>"></font></td>
<%
<td align="center"> <td align="center"> rs.Close
|
|
![]() |
|
kspare ![]() Senior Member ![]() Joined: 26 January 2005 Location: Canada Status: Offline Points: 334 |
![]() ![]() ![]() ![]() ![]() |
I must mention that I started this code based on some code dan gave me a year or so ago, so thanks Dan :)
|
|
![]() |
|
Desperado ![]() Senior Member ![]() ![]() Joined: 27 January 2005 Location: United States Status: Offline Points: 1143 |
![]() ![]() ![]() ![]() ![]() |
Kevin, What did I say ... something like "Once you start it's hard to stop"?! I was at work ALL Night working on a PIX Firewall configuration and now ... while I should be going home, I am screwing around trying to figure our why my "favicon" for the SpamFilter manager is intermitant. Why am I doing this? I think it's an illness! Dan |
|
The Desperado
Dan Seligmann. Work: http://www.mags.net Personal: http://www.desperado.com |
|
![]() |
|
kspare ![]() Senior Member ![]() Joined: 26 January 2005 Location: Canada Status: Offline Points: 334 |
![]() ![]() ![]() ![]() ![]() |
Oh I know..i've still got more planned for it.h
let me know if you need help with the pix. I do cisco in my sleep...literallly. I've woken up and had configs in my head and had to write them down because I solved the problem in my sleep! lol Pix's....they are a tamable beast! LOL Most hate them. I love them. Edited by kspare |
|
![]() |
|
Desperado ![]() Senior Member ![]() ![]() Joined: 27 January 2005 Location: United States Status: Offline Points: 1143 |
![]() ![]() ![]() ![]() ![]() |
Kevin, Back on topic, how much SQL load do you experience gathering your "Notifier" information. I can imagine a high SQL load if the DB has a million or so records and a lot of users are sighed up. Or .. no? Dan |
|
The Desperado
Dan Seligmann. Work: http://www.mags.net Personal: http://www.desperado.com |
|
![]() |
|
kspare ![]() Senior Member ![]() Joined: 26 January 2005 Location: Canada Status: Offline Points: 334 |
![]() ![]() ![]() ![]() ![]() |
I'm not even sure of the load. But I know it scans 10,000 records in a matter of a second? All the emails go out at 6pm. So I'd say the load is minimal. I also run the delivery asp page right on the webserver.
|
|
![]() |
|
kspare ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
For those of you that have been playing around with my spamfilter <cough> ric <cough> check back monday. My new version will be online sometime sunday or monday. Kevin |
|
![]() |
|
Ric ![]() Guest Group ![]() |
![]() ![]() ![]() ![]() ![]() |
you noticed that??? :) I thought you were a busy man like I am... BTW - I love what you've done with it all... |
|
![]() |
|
kspare ![]() Senior Member ![]() Joined: 26 January 2005 Location: Canada Status: Offline Points: 334 |
![]() ![]() ![]() ![]() ![]() |
I am, but I took at the spam for my domain and the demo account has a ton of spam coming from your hotmail account. :) |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0.350 seconds.