aboutsummaryrefslogtreecommitdiff
path: root/actions/login.php
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-08 16:04:29 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-08 16:04:29 +0000
commite5bd6c0c670f5ad5f309b63d11da6cc35122958b (patch)
tree42ab7df3d0f2b472edba59539ba28823880420fa /actions/login.php
parent1739ce16cfa0933a09496f66b014885c281d114a (diff)
downloadelgg-e5bd6c0c670f5ad5f309b63d11da6cc35122958b.tar.gz
elgg-e5bd6c0c670f5ad5f309b63d11da6cc35122958b.tar.bz2
crude login and logout functionality
git-svn-id: https://code.elgg.org/elgg/trunk@118 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/login.php')
-rw-r--r--actions/login.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/actions/login.php b/actions/login.php
new file mode 100644
index 000000000..2dc3371ad
--- /dev/null
+++ b/actions/login.php
@@ -0,0 +1,42 @@
+<?php
+
+ /**
+ * Elgg login action page
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+ // Get username and password
+ require_once('../engine/start.php');
+ global $CONFIG;
+
+ $username = get_input('username');
+ $password = get_input("password");
+ $persistent = get_input("persistent");
+
+ if (empty($passthru)) {
+ $passthru = $CONFIG->url;
+ }
+
+ // If all is present and correct, try to log in
+ if (!empty($username) && !empty($password)) {
+ $result = login($username, $password, $persistent);
+ }
+
+ // Set the system_message as appropriate
+
+ if ($result) {
+ system_message("You have been logged in.");
+ } else {
+ system_message("We couldn't log you in. Make sure your details are correct and please try again.");
+ }
+
+ header("Location: {$passthru}");
+ exit;
+
+?> \ No newline at end of file