[XenConcept] Username Change

[XenConcept] Username Change [Paid] 2.1.9

No permission to buy ($15.00)
Hello,

I have one problem with your extension, the permission "daysBetweenEachChange" doesn't works correctly because i have configurated this permission for user group "member" at 35 days and for user group "premium" at 5 days but the premium members can not change their username every 5 days.

Do you have a solution for fix this problem ?

Thanks for future reply :)
Kévin
 
Hello,

I have one problem with your extension, the permission "daysBetweenEachChange" doesn't works correctly because i have configurated this permission for user group "member" at 35 days and for user group "premium" at 5 days but the premium members can not change their username every 5 days.

Do you have a solution for fix this problem ?

Thanks for future reply :)
Kévin

Hello,

The problem is that the user is part of two groups.

Regards
 
Hello,
I do not understand your question

Regards
When adding a new trophy you can specify usernames in the "Award this trophy if..." panel.
arbitrary_trophy_granting.webp
However, if the user changes their name it would be different from the text typed in this field. Wouldn't that cause them to lose the trophy?
 
Hello,

The problem is that the user is part of two groups.

Regards
Hello,

Being part of two different user groups or more is not a problem, this is how the XenForo System works.
The problem is that the Permission System always gets the highest value for an Integer permission. In this type of addon, a lower value means a "better permission".

A simple trick should invert this on your addon :)
 
Hello XenConcept,

The previous trick I talked about above is not quite simple as I thought.
I can suggest you this code, not very beautiful, but it works :) It's up to you to adapt it better if you wish !

PHP:
$visitor = \XF::visitor();
$userGroups = $visitor['secondary_group_ids'];
$userGroups[] = $visitor['user_group_id'];

$userGroupsComma = implode(',', $userGroups);
$combinationsId = $this->app->db->fetchAll("
    SELECT DISTINCT(permission_combination_id)
    FROM xf_permission_combination_user_group
    WHERE user_group_id IN (" . $userGroupsComma . ")
");

$cache = [];
foreach($combinationsId AS $combinationId)
{
    $cacheValue = $this->app->db->fetchOne('
        SELECT cache_value
        FROM xf_permission_combination
        WHERE permission_combination_id = ?
    ', $combinationId['permission_combination_id']);

    $cache[$combinationId['permission_combination_id']] = @unserialize($cacheValue);
}

$lower = PHP_INT_MAX;
foreach($cache AS $_cache)
{
    if ($_cache['xc_change_username']['daysBetweenEachChange'] < $lower)
     {
        $lower = $_cache['xc_change_username']['daysBetweenEachChange'];
     }
}

return $lower;

This returns the lower value for the according permission for the visitor :)
 
Hello XenConcept,

The previous trick I talked about above is not quite simple as I thought.
I can suggest you this code, not very beautiful, but it works :) It's up to you to adapt it better if you wish !

PHP:
$visitor = \XF::visitor();
$userGroups = $visitor['secondary_group_ids'];
$userGroups[] = $visitor['user_group_id'];

$userGroupsComma = implode(',', $userGroups);
$combinationsId = $this->app->db->fetchAll("
    SELECT DISTINCT(permission_combination_id)
    FROM xf_permission_combination_user_group
    WHERE user_group_id IN (" . $userGroupsComma . ")
");

$cache = [];
foreach($combinationsId AS $combinationId)
{
    $cacheValue = $this->app->db->fetchOne('
        SELECT cache_value
        FROM xf_permission_combination
        WHERE permission_combination_id = ?
    ', $combinationId['permission_combination_id']);

    $cache[$combinationId['permission_combination_id']] = @unserialize($cacheValue);
}

$lower = PHP_INT_MAX;
foreach($cache AS $_cache)
{
    if ($_cache['xc_change_username']['daysBetweenEachChange'] < $lower)
     {
        $lower = $_cache['xc_change_username']['daysBetweenEachChange'];
     }
}

return $lower;

This returns the lower value for the according permission for the visitor :)

Hello,

Okay, I'll see what I can do
 
XenConcept updated [XenConcept] Username Change with a new update entry:

New release 2.1.1

Error when the user does not have the required posts amount required :

View attachment 173470

Error when...

Read the rest of this update entry...
 
Hi, I'm mainly looking for a username log (a log for each user that displays their username history). Does this add-on do that?
 
Top Bottom