function update_subscriptions() { global $config, $_product_id, $t, $db, $vars; $_amember_id = $_SESSION['_amember_id']; $member_id = intval($_amember_id); $db->delete_member_threads($member_id); if (!$vars['unsubscribe']) { $q = $db->query($s = "\n UPDATE {$db->config['prefix']}members\n SET unsubscribed=0\n WHERE member_id={$member_id}\n "); $db->add_member_threads($member_id, $vars['threads']); } else { $q = $db->query($s = "\n UPDATE {$db->config['prefix']}members\n SET unsubscribed=1\n WHERE member_id={$member_id}\n "); } // // Begin Mod for aMail Plugin... // $newmember = $db->get_user($member_id); $oldmember = $newmember; $oldmember['unsubscribed'] = $newmember['unsubscribed'] ? 0 : 1; plugin_subscription_updated($member_id, $oldmember, $newmember); // // End Mod for aMail Plugin // html_redirect("member.php", false, _TPL_NEWSLETTER_INFO_SAVED, _TPL_NEWSLETTER_INFO_UPDATED); exit; }
function check_login($login, $pass_o, &$member_id, $accept_md5 = 0) { global $config; $login = $this->escape($login); $pass = $this->escape($pass_o); $q = $this->query("SELECT pass,member_id\n FROM {$this->config['prefix']}members WHERE login='******'"); $member_id = 0; list($p, $member_id) = mysql_fetch_row($q); if (!strcmp($p, $pass_o)) { return 1; } elseif ($config['accept_md5'] && md5($pass_o) == $p) { $oldmember = $this->get_user($member_id); $this->query("UPDATE\n {$this->config['prefix']}members\n SET pass='******'\n WHERE login='******'\n "); $newmember = $this->get_user($member_id); plugin_subscription_updated($member_id, $oldmember, $newmember); plugin_update_users($member_id); return 1; } elseif ($config['accept_md5_plus_username'] && md5($pass_o . $login) == $p) { $oldmember = $this->get_user($member_id); $this->query("UPDATE\n {$this->config['prefix']}members\n SET pass='******'\n WHERE login='******'\n "); $newmember = $this->get_user($member_id); plugin_subscription_updated($member_id, $oldmember, $newmember); plugin_update_users($member_id); return 1; } elseif ($config['accept_crypt'] && crypt($pass_o, $p) == $p) { $oldmember = $this->get_user($member_id); $this->query("UPDATE\n {$this->config['prefix']}members\n SET pass='******'\n WHERE login='******'\n "); $newmember = $this->get_user($member_id); plugin_subscription_updated($member_id, $oldmember, $newmember); plugin_update_users($member_id); return 1; } elseif ($accept_md5 && md5($p) == $pass_o) { return 1; } return 0; }