Solved

Need help passing login information to a system .. and then going directly to a specific URL

Posted on 2004-10-12
13
170 Views
Last Modified: 2013-12-25
I need help .. and am hoping that someone could help me with this.

Situation - that needs to exist.  (Let me know if this makes sense and if you need any additional information to assist me.)

I have a Portal system that students can log into in order to access their financial and all other information at a Unviersity.  Typically they go to a home page and then enter a username and password.  Once they log in, they can then proceed and navigate through the portal.  This is fine, but tends to take students many steps in order to get to certain areas (deep within the portal).

I want to be able to provide direct links to specific URLs within the portal .. so a user can click on a link .. and then go directly to that page (section within the portal).

The problem (as you can imagine is) ... that if a student isn't logged into the portal (prior to clicking on the link to the URL within the portal) they get a message that says "You are not authorized to access this area."

What I am hoping to do .. and would like to know if a cgi script can be put together to do this is ....

1)  The user clicks on a link (to a particular page .. that exisits deep within the portal) - from another webpage on the University website.  The reason is to allow different departments on campus .. to provide direct access to specific information contained within the portal.

2)  If the user was not already logged into the Portal (which would most likely be the case, but not always .. but mostly) ... when the user clicks on the link .. the CGI script would first need to see if they were logged into the Portal .. and if not ... the CGI script would take the user to a page where the student could log in.  Then once the student logs in ... and their login is accepted .. the CGI script would re-direct the student to the webpage (URL) that they originally clicked on (in the link) that they tried to access.  

If the student was already logged in .. prior to clicking on the link .. the CGI script would simply redirect the user to the page they are trying to access.

Is this possible to accomplish using a CGI script?  I am expecting that when the user clicks on a link .. the link is passed into the CGI script ... and then the script determines if the user is logged in .. and if not .. allows the user to log in.  Then, once logged in .. the script would redirect the user to the appropriate URL (which was passed via the link).

I need help with someone to possibly show me exactly how to write this script.

Is this possible? If so, ... please help.

Thanks,
Gary
0
Comment
Question by:garymgordon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 3
13 Comments
 
LVL 3

Expert Comment

by:alskdj80
ID: 12288361
to do this, you need to use sessions... im gonna use perl to show you

on any page that you need the user to login, you must check the session:

session_start();
session_name('MyPortalName');
header("Cache-control: private"); // Fix for IE -> this is to prevent a problem with caching in IE

if ($_SESSION['login'] != TRUE) {
      myheader("Login Required!");
      include $_SERVER['DOCUMENT_ROOT'].'/login_form.html'; //this is your login page
      footer();
      exit();
}

//insert body of your page
0
 
LVL 3

Expert Comment

by:alskdj80
ID: 12288466
for your login page, you will need a form for the user to enter their username and password

i wont write out that part... but i will write out how to handle it...

lets suppose that your form names were: username and password, sent through POST

first you'd have to check your database if they exist already, otherwise, they'll have to sign up

when you have determined that the user is ok, and the username and password are correct, set the session variables:
if (//everything is correct) {
    $_SESSION['login'] = true;
    //as well as any other session variable you may need... the user's first name, last name, etc.
}
0
 
LVL 3

Accepted Solution

by:
alskdj80 earned 100 total points
ID: 12288503
for more indepth info... try looking at this tutorial: http://www.phpfreaks.com/tutorials/41/0.php
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

Author Comment

by:garymgordon
ID: 12288505
alskdj80,

I am very confused.  I apologize.

but in order to help you so that you can answer this question, maybe it would help if we chatted on Instant Messenger .. so you could bring me up to speed with various aspects of this.  Then, you can hopefully answer the question, etc.

Is that okay?  My IM on AOL and Yahoo is  garymgordon.  My IM on MSN is garymgordon@hotmail.com .

Please let me know how we can best discuss things prior to your answering the question.  I apologize, but I am a little lost as to the process of what will be needed, etc.

I hope you don't mind my asking to chat on IM.

Gary
0
 
LVL 3

Expert Comment

by:alskdj80
ID: 12288677
well, im actually at work right now... and we cant use msn... but i'd be happy to answer any questions you might have right here... and that way someone else might be of some help too
0
 

Author Comment

by:garymgordon
ID: 12290142
alskdj80,

Well ..

What I was really hoping for was .. someone to outline exactly what I needed, including writing the script(s), etc., that would be needed to accomplish this.  (If it needed more points, that would have been fine.)

But .. being that I am not very familiar with Perl/CGI .. I have numerous questions and .. I'm affraid that going back and forth here .. with all the questions .. would probably not work as well as I need.

I apologize, but don't know what to do.

Should I not have posted this here?

I would like to give you some points .. just for your trying to get started helping me.

Is there a way I can reduce the points .. and give some to you .. just for initially trying to help me (because I appreciate your willingness).

I just don't know what to do.

Can you tell me?

Thanks,
Gary

0
 
LVL 3

Expert Comment

by:alskdj80
ID: 12290216
well, i dun think you can take away points...

im not sure if you're able to do this, but... are you able to delete this question?  then just ask a new question with the desired amount of points, and i'll reply something, then you can accept that answer... (kinda a round-about way)
0
 
LVL 3

Expert Comment

by:alskdj80
ID: 12290302
hmm, i think the only way you can delete a question is by posting in the Support Forum http://www.experts-exchange.com/Community_Support/

dunno if you can ask for refund of some points but not close the question
0
 
LVL 3

Expert Comment

by:alskdj80
ID: 12290321
but it is alot of work... so its ok if you dont too...
0
 

Author Comment

by:garymgordon
ID: 12290558
Well... I posted the request to delete this.
Then, when it's done, I'll repost one for you with 100 points (just for you).

I appreciate your help.
Hopefully you can help me in the future.

Thanks,
Gary
0
 
LVL 3

Expert Comment

by:alskdj80
ID: 12291025
thanks, =)
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need a powershell script to export detailed active directory user information 4 50
How can i open a .fxp file 3 50
Logon script fails 23 61
OS Selection Menu 1 68
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question