diff options
-rw-r--r-- | engine/lib/output.php | 7 | ||||
-rw-r--r-- | engine/lib/user_settings.php | 7 | ||||
-rw-r--r-- | engine/lib/users.php | 9 | ||||
-rw-r--r-- | js/lib/ui.userpicker.js | 2 | ||||
-rw-r--r-- | mod/embed/manifest.xml | 5 | ||||
-rw-r--r-- | mod/embed/start.php | 26 | ||||
-rw-r--r-- | mod/embed/views/default/embed/layout.php | 7 | ||||
-rw-r--r-- | mod/embed/views/default/js/embed/embed.php | 32 | ||||
-rw-r--r-- | mod/file/views/default/embed/file_upload/content.php | 3 | ||||
-rw-r--r-- | mod/uservalidationbyemail/lib/functions.php | 8 | ||||
-rw-r--r-- | mod/uservalidationbyemail/start.php | 5 | ||||
-rw-r--r-- | views/default/input/userpicker.php | 1 |
12 files changed, 90 insertions, 22 deletions
diff --git a/engine/lib/output.php b/engine/lib/output.php index 989eca60e..6554481f5 100644 --- a/engine/lib/output.php +++ b/engine/lib/output.php @@ -234,7 +234,7 @@ function elgg_clean_vars(array $vars = array()) { * * @example * elgg_normalize_url(''); // 'http://my.site.com/' - * elgg_normalize_url('dashboard'); // 'http://my.site.com/dashboard' + * elgg_normalize_url('dashboard'); // 'http://my.site.com/dashboard' * elgg_normalize_url('http://google.com/'); // no change * elgg_normalize_url('//google.com/'); // no change * @@ -257,6 +257,11 @@ function elgg_normalize_url($url) { $validated = filter_var($url, FILTER_VALIDATE_URL); } + // work around for handling absoluate IRIs (RFC 3987) - see #4190 + if (!$validated && (strpos($url, 'http:') === 0) || (strpos($url, 'https:') === 0)) { + $validated = true; + } + if ($validated) { // all normal URLs including mailto: return $url; diff --git a/engine/lib/user_settings.php b/engine/lib/user_settings.php index c71670357..af30d8f0d 100644 --- a/engine/lib/user_settings.php +++ b/engine/lib/user_settings.php @@ -346,6 +346,13 @@ function usersettings_init() { elgg_register_plugin_hook_handler('usersettings:save', 'user', 'users_settings_save'); elgg_register_action("usersettings/save"); + + // extend the account settings form + elgg_extend_view('forms/account/settings', 'core/settings/account/name', 100); + elgg_extend_view('forms/account/settings', 'core/settings/account/password', 100); + elgg_extend_view('forms/account/settings', 'core/settings/account/email', 100); + elgg_extend_view('forms/account/settings', 'core/settings/account/language', 100); + elgg_extend_view('forms/account/settings', 'core/settings/account/default_access', 100); } elgg_register_event_handler('init', 'system', 'usersettings_init'); diff --git a/engine/lib/users.php b/engine/lib/users.php index 3a86c1faa..1b3cca799 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1021,7 +1021,7 @@ function elgg_get_user_validation_status($user_guid) { return; } - if ($md->value) { + if ($md[0]->value) { return true; } @@ -1562,13 +1562,6 @@ function users_init() { elgg_register_widget_type('friends', elgg_echo('friends'), elgg_echo('friends:widget:description')); - // extend the account settings form - elgg_extend_view('forms/account/settings', 'core/settings/account/name', 100); - elgg_extend_view('forms/account/settings', 'core/settings/account/password', 100); - elgg_extend_view('forms/account/settings', 'core/settings/account/email', 100); - elgg_extend_view('forms/account/settings', 'core/settings/account/language', 100); - elgg_extend_view('forms/account/settings', 'core/settings/account/default_access', 100); - // Register the user type elgg_register_entity_type('user', ''); diff --git a/js/lib/ui.userpicker.js b/js/lib/ui.userpicker.js index 8287ba91c..7298da114 100644 --- a/js/lib/ui.userpicker.js +++ b/js/lib/ui.userpicker.js @@ -93,7 +93,7 @@ elgg.userpicker.viewUser = function(info) { html += "<div class='elgg-image'>" + info.icon + "</div>"; html += "<div class='elgg-image-alt'>" + deleteLink + "</div>"; html += "<div class='elgg-body'>" + info.name + "</div>"; - html += "</div"; + html += "</div>"; return html; }; diff --git a/mod/embed/manifest.xml b/mod/embed/manifest.xml index 7ffbc23a4..46ab2df9e 100644 --- a/mod/embed/manifest.xml +++ b/mod/embed/manifest.xml @@ -13,9 +13,10 @@ <type>elgg_release</type> <version>1.8</version> </requires> - <requires> + <suggests> <type>plugin</type> <name>file</name> - </requires> + <version>1.8.1</version> + </suggests> <activate_on_install>true</activate_on_install> </plugin_manifest> diff --git a/mod/embed/start.php b/mod/embed/start.php index 7c070fa75..a3ccab66b 100644 --- a/mod/embed/start.php +++ b/mod/embed/start.php @@ -37,10 +37,15 @@ function embed_longtext_menu($hook, $type, $items, $vars) { if (elgg_get_context() == 'embed') { return $items; } + + $url = 'embed'; + if (elgg_get_page_owner_guid()) { + $url = 'embed?container_guid=' . elgg_get_page_owner_guid(); + } $items[] = ElggMenuItem::factory(array( 'name' => 'embed', - 'href' => "embed", + 'href' => $url, 'text' => elgg_echo('embed:media'), 'rel' => 'lightbox', 'link_class' => "elgg-longtext-control elgg-lightbox embed-control embed-control-{$vars['id']}", @@ -65,7 +70,9 @@ function embed_longtext_menu($hook, $type, $items, $vars) { */ function embed_select_tab($hook, $type, $items, $vars) { - $tab_name = array_pop(explode('/', full_url())); + // can this ba called from page handler instead? + $page = get_input('page'); + $tab_name = array_pop(explode('/', $page)); foreach ($items as $item) { if ($item->getName() == $tab_name) { $item->setSelected(); @@ -86,6 +93,11 @@ function embed_select_tab($hook, $type, $items, $vars) { */ function embed_page_handler($page) { + $container_guid = (int)get_input('container_guid'); + if ($container_guid) { + elgg_set_page_owner_guid($container_guid); + } + echo elgg_view('embed/layout'); // exit because this is in a modal display. @@ -121,15 +133,17 @@ function embed_list_items($entities, $vars = array()) { */ function embed_get_list_options($options = array()) { + $container_guids = array(elgg_get_logged_in_user_guid()); if (elgg_get_page_owner_guid()) { - $container_guid = elgg_get_page_owner_guid(); - } else { - $container_guid = elgg_get_logged_in_user_guid(); + $page_owner_guid = elgg_get_page_owner_guid(); + if ($page_owner_guid != elgg_get_logged_in_user_guid()) { + $container_guids[] = $page_owner_guid; + } } $defaults = array( 'limit' => 6, - 'container_guid' => $container_guid, + 'container_guids' => $container_guids, 'item_class' => 'embed-item', ); diff --git a/mod/embed/views/default/embed/layout.php b/mod/embed/views/default/embed/layout.php index c1e43f13c..e906160b1 100644 --- a/mod/embed/views/default/embed/layout.php +++ b/mod/embed/views/default/embed/layout.php @@ -21,10 +21,17 @@ if ($selected->getData('view')) { } } + +$container_info = elgg_view('input/hidden', array( + 'name' => 'embed_container_guid', + 'value' => elgg_get_page_owner_guid(), +)); + echo <<<HTML <div class="embed-wrapper"> $title $menu $tab + $container_info </div> HTML; diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php index 8a8f0290c..5fd534a09 100644 --- a/mod/embed/views/default/js/embed/embed.php +++ b/mod/embed/views/default/js/embed/embed.php @@ -35,7 +35,12 @@ elgg.embed.insert = function(event) { // generalize this based on a css class attached to what should be inserted var content = ' ' + $(this).find(".embed-insert").parent().html() + ' '; - + + // this is a temporary work-around for #3971 + if (content.indexOf('thumbnail.php') != -1) { + content = content.replace('size=small', 'size=medium'); + } + textArea.val(textArea.val() + content); textArea.focus(); @@ -75,9 +80,13 @@ elgg.embed.submit = function(event) { if (response.status >= 0) { var forward = $('input[name=embed_forward]').val(); var url = elgg.normalize_url('embed/tab/' + forward); + url = elgg.embed.addContainerGUID(url); $('.embed-wrapper').parent().load(url); } } + }, + error: function(xhr, status) { + // nothing for now } }); @@ -93,8 +102,27 @@ elgg.embed.submit = function(event) { * @return void */ elgg.embed.forward = function(event) { - $('.embed-wrapper').parent().load($(this).attr('href')); + // make sure container guid is passed + var url = $(this).attr('href'); + url = elgg.embed.addContainerGUID(url); + + $('.embed-wrapper').parent().load(url); event.preventDefault(); }; +/** + * Adds the container guid to a URL + * + * @param {string} url + * @return string + */ +elgg.embed.addContainerGUID = function(url) { + if (url.indexOf('container_guid=') == -1) { + var guid = $('input[name=embed_container_guid]').val(); + return url + '?container_guid=' + guid; + } else { + return url; + } +}; + elgg.register_hook_handler('init', 'system', elgg.embed.init); diff --git a/mod/file/views/default/embed/file_upload/content.php b/mod/file/views/default/embed/file_upload/content.php index 4d3db0d97..8b630c828 100644 --- a/mod/file/views/default/embed/file_upload/content.php +++ b/mod/file/views/default/embed/file_upload/content.php @@ -7,7 +7,8 @@ $form_vars = array( 'enctype' => 'multipart/form-data', 'class' => 'elgg-form-embed', ); -echo elgg_view_form('file/upload', $form_vars); +$body_vars = array('container_guid' => elgg_get_page_owner_guid()); +echo elgg_view_form('file/upload', $form_vars, $body_vars); // the tab we want to be forwarded to after upload is complete echo elgg_view('input/hidden', array( diff --git a/mod/uservalidationbyemail/lib/functions.php b/mod/uservalidationbyemail/lib/functions.php index eaca374f4..f3091f94d 100644 --- a/mod/uservalidationbyemail/lib/functions.php +++ b/mod/uservalidationbyemail/lib/functions.php @@ -87,7 +87,13 @@ function uservalidationbyemail_get_unvalidated_users_sql_where() { global $CONFIG; $validated_id = get_metastring_id('validated'); - $one_id = get_metastring_id(1); + if ($validated_id === false) { + $validated_id = add_metastring('validated'); + } + $one_id = get_metastring_id('1'); + if ($one_id === false) { + $one_id = add_metastring('1'); + } // thanks to daveb@freenode for the SQL tips! $wheres = array(); diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php index 576e12247..ea59a2e7b 100644 --- a/mod/uservalidationbyemail/start.php +++ b/mod/uservalidationbyemail/start.php @@ -75,6 +75,11 @@ function uservalidationbyemail_disable_new_user($hook, $type, $value, $params) { return $value; } + // has the user already been validated? + if (elgg_get_user_validation_status($user->guid) == true) { + return $value; + } + // disable user to prevent showing up on the site // set context so our canEdit() override works elgg_push_context('uservalidationbyemail_new_user'); diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php index 246c462da..91a397e37 100644 --- a/views/default/input/userpicker.php +++ b/views/default/input/userpicker.php @@ -20,6 +20,7 @@ */ elgg_load_js('elgg.userpicker'); +elgg_load_js('jquery.ui.autocomplete.html'); function user_picker_add_user($user_id) { $user = get_entity($user_id); |