aboutsummaryrefslogtreecommitdiff
path: root/www/user.php
diff options
context:
space:
mode:
authorJustin J. Novack <jnovack@gmail.com>2012-09-16 11:58:51 -0400
committerJustin J. Novack <jnovack@gmail.com>2012-09-16 11:58:51 -0400
commit57ec8736424dfa1637ea01228b87fbbf458b213f (patch)
treeb038b8b7ae29e6e01ce1c90cf303f43eddf9ecb6 /www/user.php
parentfbaebb7485cfab4948b8fe000ef2a5279b376f04 (diff)
downloadphorkie-57ec8736424dfa1637ea01228b87fbbf458b213f.tar.gz
phorkie-57ec8736424dfa1637ea01228b87fbbf458b213f.zip
ADD: Allow editing of user session data
Diffstat (limited to 'www/user.php')
-rw-r--r--www/user.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/www/user.php b/www/user.php
new file mode 100644
index 0000000..1cc8aeb
--- /dev/null
+++ b/www/user.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Edit user information
+ */
+namespace phorkie;
+require_once 'www-header.php';
+if (!isset($_SESSION['identity'])) {
+ require_once 'secure.php';
+}
+
+if (isset($_POST['name'])) {
+ $_SESSION['name'] = substr(filter_var($_POST['name'], FILTER_SANITIZE_STRING), 0, 35);
+}
+
+if (isset($_POST['email'])) {
+ $_SESSION['email'] = substr(filter_var($_POST['email'], FILTER_SANITIZE_EMAIL), 0, 35);
+}
+
+render(
+ 'user',
+ array(
+ 'identity' => $_SESSION['identity'],
+ 'name' => $_SESSION['name'],
+ 'email' => $_SESSION['email']
+ )
+);
+?>