From 8e99be55211d3d0d9f6b310a78e34b81afc10854 Mon Sep 17 00:00:00 2001
From: BlackLight <blacklight@autistici.org>
Date: Sat, 25 Dec 2010 23:17:30 +0100
Subject: [PATCH] Logout command supported

---
 blash.json           |  1 +
 commands/logout.json | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 commands/logout.json

diff --git a/blash.json b/blash.json
index d8fca3c..d4e4909 100644
--- a/blash.json
+++ b/blash.json
@@ -192,6 +192,7 @@
 		"echo",
 		"eval",
 		"find",
+		"logout",
 		"ls",
 		"man",
 		"pwd",
diff --git a/commands/logout.json b/commands/logout.json
new file mode 100644
index 0000000..ba3fb45
--- /dev/null
+++ b/commands/logout.json
@@ -0,0 +1,23 @@
+{
+	"name" : "logout",
+
+	"info" : {
+		"syntax" : "logout",
+		"brief" : "End the current user session",
+	},
+
+	"action" : function ( arg )
+	{
+		var out = '';
+
+		if ( shell.user == shell.json.user )
+		{
+			return out;
+		}
+
+		shell.user = shell.json.user;
+		document.cookie = '';
+		return out;
+	},
+}
+