aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/login.php42
-rw-r--r--actions/logout.php34
2 files changed, 76 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
diff --git a/actions/logout.php b/actions/logout.php
new file mode 100644
index 000000000..c75a7c30e
--- /dev/null
+++ b/actions/logout.php
@@ -0,0 +1,34 @@
+<?php
+
+ /**
+ * Elgg logout 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/
+ */
+
+ //delete this
+ require_once('../engine/start.php');
+ global $CONFIG;
+
+ // Log out
+ $result = logout();
+
+ // Set the system_message as appropriate
+
+ if ($result) {
+ system_message("You have been logged out.");
+ } else {
+ system_message("We couldn't log you out. We're not sure why, to be honest. Try again?");
+ }
+
+ //direct to frontpage
+ $url = $CONFIG->url;
+ header("Location: {$url}");
+ exit;
+
+?> \ No newline at end of file