|
Revision 151, 1.0 kB
(checked in by cedenoj, 1 year ago)
|
fixes #2833 The profile module now uses PARAM_SAFEDIR as defined in lib/constants.php to allow usernames that include underscores. This should allow the dino users to view and create their profiles. The .htaccess file was also modified so that dino users get pretty urls as well.
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
require_once(dirname(dirname(__FILE__)) . '/includes.php'); |
|---|
| 7 |
require_once($CFG->dirroot . 'profile/profile.class.php'); |
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
$profile_name = optional_param('profile_name', '', PARAM_SAFEDIR); |
|---|
| 11 |
if (!empty($profile_name)) { |
|---|
| 12 |
$profile_id = user_info_username('ident', $profile_name); |
|---|
| 13 |
} |
|---|
| 14 |
if (empty($profile_id)) { |
|---|
| 15 |
$profile_id = optional_param('profile_id', -1, PARAM_INT); |
|---|
| 16 |
} |
|---|
| 17 |
|
|---|
| 18 |
$page_owner = $profile_id; |
|---|
| 19 |
|
|---|
| 20 |
define("context", "profile"); |
|---|
| 21 |
templates_page_setup(); |
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
$profile = new ElggProfile($profile_id); |
|---|
| 25 |
|
|---|
| 26 |
$title = user_name($profile_id); |
|---|
| 27 |
$body = $profile->view(); |
|---|
| 28 |
|
|---|
| 29 |
$body = templates_draw( array( |
|---|
| 30 |
'context' => 'contentholder', |
|---|
| 31 |
'title' => $title, |
|---|
| 32 |
'body' => $body |
|---|
| 33 |
)); |
|---|
| 34 |
|
|---|
| 35 |
echo templates_page_draw(array($title, $body)); |
|---|
| 36 |
|
|---|
| 37 |
?> |
|---|
| 38 |
|
|---|