+ if ($ret != 0) {
+ $jret = json_encode(array("ret" => $ret, "mesg" => $mesg));
+ }
+ else {
+ $jret = json_encode(array("ret" => 0,
+ "mesg" => "",
+ "login" => $target,
+ // FIXME: state internationalization
+ "state" =>
+ ($user_item->type & USER_FLAG_TY_APPR ? "Apprendista" :
+ ($user_item->type & USER_FLAG_TY_CERT ? "Certificato" :
+ ($user_item->type & (USER_FLAG_TY_NORM | USER_FLAG_TY_SUPER) ?
+ "Normale" : "Stato sconosciuto"))),
+ "guar" => ($user_item->type & USER_FLAG_TY_APPR ?
+ "" : $guar_login),
+ "party" => $partyskill,
+ "match" => (versions_cmp($user_tos_vers, "1.4") < 0 ? "non autorizzato" : $user_item->match_cnt) ,
+ "game" => (versions_cmp($user_tos_vers, "1.4") < 0 ? "non autorizzato" : $user_item->game_cnt),
+ "friend" => usersnet_friend_getlabel($usersnet_item->friend),
+ "skill" => $usersnet_item->skill,
+ "trust" => $usersnet_item->trust,
+ "widefriend" => $usersnet_item->widefriend,
+ "narrowfriend" => $usersnet_item->narrowfriend
+ ));
+ }
+
+ return $jret;
+ }
+
+ function info_save($user, $json_s)
+ {
+ GLOBAL $G_lang, $mlang_brisk, $G_base;