aboutsummaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-18 22:20:25 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-18 22:20:25 +0000
commit09d08af9814a4edfb2050cdb47ad8ae20a944472 (patch)
tree43aad705fd98ab1531d7ca19aebdf19d864e60fd /pages
parent9bc9a3e7590ba15039b019da22c60bdd9d9868e0 (diff)
downloadelgg-09d08af9814a4edfb2050cdb47ad8ae20a944472.tar.gz
elgg-09d08af9814a4edfb2050cdb47ad8ae20a944472.tar.bz2
moved profile edit form into core
git-svn-id: http://code.elgg.org/elgg/trunk@7672 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'pages')
-rw-r--r--pages/avatar/edit.php2
-rw-r--r--pages/profile/edit.php32
2 files changed, 34 insertions, 0 deletions
diff --git a/pages/avatar/edit.php b/pages/avatar/edit.php
index a577170a0..5e44eb4b0 100644
--- a/pages/avatar/edit.php
+++ b/pages/avatar/edit.php
@@ -6,6 +6,8 @@
// Only logged in users
gatekeeper();
+elgg_set_context('profile_edit');
+
$title = elgg_echo('avatar:edit');
$content = elgg_view('core/avatar/upload', array('entity' => elgg_get_page_owner()));
diff --git a/pages/profile/edit.php b/pages/profile/edit.php
new file mode 100644
index 000000000..64ffd7dc5
--- /dev/null
+++ b/pages/profile/edit.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Edit profile page
+ */
+
+gatekeeper();
+
+$user = elgg_get_page_owner();
+if (!$user) {
+ register_error(elgg_echo("profile:notfound"));
+ forward();
+}
+
+// check if logged in user can edit this profile
+if (!$user->canEdit()) {
+ register_error(elgg_echo("profile:noaccess"));
+ forward();
+}
+
+elgg_set_context('profile_edit');
+
+$title = elgg_echo('profile:edit');
+
+$content = elgg_view_form('profile/edit', array(), array('entity' => $user));
+
+$params = array(
+ 'content' => $content,
+ 'title' => $title,
+);
+$body = elgg_view_layout('one_sidebar', $params);
+
+echo elgg_view_page($title, $body);