diff options
author | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
commit | e53d410129701ea1c9d19529afa493f11b5f5b70 (patch) | |
tree | d9963b24bf8932654b4a47e36602c75975e50dba /pages | |
parent | 377da25d2965c64941f83baae119fc970ec60982 (diff) | |
parent | 08a962c98e2923724f8013d6eaae89101243752a (diff) | |
download | elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2 |
Merge github.com:Elgg/Elgg
Conflicts:
engine/lib/input.php
Diffstat (limited to 'pages')
-rw-r--r-- | pages/account/login.php | 20 | ||||
-rw-r--r-- | pages/account/register.php | 2 | ||||
-rw-r--r-- | pages/avatar/view.php | 31 | ||||
-rw-r--r-- | pages/entities/index.php | 4 | ||||
-rw-r--r-- | pages/settings/account.php | 4 | ||||
-rw-r--r-- | pages/settings/statistics.php | 2 |
6 files changed, 46 insertions, 17 deletions
diff --git a/pages/account/login.php b/pages/account/login.php new file mode 100644 index 000000000..14f65cc3f --- /dev/null +++ b/pages/account/login.php @@ -0,0 +1,20 @@ +<?php +/** + * Assembles and outputs a login page. + * + * This page serves as a fallback for non-JS users who click on the login + * drop down link. + * + * If the user is logged in, this page will forward to the front page. + * + * @package Elgg.Core + * @subpackage Accounts + */ + +if (elgg_is_logged_in()) { + forward(''); +} + +$login_box = elgg_view('core/account/login_box'); +$content = elgg_view_layout('one_column', array('content' => $login_box)); +echo elgg_view_page(elgg_echo('login'), $content); diff --git a/pages/account/register.php b/pages/account/register.php index 5eb2b4001..cf18a635b 100644 --- a/pages/account/register.php +++ b/pages/account/register.php @@ -37,7 +37,7 @@ if (elgg_get_config('https_login')) { } $form_params = array( 'action' => $register_url, - 'class' => 'elgg-form-account float', + 'class' => 'elgg-form-account', ); $body_params = array( diff --git a/pages/avatar/view.php b/pages/avatar/view.php index eb2cd1010..bd6c95821 100644 --- a/pages/avatar/view.php +++ b/pages/avatar/view.php @@ -3,6 +3,7 @@ * View an avatar */ +// page owner library sets this based on URL $user = elgg_get_page_owner_entity(); // Get the size @@ -13,33 +14,41 @@ if (!in_array($size, array('master', 'large', 'medium', 'small', 'tiny', 'topbar // If user doesn't exist, return default icon if (!$user) { - $url = "_graphics/icons/user/default{$size}"; + $url = "_graphics/icons/default/{$size}.png"; $url = elgg_normalize_url($url); forward($url); } +$user_guid = $user->getGUID(); + // Try and get the icon $filehandler = new ElggFile(); -$filehandler->owner_guid = $user->getGUID(); -$filehandler->setFilename("profile/" . $user->getGUID() . $size . ".jpg"); +$filehandler->owner_guid = $user_guid; +$filehandler->setFilename("profile/{$user_guid}{$size}.jpg"); $success = false; -if ($filehandler->open("read")) { - if ($contents = $filehandler->read($filehandler->size())) { - $success = true; + +try { + if ($filehandler->open("read")) { + if ($contents = $filehandler->read($filehandler->size())) { + $success = true; + } } +} catch (InvalidParameterException $e) { + elgg_log("Unable to get avatar for user with GUID $user_guid", 'ERROR'); } + if (!$success) { - $url = "_graphics/icons/user/default{$size}"; + $url = "_graphics/icons/default/{$size}.png"; $url = elgg_normalize_url($url); forward($url); } -header("Content-type: image/jpeg"); -header('Expires: ' . date('r', time() + 864000)); -header("Pragma: public"); -header("Cache-Control: public"); +header("Content-type: image/jpeg", true); +header('Expires: ' . date('r', strtotime("+6 months")), true); +header("Pragma: public", true); +header("Cache-Control: public", true); header("Content-Length: " . strlen($contents)); echo $contents; diff --git a/pages/entities/index.php b/pages/entities/index.php index d3b935dc4..e73d65db4 100644 --- a/pages/entities/index.php +++ b/pages/entities/index.php @@ -25,9 +25,9 @@ if ($context) { // Get the entity, if possible if ($entity = get_entity($guid)) { if ($entity->container_guid) { - set_page_owner($entity->container_guid); + elgg_set_page_owner_guid($entity->container_guid); } else { - set_page_owner($entity->owner_guid); + elgg_set_page_owner_guid($entity->owner_guid); } // Set the body to be the full view of the entity, and the title to be its title diff --git a/pages/settings/account.php b/pages/settings/account.php index e6a5da97b..1bf71973b 100644 --- a/pages/settings/account.php +++ b/pages/settings/account.php @@ -11,12 +11,12 @@ gatekeeper(); // Make sure we don't open a security hole ... if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit())) { - set_page_owner(elgg_get_logged_in_user_guid()); + elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); } $title = elgg_echo('usersettings:user'); -$content .= elgg_view('core/settings/account'); +$content = elgg_view('core/settings/account'); $params = array( 'content' => $content, diff --git a/pages/settings/statistics.php b/pages/settings/statistics.php index b7394cbe8..9df71ec5e 100644 --- a/pages/settings/statistics.php +++ b/pages/settings/statistics.php @@ -11,7 +11,7 @@ gatekeeper(); // Make sure we don't open a security hole ... if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit())) { - set_page_owner(elgg_get_logged_in_user_guid()); + elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); } $title = elgg_echo("usersettings:statistics"); |