/** * Sends a new password */ function forgotPassword() { $membername = trim(postVar('name')); if (!MEMBER::exists($membername)) { doError(_ERROR_NOSUCHMEMBER); } $mem = MEMBER::createFromName($membername); /* below keeps regular users from resetting passwords using forgot password feature Removing for now until clear why it is required.*/ /*if (!$mem->canLogin()) doError(_ERROR_NOLOGON_NOACTIVATE);*/ // check if e-mail address is correct if (!($mem->getEmail() == postVar('email'))) { doError(_ERROR_INCORRECTEMAIL); } // send activation link $mem->sendActivationLink('forgot'); if (postVar('url')) { redirect(postVar('url')); } else { // header ("Content-Type: text/html; charset="._CHARSET); sendContentType('text/html', '', _CHARSET); echo _MSG_ACTIVATION_SENT; echo '<br /><br />Return to <a href="' . $CONF['IndexURL'] . '" title="' . $CONF['SiteName'] . '">' . $CONF['SiteName'] . '</a>'; } exit; }
function doTemplateVar(&$item) { global $DIR_MEDIA, $CONF; // see if there is a podcast file here if (strstr($item->body . " " . $item->more, PODCAST_MARKER)) { $mem = MEMBER::createFromName($item->author); $id = $mem->getId(); $search = "/\"(http:\\/\\/.*?\\.(mp(e?g|2|3|4)|wm[adfvxz]|torrent))\"/i"; preg_match($search, $item->body . " " . $item->more, $result); $mfile = explode("/", $result[1]); $file = $DIR_MEDIA . $id . '/' . $mfile[sizeof($mfile) - 1]; if (file_exists($file)) { $size = filesize($file); } else { $hdrs = array_change_key_case(get_headers($result[1], 1), CASE_LOWER); $size = isset($hdrs['content-length']) ? $hdrs['content-length'] : 0; } $type = $this->get_contenttype($result[1]); $url = $result[1]; echo "<enclosure url=\"{$url}\" length=\"{$size}\" type=\"{$type}\"/>"; } }