5
I did manage to answer my own question. In case anyone else might be looking to perform the same task, this can be done using cURL.
First you use curl to post login credentials to XOOPS and then you can access the module function that requires administrator access.
e.g.
$url = "http://www.domainname.com/user.php";
$login_data =
"op=login"
."&uname=admin"
."&pass=password";
$user_agent = "php" . phpversion();
$ch = curl_init($url); // initialize curl handle
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_COOKIEJAR, "curl_cookies");
curl_setopt($ch, CURLOPT_COOKIEFILE, "curl_cookies"); // file where the cookies will be stored
curl_setopt($ch, CURLOPT_POSTFIELDS, $login_data);
$result = curl_exec($ch); // run the whole process
// you should now be logged in
// now access the admin only page
$url2 = "http://www.domainname.com/modules/modulename/admin/index.php?op=process_admin_function";
curl_setopt($ch, CURLOPT_URL, $url2);
$result = curl_exec($ch);
echo $result; // $result contains the page contents which you can parse for the success or error message you are looking for
//close cURL connection
curl_close($ch);