Ignore:
Timestamp:
Sep 11, 2010, 7:07:48 PM (14 years ago)
Author:
Eric
Message:

Bug 1847 fixed : Admins and webmasters accounts was not excluded from regitration validation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Register_FluxBB/trunk/main.inc.php

    r6826 r6880  
    22/*
    33Plugin Name: Register FluxBB
    4 Version: 2.3.1
     4Version: 2.3.2
    55Description: Link user registration from Piwigo to FluxBB forum (registration, password changing, deletion) - Original Nicco's NBC_LinkUser2PunBB plugin upgraded to Piwigo / Liez l'inscription des utilisateurs de Piwigo avec votre forum FluxBB - Portage du plugin NBC_LinkUser2PunBB de Nicco vers Piwigo
    66Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=252
     
    57572.3.0     - 28/08/10  - Bug 1434 fixed : Bridge between Register_FluxBB and UserAdvManager for new users validation
    5858
    59 2.3.1     - 31/08/10  - Bug 1825 fixed : Password corruption after Piwigo's profile page visit
     592.3.1     - 31/08/10  - Bug 1825 fixed : Password corruption after Piwigo's profile page visit
     60
     612.3.2     - 11/09/10  - Bug 1847 fixed : Admins and webmasters was not excluded from registration validation
    6062--------------------------------------------------------------------------------
    6163*/
     
    150152 
    151153  // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
    152   if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true' and !is_admin() and !is_webmaster())
     154  $query ='
     155SELECT user_id, status
     156FROM '.USER_INFOS_TABLE.'
     157WHERE user_id = '.$user['id'].'
     158;';
     159  $data = pwg_db_fetch_assoc(pwg_query($query));
     160 
     161  if ($data['status'] <> "admin" and $data['status'] <> "webmaster")
    153162  {
    154     $conf_UAM = unserialize($conf['UserAdvManager']);
     163    if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true')
     164    {
     165      $conf_UAM = unserialize($conf['UserAdvManager']);
    155166   
    156     // Getting unvalidated users group else Piwigo's default group
    157     if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
    158     {
    159       $Waitingroup = $conf_UAM[2];
    160     }
    161     else
    162     {
    163       $query = '
     167      // Getting unvalidated users group else Piwigo's default group
     168      if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
     169      {
     170        $Waitingroup = $conf_UAM[2];
     171      }
     172      else
     173      {
     174        $query = '
    164175SELECT id
    165176FROM '.GROUPS_TABLE.'
     
    167178LIMIT 1
    168179;';
    169       $data = pwg_db_fetch_assoc(pwg_query($query));
    170       $Waitingroup = $data['id'];
    171     }
     180        $data = pwg_db_fetch_assoc(pwg_query($query));
     181        $Waitingroup = $data['id'];
     182      }
    172183   
    173     // check if logged in user is in a Piwigo's validated or unvalidated users group
    174     $query = '
     184      // check if logged in user is in a Piwigo's validated or unvalidated users group
     185      $query = '
    175186SELECT *
    176187FROM '.USER_GROUP_TABLE.'
     
    178189AND group_id = '.$Waitingroup.'
    179190;';
    180     $count = pwg_db_num_rows(pwg_query($query));
    181 
    182     // Check if logged in user is in a FluxBB's unvalidated group
    183     $query = "
     191      $count = pwg_db_num_rows(pwg_query($query));
     192
     193      // Check if logged in user is in a FluxBB's unvalidated group
     194      $query = "
    184195SELECT group_id
    185196FROM ".FluxBB_USERS_TABLE."
     
    187198;";
    188199
    189     $data = pwg_db_fetch_assoc(pwg_query($query));
    190 
    191     // Logged in user switch to the default FluxBB's group if he'is validated
    192     if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7])
    193     {
    194       $query = "
     200      $data = pwg_db_fetch_assoc(pwg_query($query));
     201
     202      // Logged in user switch to the default FluxBB's group if he'is validated
     203      if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7])
     204      {
     205        $query = "
    195206SELECT conf_value
    196207FROM ".FluxBB_CONFIG_TABLE."
     
    198209;";
    199210
    200       $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
     211        $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
    201212     
    202       $query = "
     213        $query = "
    203214UPDATE ".FluxBB_USERS_TABLE."
    204215SET group_id = ".$o_default_user_group['conf_value']."
    205216WHERE id = ".FluxBB_Searchuser($user['id'])."
    206217;";
    207       pwg_query($query);
     218        pwg_query($query);
     219      }
    208220    }
    209221  }
Note: See TracChangeset for help on using the changeset viewer.