Esempio n. 1
0
<?php

include_once 'classes/forgot.class.php';
$forgot = new Forgot();
// This is for the modal forgotten password form on login.php
// This must be called before the header
if (isset($_POST['usernamemail'])) {
    $forgot->modal_process();
    exit;
}
include_once 'header.php';
$forgot->process();
include_once 'footer.php';
 public function actionChangepassword()
 {
     $token = isset($_POST['token']) ? $_POST['token'] : '';
     $password = isset($_POST['password']) ? $_POST['password'] : '';
     $model = new Forgot();
     $userModel = new User();
     $isForgot = $model->findByAttributes(array('token' => $token));
     $userModel->updateByPk($isForgot->user_id, array('password' => $password));
     $isForgot->delete();
     $isFirst = false;
     if ($userModel->loginDate == null) {
         $isFirst = true;
     }
     $user = $userModel->findByPk($isForgot->user_id);
     $this->actionLogin($user->attributes['email'], $user->attributes['password'], $isFirst);
 }
Esempio n. 3
0
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
**/
require_once 'Auth.php';
require_once 'Forgot.php';
require_once 'Login.php';
require_once 'Register.php';
if (isset($_POST['login'])) {
    $login = new Login();
    $login->login();
    print $login->printOutput();
} else {
    if (isset($_POST['forgot'])) {
        $forgot = new Forgot();
        $forgot->forgot();
        print $forgot->printOutput();
    } else {
        if (isset($_POST['register'])) {
            $register = new Register();
            $register->register();
            print $register->printOutput();
        } else {
            if (isset($_POST["accept"])) {
                $auth = new Auth();
                try {
                    $auth->authenticate();
                } catch (Exception $ex) {
                    $auth->acceptTerms();
                    print $auth->printOutput();