Example #1
0
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
//
// @(#) $Id: s.confirm.php 1.3 03/12/04 17:58:15-00:00 jpradomaia $
//
include_once "config.inc.php";
include_once APP_INC_PATH . "class.template.php";
include_once APP_INC_PATH . "class.user.php";
include_once APP_INC_PATH . "class.auth.php";
include_once APP_INC_PATH . "db_access.php";
$tpl = new Template_API();
$tpl->setTemplate("confirm.tpl.html");
if (@$HTTP_GET_VARS['cat'] == 'newuser') {
    $res = @User::checkHash($HTTP_GET_VARS["email"], $HTTP_GET_VARS["hash"]);
    if ($res == 1) {
        User::confirmVisitorAccount($HTTP_GET_VARS["email"]);
        // redirect user to login form with pretty message
        Auth::redirect('index.php?err=8&email=' . $HTTP_GET_VARS["email"]);
        exit;
    }
    $tpl->assign("confirm_result", $res);
} elseif (@$HTTP_GET_VARS['cat'] == 'password') {
    $res = @User::checkHash($HTTP_GET_VARS["email"], $HTTP_GET_VARS["hash"]);
    if ($res == 1) {
        User::confirmNewPassword($HTTP_GET_VARS["email"]);
        $tpl->assign("email", $HTTP_GET_VARS["email"]);
    }
    $tpl->assign("confirm_result", $res);
}
$tpl->displayTemplate();
Example #2
0
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('confirm.tpl.html');
if (@$_GET['cat'] == 'newuser') {
    $res = @User::checkHash($_GET['email'], $_GET['hash']);
    if ($res == 1) {
        User::confirmVisitorAccount($_GET['email']);
        // redirect user to login form with pretty message
        Auth::redirect('index.php?err=8&email=' . $_GET['email']);
        exit;
    }
    $tpl->assign('confirm_result', $res);
} elseif (@$_GET['cat'] == 'password') {
    $res = @User::checkHash($_GET['email'], $_GET['hash']);
    if ($res == 1) {
        User::confirmNewPassword($_GET['email']);
        $tpl->assign('email', $_GET['email']);
    }
    $tpl->assign('confirm_result', $res);
}
$tpl->displayTemplate();