Blog News Main Page NEWS FROM 2006-03-25
Blog Entry: 3/25/2006 4:26:09 PM
Protecting ASP Pages
To protect a page without using the Access_Level or Groups feature simply add this code to the top of that page.
Put this under the <%@ LANGUAGE="VBSCRIPT" %>
<!--#INCLUDE FILE="check_user_inc.asp"-->
This is an example of a File Server Side Include. You could also use a Virtual Server Side Include.
The following URL explains what Server Side Includes are. http://www.powerasp.com/content/code-snippets/includes.asp
Now when someone runs that page they will prompted to login. They will not be allowed access to that page until they successfully logged in.
An example of doing this is provided in the "default.asp" file included in the root of the Password System. Look at the source code with a text editor to see the working code. It is quite simple.
Protecting ASP Pages Using Access Levels
To protect a page using the Access Level feature simply add this code to the top of that page. You simply specify the Access Level before the include file is called. In this example we are protecting the page with Access Level 4.
Put this under the <%@ LANGUAGE="VBSCRIPT" %>
<% CHECKFOR = "4" %> <!--#INCLUDE FILE="check_user_inc.asp"-->
This is an example of a File Server Side Include. You could also use a Virtual Server Side Include.
The following URL explains what Server Side Includes are. http://www.powerasp.com/content/code-snippets/includes.asp
Now when someone runs that page they will prompted to login. They will not be allowed access to that page until they successfully logged in as a Level 4 user.
Examples of managing Access Levels are provided in the "multiple_access_levels" folder included in the root of the Password System. Look at the source code of the ASP pages in that folder with a text editor to see the working code. Again, It is quite simple to follow.
Protecting ASP Pages Using Groups
Please see the code generators in the admin are for the code to do that. cwilliams38403.6864351852, Hi,
Could you please advise what may be causing this error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x57a4 Thread 0x5474 DBC 0xf03a704 Jet'.
/ASPProtect/check_user_inc.asp, line 292
Funny thing is that if I refesh the page with the above error it gives me the following eror:
/ASPProtect/check_user_inc.asp, line 292
and after few times of refreshing the page it shows me the page I am after.
Is this my promlem or ISP's.
Thank you ,
one thing to note... the time period we are talking about is going to to be whatever you have the session timeout set at in the settings.
perhaps making that value lower like 10 minutes is an option for you.. and might help to deal with situation
, the following error message appears, but only when attempting to log off. all other parts of the program seem to be working.
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xa04 Thread 0xa38 DBC 0x21ff024 Jet'.
, so you are using the subscriptions signup directory right ? "paypal_signup2" ?
1st.. I would check that the xml parser is working.
It is required for making the post back to paypal. It is installed on windows 2000 and 2003 and XP by default.
http://support.cjwsoft.com/forum/forum_posts.asp?TID=134& ; ; ; ; ; ;PN=1
Then I would check the actual form page to paypal to make sure it is generating a valid IPN url as a hidden form value. It's the payment page you actually click on that actually takes you to paypal. For the subscription signup system that page is called "paypal1.asp"
You'll want to go through the process starting with the default.asp of the signup folder untill you get to that page. Then you want to look at the html source of that page in Internet Explorer. Your looking for something like this in the source code and you want to make sure it is valid.
<input type="hidden" name="notify_url" value=http://www.mysite.com/aspprotect/paypal_sub_signup/ipn.asp>
It also has to a url on the internet that paypals server can see. It can not be a local url for your machine. Also: If it is not valid we can try hard coding it.
If all of these things are good I'll have to take a look. I have some text file logging I can do when paypal hits your IPN url that can tell us if it is actually hitting that page like it is supposed to. And I can test the system for you by making some 1 cent payments using my own paypal account until we find out what is going wrong.
cwilliams38421.5686921296, humm, I dont know.
If you want me too I would be glad to go into your web site and troubleshoot. If so PM me the info I need and I will take a look and see if I can figure it out.
CJW
, Hello Chris:
Let me run some more test if it's working on your end it should be on mine? I have made some custom updates to the code but no in that area.
Thanks, -Ricardo
, Hello,
You are correct regarding what you noticed.. ASPBanner only allows one person to administrate. If if did what you are asking about it would probably cost more. (you get the ASP source so if you really wanted that you could always add it on your own fairly easily, but it all depends on your skills)
AS for keyword advertising and different ads based on certain pages ASPBanner does not get into that. The main reason being performance as I built ASPBanner primarily as a performance banner rotation solution. http://support.cjwsoft.com/forum/forum_posts.asp?TID=144& ; ; ; ; ;PN=1
Like that thread says, you could make different zones for different conditions.. then surround the banner calling code with if else logic so a different banner zone was called under certain conditions.
Regardless, if you really need something that has every bell and whistle. BanManPro is where it is at. cwilliams38434.7100578704, Not sure because of the nature of the javascript method
for starters tighten up the html around the banner call
change
<tr> <td width="460" height="60" align="center" valign="middle" class="imagead"> <!------- ASPBanner Ad code -------------> <script language="JavaScript"> var code = ''; var now = new Date(); var nIndex = now.getTime(); document.write('<s' + 'cript src=" http://www.nababaseball.com/aspbannernet/aspbanner/injectban ner.aspx?BannerZone=1&nocache=' + nIndex + '">'); document.write('</' + 's' + 'cript>'); </script> <script language="JavaScript">document.write(jscode);</script >
</td>
to
<tr> <td width="460" height="60" align="center" valign="middle" class="imagead"> <script language="JavaScript"> var code = ''; var now = new Date(); var nIndex = now.getTime(); document.write('<s' + 'cript src=" http://www.nababaseball.com/aspbannernet/aspbanner/injectban ner.aspx?BannerZone=1&nocache=' + nIndex + '">'); document.write('</' + 's' + 'cript>'); </script> <script language="JavaScript">document.write(jscode);</script > </td>
If that doesn't help I would suggest using the ASP 3.0 version of ASPBanner. It can serve banners to a any type of page extension and it runs just as well as the .NET version. There is a new iframe method for calling banners that you can try instead of the javascript. The iframe method is explained in the ASPBanner Unlimited section of the forum. cwilliams38150.6443634259, I have been working on this all night long. I have been reading every possible article. I have created an ODBC connection on the server.. which i have never done before? Still nothing. I looked at the machine.config file... i read about impersonating whatever the hell that is... I am really stressed out. I have the 1.1 framework installed.
I read about dsn and dsn-less connections. Is there another way i can connect to the database? Without using a username and pw maybe?
, My guess is they are not going to allow you to run your own oledb connector out of your own personal bin directory.
I don't think your going to be able to modify aspprotect to work under
that environment very easily, but I would give 1&1 a chance to
explain their reasoning and they might actually be able to provide a
simple fix who knows.
I have never seen a situation where a host goes messing around with
.NET that worked out good for anyone. I'm sure they have a reason, but
the entire world writes code to work on the platform as Microsoft
shipped it not as someone decided was a better way to set it up.
, Hi,
I don't fully understand what you are explaining ... the part about showing a user but not working???? but if you PM me the details I will glady go into your live webserver and see if I can get it working. , I just took a look and that is definetly what happened. It has nothing to do with the registration process as far as I can see.
Just running this page triggers it and I know it does not do that the way it comes. http://www.myvirtualtutor.com/aspprotect/users/user_area.asp
Please back up what you changed and put the user area back the way it came..
If error still happens then I can help you.. It it works fine with the default files from the zip archive then you messed something up in the code.
You have to be really careful when working with ASP code.
Also: just in case you did this. " you should not be password protecting any files in the users area that are already there " the users area does it's own thing and there is no reason to be doing anything like that to the files that are already there. You can do whatever you like to files you add on your own. cwilliams38456.0957060185, I would like to delete the SQL tables and set them up from scratch using enterprise manager and sql query manager and see what happens
If that is ok with you let me know.
Something is wrong like I said... almost seems like the database is caching old password info from the field., My client has a list of 13,000 members that
have already been assigned ID's and passwords with a
homegrown system.
When doing a bulk import, will we be able to retain the userid and password or will a new id be assigned during the bulk load?
Thanks in advance for your help.
, here is a thread that may help you if this is what you were getting at
http://support.cjwsoft.com/code/moreinfo389-1.htm , How to bring up the Code Generators
Simply go to the zones screen. Select a Zone from the list. Check the "Show Banner Code" option.
Click on "Display Banners in Selected Zone" , Christopher,
Thanks for the reply. I think I've found my problem, but can't test until later in the evening as it is on a live site.
Darrell , I'm trying to use CDOSYS.
It seems to work fine on the web page, however the mail never gets delivered.
I can see my messages sitting in c:\inetpub\mailroot\pickup but they never leave it.
I found another folder after doing a search for "pickup".... it is: d:\program files\Exchsrvr\Mailroot\vsi 1\PickUp If I paste the files into there, they get delivered.
How can I get the email to be delivered without doing the cut and paste?
I've tried it both with and without authorization.
I am running a Windows 2000 server with Exchange 2000.
Thanks. , yes, any page you want protected needs to be edited..
You can probably have a login box on a non protected page. Just copy the generated source html form code for the login box of a protected page. Then put it on your non-protected page, but change the action to the page you want them to log in to.
In other words go to a protected page. See the login box, view the html browser source and use that to make your login form on the main page.
I have not tried it with .NET but I am pretty sure you can do it since it pretty much works the same as the classic asp version of ASPProtect.
try it.. see if it works.. If I have time tommoro I will test it out., Actually, I think I just found my answer...
I will take out the StrToFix = Replace(StrToFix," "," ") bit of code and see what happens...
- Jason
Jawa38406.4721412037, I do not what is going on at this time. It is not a known issue. If is is not working it would seem to be a problem with the application variables on the server possibly and your web.
Perhaps try installing it on a local machine and see if it works for testing sake.
Also.. if your stuck with the black skin you could always just edit the information in the that skins folder to get the app looking the way you want.
That and the header and footer files that comes with the app are what control the look of the system. cwilliams38294.5880208333, Hello,
I do not really understand what you mean? There are no country and city lists in ASPClassifieds. cwilliams38391.0301388889, That is actually normal and supposed to be like that. You have the current version.
ASPVendor is a VERY simple application meant to work with PayPal shopping cart that runs on their server. It is based off the ASPClassifieds core code. There is only one version and highly doubt there will ever be another., [QUOTE=cwilliams] Is that a real term or just something you named it cause they have like a zillion people using that SQL server?[/QUOTE]
yeah thats it, you buy into a part of the sql server so it's an sql server hotel... , Honestly cannot comment much about v7 since it was just installed on a new server. We have been running 5.03 for years so I'm looking forward to the new features in v7.
Lance , All fixed... I changed the remote server from localhost.omegaphibeta.net or whatever it said there to localhost
I sent a test email to myself and got it no problem
the error you were getting was email component related , Actually it is my own server (retired email server from my employer). I will check out the documentation again. I DID read that part, but didn't understand it enough. I'll dig deeper. Also my box has 2 CPU's, hence the $125 for ASPImage..., Hi Chris,
The hosting company has been doing some work apparently regarding the database connection issue. Still something is funky 
When I type in www.vickerylightning.com/aspgallery/default.asp I get the custom 404 error page and I noticed that it is trying to open the following:
http://www.vickerylightning.com/skins/default/settings.asp
Is that what it is supposed to do?
Thanks! Rhona, the rookie
, IMPORTANT UPDATE - READ THIS http://support.cjwsoft.com/forum/forum_posts.asp?TID=205& ; ; ; ; ; ; ; ; ; ; ;PN=1
The 2Checkout Support Pack which is built in to ASPProtect 7 contains all the pre-built scripts you need to implement 2Checkout Payments with ASPProtect. You must be using version 2 of the 2checkout system. They are phasing out version 1 regardless so everyone will be using version 2 very soon if they are not already.
THIS IS NOT INTENDED OR DESIGNED TO USE 2CHECKOUT SUBSCRIPTIONS. (see bottom of this thread for more info on that)
This Support Pack basically gives you an additional signup and registration directory "2checkout_signup" and it should not interfere with any changes or customizations you have made to your ASPProtect setup in general. New users can register in this directory and pay for membership at the same time. Existing users whether active or expired can be sent to this directory where they can lookup their account and buy additional membership time online. You can also assign various Access and Group Levels during signup and you can set up various prices for various amounts of time as well. This is a real-time setup for the most part. As soon as a user pays via 2Checkout your system is updated and they will have access.
The 2checkout pack is NEW.. and was released on March 19, 2005. If you don't have it and would like it please just ask.
To start using this edit the "2checkout_signup/2checkout_config_inc.asp" file
You will be entering your 2Checkout Account number in that file as well as the URL you want a user to go to after payment. It is all commented in that file. (There is also a testing variable you can set to True if you want to do testing without real charges being applied)
After editing that file run this page.
http://www.mysite.com/2checkout_signup/show_postback_path.asp
Replacing the part in blue with your website info.
It will report back that postback url you need to use in the 2checkout system.
Log into your 2checkout version 2 account and under the "look & feel section" enter that postback url for both the "Approved URL" and the "Pending URL"
Trust me: You want the URL there for a pending URL because the 2Checkout system is quite random and 95% of the payments that come in go to the pending URL and end up being legitimate sales. (at least for me they do)
Now make sure the Direct Return option on that page is on as well.
If set to Yes buyers will be immediately directed to your URLs below once they click the Complete Order button. If set to No the buyers will have to click a button to return to your URLs below. |
>> |
Save that page... and leave 2checkout.
| Now, delete this page from your ASPProtect setup. http://www.mysite.com/2checkout_signup/show_postback_path.asp
It's a minor security risk and is no longer needed needed.
The basic setup is finished. All you have to now is set up payments options the way you want them.
Changing Payment Options
In the "2checkout1.asp" file there are form options set up.
They look like this and you can have as many as you like.
<option selected value="30,9.95,3,">30 Days, 9.95</option>
In this option... A user has the option to purchase 30 days for $9.95 and he will be set to Access Level 3 when payment in completed.
Here is how it works.
The value setting (red) is essentially and array that can be made up 4 elements separated by comma's They must be separated by a comma and there can be no spaces. In this example the 4th value was not used but the last comma must still be there. If you didn't want to set an access level and left out the "3" there would 2 commas at the end. etc etc Basically there must always be 3 commas but you only have to set the 1st 2 values which are days and price.
days,price,access level,groups
The 1st value is the amount of days. The 2nd value is the price for the amount of days. The 3rd value is the access level you want to user assigned to. The 4th option is the groups you want the user assigned to. (see PayPal subscription thread for examples of specifying group info)
Now, the label for the option in (blue) can say whatever you like. , Okay Chris, I wold like to get rid of the encryption then if it's not too much trouble.
I have no option of running the production server against an ms access db, since the db needs to be online and accessible from another system. , SQL Server Datareader Datawriter Permissions..
here is a screenshot that shows how to set datareader and datawriter permissions on a database using "SQL Enterprise Manager"
In this example we are making sure the aspbanneruser has those permissions on the aspbanner database in the SQL Server
 cwilliams38390.5986921296, It works. Thanks Chris.
