Linulex
Silver Pleskian
Hello,
I used to get the admin password for cron scripts to do tasks, I used to do it like this
This was a neat, generic way that always worked, whatever server it is on and no matter how many times the client changed his admin password.
But this methode gives an error now due to the encryption.
What is the correct way to do this now or do we need to create a new user, but this kinda defeats the idea of having admin encrypted if there is another users password in all the scripts that has access to the psa database.
regard
Jan
I used to get the admin password for cron scripts to do tasks, I used to do it like this
Code:
<?php
$pwfile = "/etc/psa/.psa.shadow";
$pwfile = fopen ($pwfile, "r");
if (!$pwfile) { exit; }
while (!feof ($pwfile)) {
$pw = fgets($pwfile, 1024);
}
fclose($pwfile);
mysql_connect("localhost","admin", $pw);
mysql_select_db("psa");
bla .. bla ... what ever needed to be doing ....
This was a neat, generic way that always worked, whatever server it is on and no matter how many times the client changed his admin password.
But this methode gives an error now due to the encryption.
What is the correct way to do this now or do we need to create a new user, but this kinda defeats the idea of having admin encrypted if there is another users password in all the scripts that has access to the psa database.
regard
Jan