function creer_uniqid() { lcm_log("Call to deprecated function creer_uniqid(), use create_uniq_id() instead"); return create_uniq_id(); }
function send_cookie_by_email($my_email) { global $system_kwg; include_lcm('inc_mail'); install_html_start(_T('pass_title_forgotten_password'), 'login'); if (!is_valid_email($my_email)) { echo "<p>" . _T('pass_warning_invalid_email', array('user_email' => htmlspecialchars($my_email))) . "</p>\n"; return; } $my_email = clean_input($my_email); $kwg_email = get_kwg_from_name('+email_main'); // Find the ID + info of the author $res = lcm_query("SELECT id_of_person, username, status, password\n\t\t\tFROM lcm_contact as c, lcm_author as a\n\t\t\tWHERE c.id_of_person = a.id_author\n\t\t\tand type_person = 'author' \n\t\t\tand value ='{$my_email}' \n\t\t\tand type_contact = " . $kwg_email['id_group']); $row = lcm_fetch_array($res); if (!$row) { echo "<p>" . _T('pass_warning_not_registered', array('user_email' => htmlspecialchars($my_email))) . "</p>\n"; return; } if ($row['status'] == 'trash' or $row['password'] == '') { // TODO TRAD echo "<p>" . _T('pass_error_acces_refuse') . "</p>"; } else { if ($row['status'] == 'waiting') { // TODO TRAD echo "<p>" . _T('pass_error_waiting_moderator') . "</p>"; } else { if ($row['id_of_person']) { $cookie = create_uniq_id(); lcm_query("UPDATE lcm_author \n\t\t\t\tSET cookie_recall = '{$cookie}'\n\t\t\t\tWHERE id_author = " . $row['id_of_person']); $site_name = _T(read_meta('site_name')); $site_address = read_meta('site_address'); $message = _T('pass_mail_cookie1') . "\n"; $message .= $site_name . " (" . $site_address . ")\n\n"; $message .= _T('pass_mail_cookie2') . "\n"; $message .= " " . $site_address . "/lcm_pass.php?p=" . $cookie . "\n\n"; $message .= _T('pass_mail_cookie3') . "\n"; $message .= _T('pass_info_remind_username', array('login' => $row['username'])) . "\n"; if (send_email($my_email, "[{$site_name}] " . _T('pass_title_forgotten_password'), $message)) { echo "<p>" . _T('pass_info_receive_mail') . "</p>"; } else { $email_admin = meta_read('email_sysadmin'); echo "<div class=\"box_error\"><p>" . _T('pass_warning_mail_failure', array('email_admin' => $email_admin)) . "</p></div>\n"; } } else { lcm_panic("Missing id_of_person for " . $my_email); } } } }
function newpass($id_author, $username, $pass, $author_session = 0) { $this->error = ""; if ($this->is_newpass_allowed($id_author, $username, $author_session) == false) { return false; } // Check for password size if (strlen(lcm_utf8_decode($pass)) <= 5) { $this->error = _T('pass_warning_too_short'); return false; } $alea_current = create_uniq_id(); $alea_future = create_uniq_id(); $pass = md5($alea_current . $pass); $query = "UPDATE lcm_author\n\t\t\t\t\tSET password = '******',\n\t\t\t\t\t\talea_actuel = '" . $alea_current . "',\n\t\t\t\t\t\talea_futur = '" . $alea_future . "'\n\t\t\t\t\tWHERE id_author = '" . $id_author . "'"; lcm_query($query); return true; }