Changeset 17891


Ignore:
Timestamp:
Sep 13, 2012, 6:49:31 PM (8 years ago)
Author:
Eric
Message:

New field in #_users table is filled with exclusion of Guest user ans AC users but includes admins and webmaster users.

Excluding admins and webmaster from connection rejection. So they can always connect the gallery ;-)

Location:
extensions/UserAdvManager/trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserAdvManager/trunk/include/functions.inc.php

    r17890 r17891  
    105105
    106106  // Perform user logout after registration if not validated
    107   if ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and !UAM_UsrReg_Verif($user['id']))
     107  if ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and !UAM_UsrReg_Verif($user['id']) and !is_admin() and is_webmaster())
    108108  {
    109109    invalidate_user_cache();
  • extensions/UserAdvManager/trunk/include/upgradedb.inc.php

    r17890 r17891  
    652652  // Fill UAM_validated column with correct information for registered and validated  users
    653653  // --------------------------------------------------------------------------------------
    654   $query = '
    655 SELECT DISTINCT u.id AS id
     654               
     655                // It goes for everybody registered in the gallery except for Guest and AC users (16 and 18)
     656  $query = '
     657SELECT DISTINCT u.id AS id, u.username AS username
    656658FROM '.USERS_TABLE.' AS u
    657   INNER JOIN '.USER_INFOS_TABLE.' AS ui
    658     ON u.id = ui.user_id
    659   LEFT JOIN '.USER_GROUP_TABLE.' AS ug
    660     ON u.id = ug.user_id
    661 WHERE u.id <> 2';
    662 
    663         if ($conf_UAM[3] <> '-1' and $conf_UAM[4] == '-1')
    664   {
    665     $query.= '
    666   AND ug.group_id = '.$conf_UAM[3];
    667   }
    668   if ($conf_UAM[3] == '-1' and $conf_UAM[4] <> '-1')
    669   {
    670     $query.= '
    671   AND ui.status = \''.$conf_UAM[4]."'";
    672   }
    673   if ($conf_UAM[3] <> '-1' and $conf_UAM[4] <> '-1')
    674   {
    675     $query.= '
    676   AND ug.group_id = '.$conf_UAM[3];
    677   }
    678   $query.= ';';
    679 
    680         $result = pwg_query($query);
    681 
    682   while($row = mysql_fetch_array($result))
    683   {
    684     $query = '
     659                INNER JOIN '.USER_INFOS_TABLE.' AS ui
     660                                ON u.id = ui.user_id
     661                LEFT JOIN '.USER_GROUP_TABLE.' AS ug
     662                                ON u.id = ug.user_id
     663WHERE u.id != 2
     664                AND u.username != \'16\'
     665                AND u.username != \'18\'';
     666
     667                if ($conf_UAM[3] <> '-1' and $conf_UAM[4] == '-1')
     668                {
     669                                $query.= '
     670AND ug.group_id = '.$conf_UAM[3];
     671                }
     672                if ($conf_UAM[3] == '-1' and $conf_UAM[4] <> '-1')
     673                {
     674                                $query.= '
     675AND ui.status = \''.$conf_UAM[4]."'";
     676                }
     677                if ($conf_UAM[3] <> '-1' and $conf_UAM[4] <> '-1')
     678                {
     679                                $query.= '
     680AND ug.group_id = '.$conf_UAM[3];
     681                }
     682                $query.= ';';
     683
     684                $result = pwg_query($query);
     685
     686                while($row = mysql_fetch_array($result))
     687                {
     688                                $query = '
    685689UPDATE '.USERS_TABLE.'
    686690SET UAM_validated=true
    687 WHERE id = "'.$row['id'].'"
    688 ;';
    689     pwg_query($query);
    690   }
     691WHERE id = '.$row['id'].'
     692;';
     693                                pwg_query($query);
     694                }
     695
     696                // It goes to Webmaster too
     697                $query = '
     698UPDATE '.USERS_TABLE.'
     699SET UAM_validated=true
     700WHERE id = 1
     701;';
     702                pwg_query($query);
    691703}
    692704?>
Note: See TracChangeset for help on using the changeset viewer.