OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Login Problems

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Login Problems

Postby makos » Sat Dec 08, 2007 2:19 pm

Hi everybody,
I'm Spanish so you will find fun my post :D because of my poor English redaction :oops:
Well, I got Open Conference Systems 1.7 successfully installed (Windows XP, Firefox, PHP 4, MySQL 5.1) using web based installer.
My problem comes when I want to login as admin (http://localhost/ocs/admin/index.php), if I use a bad user I get the correct error message but if I use the admin user I get redirected to the same page (http://localhost/ocs/admin/index.php) without any message.

I've "debugging" (through javascipt alerts) some of the code and I think that the problem is that the data form (username, password, login) is not collected by the php code because the $login, $username or $password variables seems to be null or equal "" but I'm not sure about this because It's the first time I've worked with PHP.
I have been reading some previous posts but I can't find any solution for this problem.

Lots of Thanks.

Marcos. Guadalajara (Spain)
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Login Problems

Postby asmecher » Sat Dec 08, 2007 6:27 pm

Hi Marcos,

It's probably a PHP configuration issue. Try enabling register_long_arrays in your php.ini configuration file; restart your web server and see if that fixes the problem.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: Login Problems

Postby makos » Mon Dec 10, 2007 12:49 pm

Hi Alec,

In first place I'm grateful for your speedy support.

On second place, I've searched the register_long_arrays sentence in my php.ini file but It isn't and in spite of it (I'm not sure if it is a well done expression :oops: ) I have put "register_long_arrays = On" (without the commas) in an empty line but the system Is working in the same way :( .

Lots of thanks for your support.

Marcos. Guadalajara (Spain)
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Login Problems

Postby asmecher » Mon Dec 10, 2007 3:39 pm

Hi Marcos,

Try enabling both register_globals and magic_quotes_gpc options in php.ini; if I recall correctly, register_long_arrays is available in PHP 5.x only. If you're hosting many web apps on your machine, you may want to configure those options to be enabled only in the OCS installation directory, e.g. via a .htaccess directive.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: Login Problems

Postby makos » Tue Dec 11, 2007 7:58 am

Hi Alec,

Several things to say...
In first place, I'm using PHP 4.4.7 so register_long_arrays wasn't in my php.ini file.
In second place, register_globas was On but magic_quotes_gpc doesn't, I enabled both but I'm still not logged in.
I have only one web app hosted on my server but if you tell me how to, I could try to test a .htaccess directive just in case It fixes my problem.

Regards and lots of thanks.

Marcos. Guadalajara (Spain)
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Login Problems

Postby asmecher » Tue Dec 11, 2007 10:36 am

Hi Marcos,

Hmm; let's start by double-checking whether or not the username and password variables are getting received properly. Edit admin/index.php and find the following section near line 44:
Code: Select all
// if logging in, validate the supplied username and password and store in cookie if valid
if($login) {
        if(validate($username,$password,true)) {
                setadmincookie($username, $password, $save);
                // if login is valid forward to admin options page
                Header("Location: ".$baseurl.print_url("admin/index2.php"));
                exit;
        }
}
Temporarily add a new line so that it reads:
Code: Select all
// if logging in, validate the supplied username and password and store in cookie if valid
if($login) {
        echo "Username: $username; Password: $password<br/>\n"; exit();
        if(validate($username,$password,true)) {
                setadmincookie($username, $password, $save);
                // if login is valid forward to admin options page
                Header("Location: ".$baseurl.print_url("admin/index2.php"));
                exit;
        }
}
Try logging in and see what the output is. (Of course, don't post your real username and password here.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: Login Problems

Postby makos » Wed Dec 12, 2007 8:29 am

Hi Alec,

As you have indicate me I have checked whether the username and the password are getting received and they are. I've also test whether the data, password and username validates and they do too but when the system should forward to index2.php (Header("Location: ".$baseurl.print_url("admin/index2.php"));) it forward to index.php instead so I think that some paths are wrong mapped in any file that I don't know.

Regards

PS:I hope someday together will do work the system :)

Marcos.
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Login Problems

Postby asmecher » Wed Dec 12, 2007 10:13 am

Hi Marcos,

Are you running IIS? There is an IIS bug (see http://support.microsoft.com/kb/176113) that affects cookies when they are used with redirects.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: Login Problems

Postby makos » Thu Dec 13, 2007 5:49 am

Hi Alec,

As I told you in my first message I'm running Apache then It's supposed to be another problem.

In any case lots of thanks for the suggestion.

Marcos.

-- :cry: Esperando una solución :wink: --
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Login Problems

Postby asmecher » Thu Dec 13, 2007 9:47 am

Hi Marcos,

In that case, I suspect the problem has to do with cookies. Have a look in admin/include/cookie.inc.php near line 62:
Code: Select all
SetCookie("confadmin", $cookie, $time, $path);
After this, temporarily add a line that looks like:
Code: Select all
echo "SetCookie(\"confadmin\", \"$cookie\", \"$time\", \"$path\");";exit();
Try logging in to see what happens.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: Login Problems

Postby makos » Fri Dec 14, 2007 1:56 am

Hi Alec,

I've tried that code and the result was this:

SetCookie("confadmin","cm9vdDoyMTIzMmYyOTdhNTdhNWE3NDM4OTRhMGU0YTgwMWZjMw==", "0", "/php/");


I suppose that you can understand what that it means.

Regards.

Marcos
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Login Problems

Postby asmecher » Fri Dec 14, 2007 9:47 am

Hi Marcos,

Yes, that means that the login is successfully validated. I suspect the path part of the output may be wrong, though; is the URL to your OCS installation something like http://some-domain-name-here.com/php (the "/php" being the important part)? If not, the cookie is being set with the wrong path.

If so, I'd suggest entering the path manually in the SetCookie command. For example, if your URL is actually http://some-domain-name-here.com/ocs, change:
Code: Select all
SetCookie("confadmin", $cookie, $time, $path);
...to...
Code: Select all
SetCookie("confadmin", $cookie, $time, '/ocs');
...in admin/include/cookie.inc.php. You'll also need to make a similar change in include/cookie.inc.php.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: Login Problems

Postby makos » Mon Dec 17, 2007 12:23 pm

YES, IT WORKS!!!

I only changed that lines (in both files) and then I was redirected to the correct page.

Alec, you are my idol :wink:

And now that the system is working well; I'd like to know where was the problem, whether I had done any bad installation step or if the problem is other. If you know it and have time enough to explain me it.

Millions of thanks.

Regards.
Marcos
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Login Problems

Postby asmecher » Mon Dec 17, 2007 2:01 pm

Hi Marcos,

Glad to hear it works!

The problem is that OCS 1.x needs to determine what the path part of the URL to the OCS installation is (e.g. in http://some-site-here.com/one/two/three, the /one/two/three part of the URL). Depending on a few things, such as how the web server is configured to run PHP scripts (e.g. CGI, FastCGI, or mod_php), sometimes OCS gets the wrong idea. OCS 2.x is a little more sophisticated and rarely encounters this sort of problem. In any case, it's not a configuration problem on your part.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm


Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests