PaperBag/www/register.php

33 lines
794 B
PHP

<?php
require_once '../Router.php';
require_once 'login.php';
class RegisterPage extends LoginPage {
public $pagekey = "register";
public $title = "Register - PaperBag - Plan & Execute Your Shopping";
public $returnToPage = "/";
function load(){
$this->findReturnPage();
if(Auth::checkLogin(true)){
header("Location: ".$this->returnToPage);
}
}
function doPost(){
$err = Auth::register($this->data['newEmail'], $this->data['newPassword'], $this->data);
if($err === true){
header("Location: login.php?thank");
die();
}
$this->err = $err;
// Do not send the password back to the client...
$this->data['newPassword'] = null;
}
}
$a = new RegisterPage();