示例#1
0
文件: signup.php 项目: rgllm/Diary
     if ($_POST["cmbcountry"] == 0) {
         $error_signup_country = incorrect_signup_coutry;
     }
     if ($error_signup_username == NULL && $error_signup_name == NULL && $error_signup_email == NULL && $error_signup_password == NULL && $error_signup_iam == NULL && $error_signup_birthday_day == NULL && $error_signup_birthday_month == NULL && $error_signup_birthday_year == NULL && $error_signup_country == NULL) {
         $exists_username = motor::exists_username($_POST["txtsignup_username"]);
         if ($exists_username == true) {
             $error_signup_username = exists_username;
         } else {
             $exists_email = motor::exists_email($_POST["txtsignup_email"]);
             if ($exists_email == true) {
                 $error_signup_email = exists_email;
             } else {
                 $member = new member();
                 $member->setusername($_POST["txtsignup_username"]);
                 $member->setname($_POST["txtsignup_name"]);
                 $member->setemail($_POST["txtsignup_email"]);
                 $member->setpassword($_POST["txtsignup_password"]);
                 $member->setsex($_POST["cmbiam"]);
                 $member->setbirthday_day($_POST["cmbbirthday_day"]);
                 $member->setbirthday_month($_POST["cmbbirthday_month"]);
                 $member->setbirthday_year($_POST["cmbbirthday_year"]);
                 $country = new country();
                 $country->setid($_POST["cmbcountry"]);
                 $member->setcountry($country);
                 motor::signup($member);
                 $_SESSION["signup_thanks"] = $_POST["txtsignup_email"];
                 header("Location: signup_ok.php");
             }
         }
     }
 }
示例#2
0
文件: header.php 项目: rgllm/Diary
<?php

if (!isset($_SESSION)) {
    session_start();
}
require_once "includes/functions.php";
new motor(false);
if (motor::authenticated(false) == false) {
    $error_login = NULL;
    if ($_POST) {
        if (isset($_POST["btnlogin"])) {
            $member = new member();
            $member->setemail($_POST["txtlogin_email"]);
            $member->setpassword($_POST["txtlogin_password"]);
            if (isset($_POST["cbkeep_logged"])) {
                $result = motor::login($member, true);
            } else {
                $result = motor::login($member, false);
            }
            if ($result == NULL) {
                $error_login = incorrect_login;
            } else {
                if ($result->getstate == 0 && strlen($result->getcode_signup) > 0) {
                    $error_login = member_unconfirmed;
                } else {
                    if ($result->getstate == 0 && !strlen($result->getcode_signup) > 0) {
                        motor::activate($_POST["txtlogin_email"]);
                        $_SESSION["login_reactivated"] = 1;
                        header("Location: index.php");
                    } else {
                        if ($result->getstate == 1 && strlen($result->getcode_signup) > 0) {
示例#3
0
文件: functions.php 项目: rgllm/Diary
 protected static function create_member($obj)
 {
     $member = new member();
     $member->setid($obj["id"]);
     $member->setusername($obj["username"]);
     $member->setname($obj["name"]);
     $member->setemail($obj["email"]);
     $member->setpassword($obj["password"]);
     $member->setsex($obj["sex"]);
     $member->setbirthday_day($obj["birthday_day"]);
     $member->setbirthday_month($obj["birthday_month"]);
     $member->setbirthday_year($obj["birthday_year"]);
     $member->setcountry(self::country($obj["id_country"]));
     $member->settype(self::type($obj["id_type"]));
     $member->setlang(self::language("id=" . $obj["id_lang"]));
     $member->setstate($obj["state"]);
     $member->setcode_signup($obj["code_signup"]);
     $member->setsignup_date($obj["signup_date"]);
     $member->setlast_login($obj["last_login"]);
     $member->setlast_ip($obj["last_ip"]);
     return $member;
 }