示例#1
0
function insert_user($username, $userpass, $REMOTE_ADDR, $REMOTE_PORT, $HTTP_USER_AGENT, $active)
{
    $username = $username;
    $userpass = $userpass;
    if (NULL == exists_user($username)) {
        return Query("INSERT INTO users(username,userpass,REGISTER_REMOTE_ADDR,REGISTER_REMOTE_PORT,REGISTER_HTTP_USER_AGENT,active) \n\t\tValues ('" . $username . "','" . $userpass . "','" . $REMOTE_ADDR . "','" . $REMOTE_PORT . "','" . $HTTP_USER_AGENT . "' ,'" . $active . "')");
    } else {
        return NULL;
    }
}
示例#2
0
include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/models/user/sel_user.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/models/user/ins_user.php';
$debug = isset($_SESSION['debug']) && $_SESSION['debug'] == "on" ? 1 : 0;
if ($debug) {
    /*Head of the page*/
    include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/views/building/head.php';
    dump($_SESSION, "SESSION");
    dump($_POST, "POST");
}
$failure = 0;
/*For disable or enable registration.*/
if (1) {
    if (isset($_POST['useremail_1']) && !empty($_POST['useremail_1']) && isset($_POST['useremail_2']) && !empty($_POST['useremail_2']) && isset($_POST['userpass_1']) && !empty($_POST['userpass_1']) && isset($_POST['userpass_2']) && !empty($_POST['userpass_2'])) {
        if ($_POST['useremail_1'] == $_POST['useremail_2'] && $_POST['userpass_1'] == $_POST['userpass_2']) {
            $username = trim($_POST['useremail_1']);
            if (NULL == exists_user(0, $username)) {
                $active = "act" . md5(mt_rand());
                if ($userid = insert_user($username, md5(trim($_POST['userpass_1'])), $_SERVER['REMOTE_ADDR'], $_SERVER['REMOTE_PORT'], $_SERVER['HTTP_USER_AGENT'], $active)) {
                    $url = "" . $_SERVER['SERVER_NAME'] . "contacts/models/user/activation.php?id=" . $userid . "&user="******"&active=" . $active . "";
                    $message = "<h2>Thank you " . $username . " for registering!</h2><hr /><br /><p>Your account is not activated, \n\t\t\t\t\tTo activate click on the following link: </p>" . $url . "<div><sub>Mycnts © 2014<sub></div>";
                    if (mail_utf8($_POST['useremail_1'], "Account validation MyCnts", $message)) {
                        $_SESSION['success'] = ($debug ? "<b>register.php:</b><br />" : "") . "Thanks for signing up! We've sent an email account activation at: <b>'" . $username . "'</b>";
                    } else {
                        $_SESSION['error'] = ($debug ? "<b>register.php:</b><br />" : "") . "Ooops! Something went wrong with sending e-mail!";
                    }
                } else {
                    $failure = 1;
                    $_SESSION['error'] = ($debug ? "<b>register.php:</b><br />" : "") . "Ooops! The registration process failed!";
                }
            } else {
                $failure = 1;
示例#3
0
<?php

ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);
include "base.php";
include "utilidades.php";
include "autentica_facebook_base.php";
if ($logado) {
    if (exists_user($bd, $userId)) {
        include "index_iconos.php";
    } else {
        include "index_completo_sin_usuario.php";
    }
} else {
    include "index_mini.php";
}
示例#4
0
     } else {
         if ($function == 'password_reset') {
             //email mit neuem pw senden
             /*
             Possible errors:
             
                 503: problems with looking up the user or sending the email
                 400: 12 (No email address on file)
                 400: 3 (Incorrect or missing username)
                 400: 2 (Incorrect or missing captcha)
             */
             report_problem(WEAVE_ERROR_NO_EMAIL, 400);
         } else {
             if ($function == '' && $collection == '' && $id == '') {
                 //$db = new WeaveStorage($username);
                 if (exists_user($db)) {
                     exit(json_encode(1));
                 } else {
                     exit(json_encode(0));
                 }
             } else {
                 report_problem(WEAVE_ERROR_INVALID_PROTOCOL, 400);
             }
         }
     }
 } else {
     if ($_SERVER['REQUEST_METHOD'] == 'PUT') {
         if (ENABLE_REGISTER) {
             $db = new WeaveStorage(null);
             //Requests that an account be created for username.
             /*
示例#5
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');
ob_start();
include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/models/plugins/SqlFormatter.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/models/debug.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/models/model.php';
session_name("CntId");
session_start();
if (isset($_GET['id']) && isset($_GET['user']) && isset($_GET['active'])) {
    if ($Records = exists_user($_GET['id'], $_GET['user'])) {
        switch ($Records[0]['active']) {
            case "Activated":
                echo "<br />Activated<br />";
                $_SESSION['notice'] = "<b>activation.php:</b><br />User account <b>'" . $username . "'</b> it is already activated.";
                break;
            case "Locked":
                echo "<br />Locked<br />";
                $_SESSION['warning'] = "<b>activation.php:</b><br />User account <b>'" . $username . "'</b> is locked from administrator!";
                break;
            default:
                echo "<br />default<br />";
                if (exists_activecode($_GET['user'], $_GET['active'])) {
                    activate_user($_GET['user'], $_GET['active']);
                    $_SESSION['success'] = "<b>activation.php:</b><br />User account <b>'" . $_GET['user'] . "'</b> successfully activated!, now you can use your username and password to login.";
                } else {
                    $_SESSION['warning'] = "<b>activation.php:</b><br />There is no correlation of the activation code to account: <b>" . $_GET['user'] . "</b>!";
                }
                break;
        }
示例#6
0
include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/models/debug.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/models/user/sel_user.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/models/user/upt_user.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/models/model.php';
$username = isset($_POST['user']) ? trim($_POST['user']) : 0;
$userpass = isset($_POST['userpass']) ? md5(trim($_POST['userpass'])) : 0;
$debug = isset($_SESSION['debug']) && $_SESSION['debug'] == "on" ? 1 : 0;
if ($debug) {
    /*Head of the page*/
    include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/views/building/head.php';
    dump($_SESSION, "SESSION");
    dump($_POST, "POST");
}
$failure = 0;
if ($username && $userpass) {
    if (NULL != ($Records = exists_user(0, $username))) {
        $userid = $Records[0]['userid'];
        if (NULL != exists_password($userid, $userpass)) {
            update_confid($userid, $_POST['confid']);
            switch ($Records[0]['active']) {
                case "Activated":
                    echo "<br />case: \"Activated\"<br />";
                    $_SESSION['becomeLogin'] = 1;
                    $_SESSION['userid'] = $userid;
                    $_SESSION['username'] = $username;
                    $_SESSION['isLoggedIn'] = 1;
                    echo "<br />User Is Logged In!<br />";
                    break;
                case "Locked":
                    echo "<br />case: \"Locked\"<br />";
                    $_SESSION['warning'] = ($debug ? "<b>login.php:</b><br />" : "") . "Account: " . $username . " is disabled from administrator!";