...
 
### 0.12.0
* fix: show only in-world users in "new users" dashboard widget
* fix: new users dashboard and shortcode only shown to users with list_users capability
* added: avatar creation from standard wp-admin/profile.php page
### 0.11.0
* added shortcode and dashboard widget to show last users
......
......@@ -16,11 +16,13 @@ function w4os_dashboard_add_widgets() {
"OpenSimulator: " . __( 'Grid status', 'w4os' ),
'w4os_dashboard_widget_gridstatus_handler'
);
wp_add_dashboard_widget(
'w4os_dashboard_widget_newusers',
"OpenSimulator: " . __( 'Recent users', 'w4os' ),
'w4os_dashboard_widget_newusers_handler'
);
if (current_user_can( 'list_users' ) ) {
wp_add_dashboard_widget(
'w4os_dashboard_widget_newusers',
"OpenSimulator: " . __( 'Recent users', 'w4os' ),
'w4os_dashboard_widget_newusers_handler'
);
}
}
function w4os_dashboard_widget_gridstatus_handler() {
......
......@@ -127,3 +127,15 @@ img.model-picture {
.recent-users .avatar-name {
font-weight: bold;
}
.profile-php .avatar_profile,
.profile-php .avatar_profile p {
font-size: 14px;
line-height: 1.3;
}
.profile-php .avatar_profile label {
display: inline-block;
width: 200px;
font-weight: bold;
margin-right: 20px;
}
......@@ -33,26 +33,11 @@ function w4os_profile_fields( $user ) {
global $w4osdb;
$uuid = w4os_profile_sync($user);
echo " <h3>" . __("OpenSimulator", "w4os") ."</h3>";
if(!$uuid) {
echo "<p>" . __("No avatar", 'w4os') . "</p>";
} else {
?>
<table class="form-table">
<tr>
<th><label for="w4os_uuid"><?php _e("Avatar UUID", "w4os"); ?></label></th>
<td>
<?php echo esc_attr( get_the_author_meta( 'w4os_uuid', $user->ID ) ); ?>
</td>
</tr>
<tr>
<th><label for="w4os_firstname"><?php _e("Avatar name", "w4os"); ?></label></th>
<td>
<?php echo esc_attr( get_the_author_meta( 'w4os_firstname', $user->ID ) ) . " " . esc_attr( get_the_author_meta( 'w4os_lastname', $user->ID ) ); ?>
</td>
</tr>
</table>
<?php }
echo "<div class=avatar_profile>";
// if(!$uuid) {
echo w4os_profile_wc_edit($user);
// echo "<p>" . __("No avatar", 'w4os') . "</p>";
echo "</div>";
}
/**
......
......@@ -128,12 +128,14 @@ function w4os_shortcodes_init()
add_action('init', 'w4os_shortcodes_init');
function w4os_newusers() {
if(! W4OS_DB_CONNECTED) {
return;
}
if (! W4OS_DB_CONNECTED) return;
if (! current_user_can( 'list_users' ) ) return;
global $wpdb;
$recentusers = '<ul class="recent-users">';
$usernames = $wpdb->get_results("SELECT user_nicename, user_url, user_email FROM $wpdb->users ORDER BY ID DESC LIMIT 5");
$usernames = $wpdb->get_results("SELECT user_nicename, user_url, user_email
FROM $wpdb->users as u, $wpdb->usermeta as m
WHERE u.ID = m.user_id AND m.meta_key = 'w4os_uuid' AND m.meta_value != ''
ORDER BY ID DESC LIMIT 5");
foreach ($usernames as $username) {
$user = $wpdb->get_row($wpdb->prepare("select * from ".$wpdb->prefix."users where user_email = %s", $username->user_email));
$uuid = get_the_author_meta( 'w4os_uuid', $user->ID );
......
......@@ -24,6 +24,7 @@ section for upcoming functionalties.
- **Avatar creation**:
- `[w4os_profile]` shortcode can be inserted in any page
- Avatar tab in account dashboard on WooCommerce websites
- Section in standard wp profile page
- Choose avatar look from default models
- Avatar and website passwords are synchronized
- **Reserved names**: avatar whose first name or last name is "Default",
......@@ -40,11 +41,12 @@ section for upcoming functionalties.
- Auth with avatar credential (as fallback to wp auth).
Create new WordPress user if auth by avatar
- option to use WordPress name as avatar name (in this case, lock WordPress
- Login page (with grid FirstName, LastName and password).
Optional redirect of standard login page
- Option to use WordPress name as avatar name (in this case, lock WordPress
name changes once an avatar is set)
- Create avatar from standard wp-admin/profile.php page
- Use avatar profile pic
- Check if avatar password is properly updated after a password reset request
- integrate web asset server
- sidebar grid info and grid status widgets
#### Middle term
......@@ -53,8 +55,10 @@ section for upcoming functionalties.
- Admin Start / Stop regions
- Admin Create region
- Admin Use sim/grid configuration file to fetch settings if on the same host
- get grid info from http://login.uri:8002/get_grid_info
- Helpers (assets, search, currency, map...)
- Use cache for grid info
- Integrate web asset server
#### Long term
......
......@@ -6,7 +6,7 @@
*
* Plugin Name: W4OS OpenSimulator Interface
* Description: WordPress interface for OpenSimulator.
* Version: 0.11.1
* Version: 0.12.0
* Author: Speculoos World
* Author URI: https://speculoos.world
* Plugin URI: https://git.magiiic.com/opensimulator/w4os
......