Exemplo n.º 1
0
<?php

require_once "../includes/functions.php";
require_once "../includes/session.php";
include "../includes/header.php";
if (is_logged_in()) {
    redirect_to("index.php");
}
$_SESSION["errors"] = array();
$_SESSION["message"] = "";
login_process();
?>

		<login>
			<h1>Login</h1>

			<?php 
echo $_SESSION["message"];
?>
			<br />

			<?php 
echo form_errors($_SESSION["errors"]);
?>
			<form action="login.php" method="post"><br />
				Name:
				<br /><input type="text" name="username" value="
				<?php 
if (isset($_SESSION["username"])) {
    echo htmlspecialchars($_SESSION["username"]);
}
function login_shortcode()
{
    ob_start();
    login_process();
    return ob_get_clean();
}
Exemplo n.º 3
0
 function login()
 {
     global $data, $user;
     if ($user) {
         redirect('system');
     }
     //see if currently logging in
     if ($this->input->post('action') && $this->input->post('action') == "login") {
         login_process($this->input->post('username'), $this->input->post('password'));
         if ($this->session->userdata('uid') > 0) {
             redirect('system');
         }
     }
     $data['page'] = "login";
     $data['user'] = $user;
     $this->load->view('template', $data);
 }
Exemplo n.º 4
0
                    "' . $email . '",
                    NOW(),
                    NOW()
                )
            ';

            $user_insert = mysql_query($user_insert_sql) or die (mysql_error());

            if ($user_insert) {
                $user_id = mysql_insert_id();
                accounts_start_session($user_id);
            }
        }

        //    Done.. Now, what are we returning?
        return array($post_values, $errors);

    }



    //    Functions defined - do it up good!

    if ($_POST['register']) {
        list($post_values, $errors) = register_process($post_values, $config);   
    }

    if ($_POST['login']) {
        list($post_values, $errors) = login_process($post_values, $config);
    }