function ajaxlogin()
 {
     if (!formCheck()) {
         $this->JsonReturn('表单提交有误,请刷新页面再试');
     }
     //接受参数
     $user = $this->_post('user');
     $pass = $this->_post('password');
     $refer = urldecode($this->_post('refer'));
     $remember = $this->_postid('remember', 0);
     if (!$user || !$pass) {
         $this->JsonReturn('账号或密码为空', null, 0);
     }
     $rs = D('steadmin')->where(array('username' => $user, 'psw' => D('steadmin')->setUserPassword($pass), 'status' => 1))->find();
     //===记录操作日志====
     parent::saveSySLog(5, array('username' => $user), 0, array(), '后台登陆');
     //===记录操作日志====
     if ($rs) {
         if (!$rs['effective'] || $rs['effective'] && $rs['effective'] - TIME > 0) {
             //帐号无期限或者有期限并且还未过期
             if (in_array($rs['groupid'], array(3, 4))) {
                 $this->JsonReturn('抱歉,您的组别无法登陆');
             }
             //修改登录信息
             D('steadmin')->setUserLogin($rs, $remember);
             formClear();
             $this->JsonReturn('ok', array('user_id' => $rs['user_id'], 'refer' => $refer), 1);
         } else {
             $this->JsonReturn('抱歉,你的帐号已过期,暂时无法登陆', null, 0);
         }
     } else {
         //===记录操作日志====
         parent::saveSySLog(5, array('username' => $user, 'psw' => $pass), 0, array(), '后台登陆-失败');
         //===记录操作日志====
         $this->JsonReturn('帐号不存在或者密码错误', null, 0);
     }
 }
Пример #2
0
require_once '../phplib/misc.php';
require_once '../phplib/eventlog.php';
require_once '../phplib/recaptchalib.php';
require_once '../../phplib/db.php';
require_once '../../phplib/utility.php';
$ref = strtolower(get_http_var('journo'));
$_journo = db_getRow("SELECT * FROM journo WHERE ref=?", $ref);
$data = journo_collectData($_journo);
$_keys = parse_ini_file(OPTION_JL_FSROOT . '/conf/recaptcha.ini');
page_header("Email {$_journo['prettyname']}'s profile to a friend");
?>
<div class="main">
<?php 
$params = formFetch();
if ($params['action'] == 'go') {
    $errs = formCheck($params);
    if ($errs) {
        formEmit($params, $errs);
    } else {
        // cool - all ready to go.
        do_it($params);
    }
} else {
    formEmit($params);
}
?>
</div>
<?php 
page_footer();
function formFetch()
{
        }
        if (isset($_POST['checkbox2']) && $_POST['checkbox2'] == 'Yes') {
            $email_message .= "[Atelier 2]\n";
        }
        if (isset($_POST['checkbox3']) && $_POST['checkbox3'] == 'Yes') {
            $email_message .= "[Atelier 3]\n";
        }
        if (isset($_POST['checkbox4']) && $_POST['checkbox4'] == 'Yes') {
            $email_message .= "[Atelier 4]\n";
        }
        $email_message .= "\n";
        $email_message .= "[Commentaires]\n";
        $email_message .= clean_string($comments) . "\n\n";
        $email_message .= "====================================\n\n";
        // Create email headers
        $headers = 'From: ' . $email_from . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'X-Mailer: PHP/' . phpversion();
        // Actually send the mail
        @mail($email_to, $email_subject, $email_message, $headers);
        // Notice the user the mail was sent
        displayMessage("Votre inscription a bien été envoyée.<br/>");
    }
    // What the form handler is actually doing ...
    if (isset($_POST['email'])) {
        $errorFromCheck = formCheck();
        if ($errorFromCheck != "") {
            displayError($errorFromCheck);
        } else {
            sendMail();
        }
    }
}