You'll need to download the module from the link above to /usr/local/cpanel/Cpanel/LogmeIn.pm
Then you can interact through the module with your login script. Something like this:
Code:
#!/usr/bin/perl
use lib '/usr/local/cpanel';
use Cpanel::LogMeIn ();
my $user = '__USERNAME__'; #or lookup from your records
my $pass = '__PASSWORD__'; #or lookup from your records
my $host = '__HOSTNAME__'; #or lookup from your records
my $service = 'cpanel'; #or whm or webmail to access those interfaces
my($login_ok,$login_message,$login_url) = Cpanel::LogMeIn::get_loggedin_url('user'=>$user,'pass'=>$pass,'hostname'=>$host,'service'=>$service,'goto_uri'=>'/');
if ($login_ok) {
print "Location: $login_url\r\n\r\n";
} else {
print "Content-type: text/plain\r\n\r\n";
print "LOGIN FAILED: $login_message\n";
}
exit (0);
This script above will output a secure URL that can be used only once to login. If you're looking for a login form instead, you can use this example:
SampleBrandedLogin < AllDocumentation < TWiki