예제 #1
0
<?php

use itlife\user\User;
infra_test(true);
if ($_GET['email']) {
    User::sentEmail($_GET['email'], 'test');
    header('Location: ?*user/sentEmail.php');
}
?>
Sent: <input class="input" style="padding:1px 5px" placeholder="Email" type="email" name="useremail" 
onkeypress=" if (event.keyCode === 13) location.href='?*user/sentEmail.php?email='+this.value;">

예제 #2
0
파일: get.php 프로젝트: akiyatkin/user
        }
        $oldpas = md5($myemail . $oldpassword);
        $user = infra_session_getUser();
        if ($user['password'] != $oldpas) {
            return infra_err($ans, 'Invalid current password.');
        }
        if (!User::checkData($newpassword, 'password')) {
            return infra_err($ans, 'You must specify a valid new password.');
        }
        $newpas = md5($myemail . $newpassword);
        if ($newpassword != $repeatnewpassword) {
            return infra_err($ans, 'Passwords do not match.');
        }
        infra_session_setPass($newpas);
        infra_view_setCookie(infra_session_getName('pass'), md5($newpas));
        $msg = User::sentEmail($myemail, 'newpass');
        return infra_ret($ans, 'Password changed.');
    }
}
if ($type == 'signin') {
    if ($myemail) {
        return infra_err($ans, 'You are already logged in.');
    }
    if ($submit) {
        $email = trim(strip_tags($_POST['email']));
        if (!User::checkData($email, 'email')) {
            return infra_err($ans, 'You must specify a valid email address.');
        }
        $userData = infra_session_getUser($email);
        $password = trim($_POST['password']);
        if (md5($email . $password) != $userData['password']) {