function email() { global $CONF, $DB, $FORM, $LNG, $TMPL; $username = $DB->escape($FORM['u']); list($email) = $DB->fetch("SELECT email FROM {$CONF['sql_prefix']}_sites WHERE username = '******'", __FILE__, __LINE__); if ($email) { require_once "{$CONF['path']}/sources/misc/session.php"; $session = new session(); $TMPL['sid'] = $session->create('lost_pw', $username, 0); $lost_pw_email = new skin('lost_pw_email'); $lost_pw_email->send_email($email); $TMPL['content'] = $this->do_skin('lost_pw_finish'); } else { $this->error($LNG['g_invalid_u']); } }
function process($ip, $ip_sql) { global $CONF, $DB, $FORM, $TMPL; // Review if (isset($FORM['review']) && $FORM['review']) { $date = date("Y-m-d H:i:s", time() + 3600 * $CONF['time_offset']); list($id) = $DB->fetch("SELECT MAX(id) + 1 FROM {$CONF['sql_prefix']}_reviews", __FILE__, __LINE__); if (!$id) { $id = 1; } $review = strip_tags($FORM['review']); $review = nl2br($review); $review = $this->bad_words($review); $TMPL['review'] = $review; if ($CONF['email_admin_on_review']) { $rate_email_admin = new skin('rate_email_admin'); $rate_email_admin->send_email($CONF['your_email']); } $review = $DB->escape($review); $DB->query("INSERT INTO {$CONF['sql_prefix']}_reviews (username, id, date, review, active) VALUES ('{$TMPL['username']}', {$id}, '{$date}', '{$review}', {$CONF['active_default_review']})", __FILE__, __LINE__); } // Rating $rating = intval($FORM['rating']); if ($rating > 5) { $rating = 5; } elseif ($rating < 1) { $rating = 1; } $DB->query("UPDATE {$CONF['sql_prefix']}_stats SET total_rating = total_rating + {$rating}, num_ratings = num_ratings + 1 WHERE username = '******'username']}'", __FILE__, __LINE__); // Update the IP log if ($ip == $ip_sql) { $DB->query("UPDATE {$CONF['sql_prefix']}_ip_log SET rate = 1 WHERE ip_address = '{$ip}' AND username = '******'username']}'", __FILE__, __LINE__); } else { $DB->query("INSERT INTO {$CONF['sql_prefix']}_ip_log (ip_address, username, rate) VALUES ('{$ip}', '{$TMPL['username']}', 1)", __FILE__, __LINE__); } $TMPL['content'] = $this->do_skin('rate_finish'); }
function do_approve($username) { global $CONF, $DB, $LNG, $TMPL; $DB->query("UPDATE {$CONF['sql_prefix']}_sites SET active = 1 WHERE username = '******'", __FILE__, __LINE__); list($TMPL['username'], $TMPL['url'], $TMPL['title'], $TMPL['description'], $TMPL['category'], $TMPL['banner_url'], $TMPL['email'], $TMPL['join_date']) = $DB->fetch("SELECT username, url, title, description, category, banner_url, email, join_date FROM {$CONF['sql_prefix']}_sites WHERE username = '******'", __FILE__, __LINE__); if ($CONF['google_friendly_links']) { $TMPL['verbose_link'] = ""; } else { $TMPL['verbose_link'] = "index.php?a=in&u={$TMPL['username']}"; } $TMPL['link_code'] = $this->do_skin('link_code'); $LNG['join_welcome'] = sprintf($LNG['join_welcome'], $TMPL['list_name']); $join_email = new skin('join_email'); $join_email->send_email($TMPL['email']); }
function process() { global $CONF, $DB, $FORM, $LNG, $TMPL; $TMPL['username'] = $DB->escape($FORM['u'], 1); $TMPL['url'] = $DB->escape($FORM['url'], 1); $TMPL['title'] = $DB->escape($FORM['title'], 1); $FORM['description'] = str_replace(array("\r\n", "\n", "\r"), ' ', $FORM['description']); $TMPL['description'] = $DB->escape($FORM['description'], 1); $TMPL['category'] = $DB->escape($FORM['category'], 1); $TMPL['banner_url'] = $DB->escape($FORM['banner_url'], 1); $TMPL['email'] = $DB->escape($FORM['email'], 1); $TMPL['title'] = $this->bad_words($TMPL['title']); $TMPL['description'] = $this->bad_words($TMPL['description']); if ($this->check_ban('join')) { if ($this->check_input('join')) { $password = md5($FORM['password']); require_once "{$CONF['path']}/sources/in.php"; $short_url = in::short_url($TMPL['url']); $join_date = date('Y-m-d', time() + 3600 * $CONF['time_offset']); $user_ip = $DB->escape($_SERVER['REMOTE_ADDR'], 1); $DB->query("INSERT INTO {$CONF['sql_prefix']}_sites (username, password, url, short_url, title, description, category, banner_url, email, join_date, active, openid, user_ip)\n VALUES ('{$TMPL['username']}', '{$password}', '{$TMPL['url']}', '{$short_url}', '{$TMPL['title']}', '{$TMPL['description']}', '{$TMPL['category']}', '{$TMPL['banner_url']}', '{$TMPL['email']}', '{$join_date}', {$CONF['active_default']}, 0, '{$user_ip}')", __FILE__, __LINE__); $DB->query("INSERT INTO {$CONF['sql_prefix']}_stats (username) VALUES ('{$TMPL['username']}')", __FILE__, __LINE__); if ($CONF['google_friendly_links']) { $TMPL['verbose_link'] = ""; } else { $TMPL['verbose_link'] = "index.php?a=in&u={$TMPL['username']}"; } $TMPL['link_code'] = $this->do_skin('link_code'); $LNG['join_welcome'] = sprintf($LNG['join_welcome'], $TMPL['list_name']); if ($CONF['email_admin_on_join']) { $join_email_admin = new skin('join_email_admin'); $join_email_admin->send_email($CONF['your_email']); } if ($CONF['active_default']) { $join_email = new skin('join_email'); $join_email->send_email($TMPL['email']); $TMPL['content'] = $this->do_skin('join_finish'); } else { $TMPL['content'] = $this->do_skin('join_finish_approve'); } } else { $this->form(); } } else { $this->form(); } }