+ $reply = xmlrpc_encode_request(NULL, $args);
+ }
+
+ return $reply;
+}
+
+function get_nouveau_infos($method, $params) {
+ global $error_mat, $error_key, $globals;
+ // Password verification.
+ if(!isset($params[0]) || ($params[0] != $globals->manageurs->manageurs_pass)) {
+ return false;
+ }
+ // We check we actually have an identification number.
+ if(!empty($params[1])) {
+ $nameTypes = DirEnum::getOptions(DirEnum::NAMETYPES);
+ $nameTypes = array_flip($nameTypes);
+
+ $res = XDB::query("SELECT pnl.name AS nom, pnu.name AS nom_usage, pnf.name AS prenom,
+ p.sex = 'female' AS femme, p.deathdate IS NOT NULL AS decede,
+ p.birthdate, pd.promo, CONCAT(a.alias, '@m4x.org') AS mail
+ FROM profiles AS p
+ INNER JOIN account_profiles AS ap ON (p.pid = ap.pid AND FIND_IN_SET('owner', perms)
+ INNER JOIN aliases AS a ON (a.uid = ap.uid)
+ INNER JOIN profile_display AS pd PN (p.pid = pd.pid)
+ INNER JOIN profile_name AS pnl ON (p.pid = pnl.pid AND pnl.typeid = {?})
+ INNER JOIN profile_name AS pnf ON (p.pid = pnf.pid AND pnf.typeid = {?})
+ INNER JOIN profile_name AS pnu ON (p.pid = pnu.pid AND pnu.typeid = {?})
+ WHERE a.flags = 'bestalias' AND p.xorg_id = {?}",
+ $nameTypes['name_ini'], $nameTypes['lastname_ordinary'],
+ $nameTypes['firstname_ini'], $params[1]);
+ // $data['mail'] .= '@polytechnique.org';
+
+
+ // We start the encryption of the data.
+ if (manageurs_encrypt_init($params[1]) == 1) {
+ // We did not find the key to encryptthe data.
+ $args = array("erreur" => 3, "erreurstring" => $error_key);
+ $reply = xmlrpc_encode_request(NULL, $args);
+ } else {
+ $reply = manageurs_encrypt_array($data);
+ manageurs_encrypt_close();
+ }
+
+ } else {
+ $reply = false;
+ }
+ return $reply;
+}