Hello,
I'd like to integrate drupal into another CMS system on a site I maintain, and wonder how to do this with a minimum of coding.
What I'd like to start with is to have users log in only one place. So what I'd like to do is to set up a custom function in drupal where users are logged in without having to submit username/password.
From looking at the drupal code, It looks like the best solution would be to make a change in the function user_load in the drupal-user module:
from
foreach ($array as $key => $value) {
if ($key == 'uid' || $key == 'status') {
$query[] = "$key = %d";
$params[] = $value;
}
else if ($key == 'pass') {
$query[] = "pass = '%s'";
$params[] = md5($value);
}
else {
$query[]= "LOWER($key) = LOWER('%s')";
$params[] = $value;
}
to simply
$query[] = "name = " . $_SESSION['login_other_system'];
Where existing uid is supplied, the user will always log in successfully to drupal. In addidtion changing the code, it will never be possible to log in except through the other system. And the security will hopefully be taken care of by insuring the integrity of the session variable (session logged with IP and timeout)
Do you think this is a feasible solution?