Esempio n. 1
0
function get_session_account($useAccount = true)
{
    $sessionAccount = "";
    if (!empty($_SESSION[MOBILE_SESSION_ACCOUNT]) && !empty($_SESSION[MOBILE_SESSION_ACCOUNT]['openid'])) {
        $sessionAccount = $_SESSION[MOBILE_SESSION_ACCOUNT];
    } else {
        $sessionAccount = array('openid' => create_sessionid());
        $_SESSION[MOBILE_SESSION_ACCOUNT] = $sessionAccount;
    }
    if ($useAccount && !empty($sessionAccount)) {
        $member = mysqld_select("SELECT * FROM " . table('member') . " where openid=:openid and istemplate=1 ", array(':openid' => $sessionAccount['openid']));
        if (empty($member['openid'])) {
            $data = array('mobile' => "", 'pwd' => md5(rand(10000, 99999)), 'createtime' => time(), 'status' => 1, 'istemplate' => 1, 'experience' => 0, 'openid' => $sessionAccount['openid']);
            mysqld_insert('member', $data);
        }
    }
    return $sessionAccount;
}
Esempio n. 2
0
    exit;
}
if ($action == "register") {
    $email = strtolower(cleanQuery($_POST['email']));
    $sql1 = "select * from users where email='" . $email . "'";
    $res1 = mysqli_query($mysqli, $sql1);
    if ($email != '' && mysqli_num_rows($res1) == 0) {
        $name = cleanQuery($_POST['name']);
        $gender = cleanQuery($_POST['gender']);
        $password = sha1(cleanQuery($_POST['password']));
        $countrycode = cleanQuery($_POST['countrycode']);
        $phone = cleanQuery($_POST['phone']);
        $city = cleanQuery($_POST['city']);
        $state = cleanQuery($_POST['state']);
        $country = cleanQuery($_POST['country']);
        $vcode = create_sessionid(10);
        $esubject = "AAP Call Campaign - New User";
        $emailtext = "<div style='font-size:13px; font-family:arial; line-height:21px;'>Citizen Call Campaign Registration Details: \r\n<br/><br/>\r\nName: " . $name . "\r\n<br/>Gender: " . $gender . "\r\n<br/>Country Code: " . $countrycode . "\r\n<br/>Phone No: " . $phone . "\r\n<br/>Email Id: " . $email . "\r\n<br/>City: " . $city . "\r\n<br/>State: " . $state . "\r\n<br/>Country: " . $country . "\r\n</div>";
        # Send the email to you
        $ip = getenv("REMOTE_ADDR");
        $query = "insert into users (name,state_id,gender,password,phone,email,city,state,country,datecreated,countrycode,confirmation, ip_address) VALUES ('{$name}','{$stateid}','{$gender}','{$password}','{$phone}','{$email}','{$city}','{$state}','{$country}','{$date}','{$countrycode}','{$vcode}','{$ip}')";
        $a = mysqli_query($mysqli, $query);
        require 'includes/mailer.php';
        //sendmail($email,$name,$adminemail,$esubject,$emailtext);
        //echo $query;
        $sql2 = "select * from email_templates where id=5";
        $res2 = mysqli_query($mysqli, $sql2);
        $row2 = mysqli_fetch_assoc($res2);
        $esubject = $row2['subject'];
        $esubject = str_replace("[NAME]", $name, $esubject);
        $emailtext = $row2['description'];