, Hi,
We use ASP Protect to password protect the pages in the member area ( http://www.pti.org/members.asp )
Of late Once or twice every month our whole site goes down and it gives us a "Microsoft VBScript runtime error 800a006 Overflow: Clnt //global.asa line 33 " error message (with the friendly message turned off). When we reboot the web server things are up as normal.
But this is happening too frequently and creates a bad impression.
Any suggestions on how we could prevent this would be greatly appreciated. , Upgrade from V6 to v7.x with an MSSQL SERVER DATABASE
1st of all, backup your existing ASPProtect files and database before performing this upgrade. Please be really careful while performing this upgrade. Version 7.x is a highly advanced application compared to any previous versions. CJWSoft under no circumstances is responsible if you lose information or have website downtime.
BOTTOM LINE: (PERFORM THIS UPGRADE AT YOUR OWN RISK)
To do this upgrade you're going to need to have SQL Enterprise Manager and SQL Query Analyzer
That being said, on with the upgrade..
Open your SQL database in SQL Enterprise Manager
Regarding the following Tables
Rename "Users" to "ASPP_Users" Rename "Groups" to "ASPP_Groups"
If you do not have a "Groups" table do not worry about it right now.
Now right click and DELETE the Config Table. Yes, delete it..
Now, go into Design View for the "ASPP_Users" Table.
Rename the "Password" field to "Old_Password" Be sure to spell it perfectly using the Underscore
If you have a "Groups" Field... leave it alone If you do not have a "Groups" Field add one and make it a "nvarchar" field with a lengh of 255.
Now, we are going to add a few more new fields.
Add a field called "Redirection_URL" make it a "nvarchar" field with a lengh of 150. Add a field called "PayPal_Subscriber_ID" make it a "nvarchar" field with a lengh of 100. Add a field called "Newsletter" and make it a "bit" field Add a field called "Password" and make it a "nvarchar" field with a lengh of 100.
Now close that window and save the changes..
Download these scripts. 2005-02-23_171110_aspprotect_v7_sql_upgrade_scripts.zip
Now open up SQL Query Analyzer Connect to your SQL server.
Then load the script "aspprotect_v7_config_table.sql" into the Query Analyzer. Click the green play button at the top. If everything goes well the response should read something like this.
****************************************************** (1 row(s) affected) ******************************************************
Now, if you had a Groups Table your done with the database changes.
If you didnt have a groups table.
Then load the script "aspprotect_v7_groups_table.sql" into the Query Analyzer. Click the green play button at the top.
Now, go back to your database in Enterprise Manager and make sure all 3 tables are there and look ok. You might need to do a refresh or two to see them.
Now make sure an existing or new SQL user has (public / datareader / datawriter) permissions for all three tables. You reference this user in the asp code connection string so this user must be set up correctly. You may need your SQL server admins or hosting company to help you on this step as you may not have access to do this. You may not need to create a user and set permissions as the sql user you were logged in as to use query analyzer may by default get the correct permissions on anything you create.
Regardless, as you can see from this screenshot I have a SQL user called "aspprotectuser" and proceeded to set the permissions for that user. Under database access giving him (public,datareader, and datewriter permissions).

Now, you are done upgrading your SQL Server Database.
The existing passwords still have to be encrytped and moved from the "Old_Password" to the "Password" field
To that we have a special page we run in the application that will take care of that.
So, for now... go install the application, but using the database we just created. Follow these instructions for the most part... http://support.cjwsoft.com/forum/forum_posts.asp?TID=181& ; ;PN=1
When you get to the part where you finally get into the admin area and need to make an admin account you will notice that your existing user database is there but none of the users have passwords if you look at them in the edit screen.
That is normal. Simply do what the instructions say and create and admin account using a username that does not exist..
Then log off... then back in as that new admin account. If that works you are ready to convert the passwords.
This part is very easy.
You want to run a special page via the browser.
http://www.mysite.com/password_admin/convert_to_encrypted.asp
Replacing the part in blue with your website info.
Once you get the page running you will see a login prompt and one form field just like before with the "get_me_in.asp" page
You will need to paste the "PasswordEncryptionKey" value that you used in the "config_inc.asp" file in the form field and hit enter.
If all goes well you will see a page telling you to click here to encrypt the passwords and copy them over.
So do what it says... dont click more than once and wait.
Eventually it should say it is finished. So go log in to the admin area of the system using the new admin account.
Now edit some users but dont save... you want to see if the passwords are showing up. If they are the conversion worked. If you see nothing or a garbled mess it did not work and you made a mistake during this whole process.
If things went well backup and delete the conversion file below.
http://www.mysite.com/password_admin/convert_to_encrypted.asp
You do not need it anymore.
Once you are positive every thing is running smoothly and everyone's passwords are ok you can go in and delete the "Old_Password" field as well.
If things didnt go well.. try again from scratch and go slowly. If they still dont go well get ahold of us for help.
We are here to help, but if you really want us to we can be hired to do the conversion. , i will probably end up doing this myself, but dropping all the log data in a sql table would be nice as it offers much more flexibility on how an admin can keep track and use the data. Browsing through each log file is very inconvenient. I can search for text in the files (server-side, others with a shared server would probably have to separately download all log files first), but with the current method I don't have the following important options:
- cannot sort by any criteria
- quickly see a list of all login attempts by a specific user (i need to search each log file individually for this info)
if you had an option during setup perhaps (or elsewhere) in a future version that allowed an admin to specify the preferred logging method (separate files or a table in sql) i'm sure many admins would find it very useful to have a database alternative of keeping track of users becuase it would offer the two benefits listed above, plus more. , When a user 1st signs up a proper case function is run on certain fields. This is only once on user signup and never done in the admin area.
It's goal is to keep things entered in Proper Case,
so if someone enters "chris williams" it becomes "Chris Williams"
It's not perfect but it helps a lot to keep the data clean and more consistent. Since it only happens during registration those values can be changed later by the admin or the user if someone wants to.
The function is only applied to the fields that it makes sense to apply it to.... In your case adding a drop down menu means you want exactly what is in your drop down to appear so you wouldn't want it happening.
That being said, it is really easy to remove this situation from any field it is happening to during registration.
So edit "users/add_new_account.asp" with a text editor
find
CmdAddUser.Fields("Company_Name") = PCase(Company_Name)
and change it to
CmdAddUser.Fields("Company_Name") = Company_Name
That is all that is needed to made the change cwilliams38421.5069328704, okay thanks, how di I change the currency dollar sign to gdp pound sign ?
I need all my tranactions in gdp puund sterling to use on paypal
regards
simon , I did a sign up.. your verify URL is not saved/set in the application variables.
try saving the admin settings page again.. or reboot the server so the settings get reloaded
if you can make sure the web is it's own application in IIS
if it is your server do and "iisreset" from the command prompt
if all else fails you got iis application issues with the site... wait till tommoro to see if the setting gets loaded ,
Timecard Entry: 3/25/2006 4:26:09 PM
cleaned up my computer and listened to a conversation between Crispin and Steve about improving softMLS, Performed some more cleaning while it was quiet, Bill Aigner/National Hanger Inex support, Making some quick changes to XMas-Crusade. Adjusting case sensitivities so the display looks better (they use combinations of all upper case, all lower case, mixing case and it looked like crap)., vac, On phone w/Doug Sheley, TaskForce, public meeting w/ Watn Hockey, Oktoberfest, daily meeting with Howard, email, voicemail, talked to designers about current and proposed projects, Dropping brochures out to participating banks., Working on Knowlton-CO printing issue w/ Ed and Randy, Working on events calendar for ogdensburg.org, Worked on obtaining sign off on the remington artilce and getting sizing for the ads spoke to Vikko at the journal and tried to get in touch with Lynn at the Museum., Draft Telergy contract, ticc contracts, Meet with Paul Barton, McD's, meeting with harry going over all the issues with the switch installation and other stuff associated with signing off for switch, Time spent throughout day on TICOM A-Link issue., Mailer, Marketing, check voice mail, tech support, talked w/by to review program for seminar. returned call to ks and te. revised cp web site manual., unpack car from Burlington trip, Called newmediacable.com about their FrontPage access. They were IMC net customers and no one could figure out their password (wasn't on any of our lists). Randy had to assign them new ones., Programming of Ben Brannan's 56K Cisco 1602 Router, Burlington to Watertown - 180 miles + ferry ($12.50), enter bills, CHRSolutions,
|