Hello,

In my site, for authentification, I have created a login page in php with the possibility for each users to choose a appropriate mecanism for authentification (like LDAP, NIS,...)

when the authentification is good, I create cookies :

-------------------------
if($checklogin===TRUE) {

        $checksum = strlen($login);
        $checksum *= 6677665446;
        setcookie("username", $login, time()+3600,'/', $hostname, 1);
        setcookie("checksum", $checksum, time()+3600,'/', $hostname, 1);
        # URL of BackupPC_Admin
        header("Location: https://backuppc/cgi-bin/BackupPC_Admin";);
        exit();
}
-------------------------


Then, I have modified the way that BackupPC_Admin checks the login...
In BackupPC/lib/BackupPC/CGI/Lib.pm

-----------------------
sub NewRequest
{
    $Cgi = new CGI;
    %In = $Cgi->Vars;

<snip>...</snip>

   #
    # We require that Apache pass in $ENV{SCRIPT_NAME} and $ENV{REMOTE_USER}.
    # The latter requires .ht_access style authentication.  Replace this
    # code if you are using some other type of authentication, and have
    # a different way of getting the user name.
    #
    $MyURL  = $ENV{SCRIPT_NAME};

# Authentiating logins with cookies created with a login page (mybackup.php)

    $Query = new CGI;
    my $sumtest = 0;

    my $username = $Query->cookie("username");
    my $checksum = $Query->cookie("checksum");

    $sumtest=length($username);
    $sumtest*=6677665446;

    if($sumtest == $checksum) {
        $User=$username;
    } else {
        print "Location: https://backuppc/mybackup.php\n\n";;
        exit 0;
    }

<snip>...</snip>

}

regards

jmb
--
-------------------------------------------------------------------
Dr Ir Jean-Michel Beuken      |  University of Louvain-La-Neuve
Computer Scientist            |  CISM, Bat P. Curie
UCL PowerComputing Manager    |  1, Rue du Compas
                              |  1348 Louvain-La-Neuve
                              |  BELGIUM
-------------------------------------------------------------------
Tel : +32 10473570               Fax : +32 10473452
HTTP://www.mapr.ucl.ac.be/~beuken
-------------------------------------------------------------------


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Reply via email to