Hello,
I installed MOODLE_15_STABLE on redhat 9.3, with apache 2.0.54, php 4.4, mysql 4.1.11, ...
I configured the authentication whith IMAP,
i works fine , but i want to get the user's infos from a MySQL database (on the user's first login ).
So I use the function auth_get_userinfo($username) in the file auth/imap/lib.php (see just after).
I get the good informations in the logs (error_log (print_r ($result, true));), BUT the profile creation form is empty !
Has someone an idea why the form is empty ?
thanks for your help.
Wilfrid,
Guadeloupe (French West Indies)
function auth_get_userinfo($username){
$result = array();
$connexion = mysql_connect("localhost","web","") or die ("Probleme connexion");
mysql_select_db("scolarite",$connexion) or die ("Pb selection");
if($err=mysql_error()) echo "Error: $err <br>\n";
$request = "SELECT nom, firstname, login";
$request .= " FROM person";
$request .= " WHERE login = '$username' ";
$resultat = mysql_query($request ,$connexion) or die ("Echec = $request");
$etu = mysql_fetch_array($resultat) ;
$result['firstname'] = "$etu[firstname]";
$result['lastname'] = "$etu[name]";
$result['email'] = "$etu[login]@iufm.univ-ag.fr";
//error_log (print_r ($result, true));
//OK:logs apache : Array\n(\n [firstname] => Ludovic\n [lastname] => GALLAIS\n [email] => lg905@iufm.univ-ag.fr\n)\n,
mysql_close($connexion);
return $result;
}