Ejemplo n.º 1
0
 case 'password':
     if (!$do->is_password($value, $value)) {
         exit($do->errmsg);
     }
     break;
 case 'payword':
     if (!$do->is_payword($value, $value)) {
         exit($do->errmsg);
     }
     break;
 case 'email':
     $value = trim($value);
     if (!$do->is_email($value)) {
         exit($do->errmsg);
     }
     if ($do->email_exists($value)) {
         exit($L['member_email_reg']);
     }
     break;
 case 'emailcode':
     $value = trim($value);
     if (!preg_match("/[0-9]{6}/", $value)) {
         exit(' ');
     }
     $session = new dsession();
     if ($_SESSION['email_code'] != md5($_SESSION['email'] . '|' . $value)) {
         exit(' ');
     }
     break;
 case 'mobile':
     $value = trim($value);
Ejemplo n.º 2
0
require DT_ROOT . '/include/post.func.php';
require MD_ROOT . '/member.class.php';
$do = new member();
$session = new dsession();
$could_emailcode = $MOD['emailcode_register'] && $DT['mail_type'] != 'close';
$action_sendcode = crypt_action('sendcode');
if ($could_emailcode) {
    if ($MOD['checkuser'] == 2) {
        $MOD['checkuser'] = 0;
    }
    if ($action == $action_sendcode) {
        $email = isset($value) ? trim($value) : '';
        if (!is_email($email)) {
            exit('2');
        }
        if ($do->email_exists($email)) {
            exit('3');
        }
        if (!$do->is_email($email)) {
            exit('4');
        }
        isset($_SESSION['email_send']) or $_SESSION['email_send'] = 0;
        if ($_SESSION['email_time'] && $DT_TIME - $_SESSION['email_time'] < 60) {
            exit('5');
        }
        if ($_SESSION['email_send'] > 9) {
            exit('6');
        }
        $emailcode = random(6, '0123456789');
        $_SESSION['email'] = $email;
        $_SESSION['email_code'] = md5($email . '|' . $emailcode);