Changeset 17846 for extensions/UserAdvManager/trunk
- Timestamp:
- Sep 10, 2012, 10:00:14 PM (12 years ago)
- Location:
- extensions/UserAdvManager/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserAdvManager/trunk/changelog.txt.php
r17807 r17846 300 300 Bug 2740 fixed - Loggin rejection on unvalidated user connection does not work 301 301 302 -- 2.30.9 : Bug 2744 fixed - User connexion rejection does not work if no group/status/privacy is set 303 302 304 ************************************************************** 303 305 ***** Plugin history (branch 2.40 - Piwigo 2.4 compliant)***** … … 337 339 Update es_ES, thanks to : jpr928 338 340 Update it_IT, thanks to : Ericnet and virgigiole 341 342 -- 2.40.6 : Bug 2744 fixed - User connexion rejection does not work if no group/status/privacy is set 339 343 */ 340 344 ?> -
extensions/UserAdvManager/trunk/include/functions.inc.php
r17804 r17846 36 36 { 37 37 global $conf, $page; 38 39 $conf_UAM = unserialize($conf['UserAdvManager']); 38 40 39 41 // Check mandatory email address for email exclusion 40 $conf_UAM = unserialize($conf['UserAdvManager']);41 42 if (!$conf['obligatory_user_mail_address'] and $conf_UAM[10] = 'true') 42 43 { … … 104 105 105 106 // Perform user logout after registration if not validated 106 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()) 107 108 { 108 109 invalidate_user_cache(); … … 512 513 } 513 514 514 // GhostTracker auto group, status or privacy level downgrade with or without information email sendingand autodeletion if user already reminded515 // --------------------------------------------------------------------------------------- -------------------------------------------------------515 // Auto group, status or privacy level downgrade and autodeletion if user already reminded 516 // --------------------------------------------------------------------------------------- 516 517 if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true') and ((isset($conf_UAM[25]) and $conf_UAM[25] <> -1) or (isset($conf_UAM[26]) and $conf_UAM[26] <> -1) or (isset($conf_UAM[37]) and $conf_UAM[37] <> -1))) 517 518 { … … 2128 2129 ;"; 2129 2130 pwg_query($query); 2130 2131 if ($conf_UAM[2] <> -1) 2132 { 2133 $query = " 2131 } 2132 2133 if ($conf_UAM[2] <> -1) // Delete user from waiting group 2134 { 2135 $query = " 2134 2136 DELETE FROM ".USER_GROUP_TABLE." 2135 2137 WHERE user_id = '".$id."' 2136 2138 AND group_id = '".$conf_UAM[2]."' 2137 2139 ;"; 2138 2139 2140 2141 if ($conf_UAM[3] <> -1) // Change user'sgroup2142 2143 2140 pwg_query($query); 2141 } 2142 2143 if ($conf_UAM[3] <> -1) // Set user's valid group 2144 { 2145 $query = " 2144 2146 DELETE FROM ".USER_GROUP_TABLE." 2145 2147 WHERE user_id = '".$id."' 2146 2148 AND group_id = '".$conf_UAM[3]."' 2147 2149 ;"; 2148 2150 pwg_query($query); 2149 2151 2150 2152 $query = " 2151 2153 INSERT INTO ".USER_GROUP_TABLE." 2152 2154 (user_id, group_id) … … 2154 2156 ('".$id."', '".$conf_UAM[3]."') 2155 2157 ;"; 2156 2157 2158 2159 if ($conf_UAM[4] <> -1) // Change user'sstatus2160 2161 2158 pwg_query($query); 2159 } 2160 2161 if ($conf_UAM[4] <> -1) // Set user's valid status 2162 { 2163 $query = " 2162 2164 UPDATE ".USER_INFOS_TABLE." 2163 2165 SET status = '".$conf_UAM[4]."' 2164 2166 WHERE user_id = '".$id."' 2165 2167 ;"; 2166 2167 2168 2169 if ($conf_UAM[36] <> -1) // Change user'sprivacy level2170 2171 2168 pwg_query($query); 2169 } 2170 2171 if ($conf_UAM[36] <> -1) // Set user's valid privacy level 2172 { 2173 $query = " 2172 2174 UPDATE ".USER_INFOS_TABLE." 2173 2175 SET level = '".$conf_UAM[36]."' 2174 2176 WHERE user_id = '".$id."' 2175 2177 ;"; 2176 pwg_query($query); 2177 } 2178 } 2179 elseif (isset($conf_UAM[1]) and $conf_UAM[1] == 'local') 2180 { 2181 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 2182 2183 if ($conf_UAM[2] <> -1) // Delete user's from waiting group 2184 { 2185 $query = " 2186 DELETE FROM ".USER_GROUP_TABLE." 2187 WHERE user_id = '".$id."' 2188 AND group_id = '".$conf_UAM[2]."' 2189 ;"; 2190 pwg_query($query); 2191 } 2192 2193 if ($conf_UAM[3] <> -1) // Change user's group 2194 { 2195 $query = " 2196 DELETE FROM ".USER_GROUP_TABLE." 2197 WHERE user_id = '".$id."' 2198 AND group_id = '".$conf_UAM[3]."' 2199 ;"; 2200 pwg_query($query); 2201 2202 $query = " 2203 INSERT INTO ".USER_GROUP_TABLE." 2204 (user_id, group_id) 2205 VALUES 2206 ('".$id."', '".$conf_UAM[3]."') 2207 ;"; 2208 pwg_query($query); 2209 } 2210 2211 if ($conf_UAM[4] <> -1) // Change user's status 2212 { 2213 $query = " 2214 UPDATE ".USER_INFOS_TABLE." 2215 SET status = '".$conf_UAM[4]."' 2216 WHERE user_id = '".$id."' 2217 ;"; 2218 pwg_query($query); 2219 } 2220 2221 if ($conf_UAM[36] <> -1) // Change user's privacy level 2222 { 2223 $query = " 2224 UPDATE ".USER_INFOS_TABLE." 2225 SET level = '".$conf_UAM[36]."' 2226 WHERE user_id = '".$id."' 2227 ;"; 2228 pwg_query($query); 2229 } 2178 pwg_query($query); 2230 2179 } 2231 2180 } … … 2803 2752 $conf_UAM = unserialize($conf['UserAdvManager']); 2804 2753 2754 // Check for user groups 2805 2755 $query = ' 2806 2756 SELECT group_id … … 2810 2760 ;'; 2811 2761 2812 $count = pwg_db_num_rows(pwg_query($query)); 2813 2762 $count1 = pwg_db_num_rows(pwg_query($query)); 2763 2764 // Check for user status 2765 $query = ' 2766 SELECT group_id 2767 FROM '.USER_INFOS_TABLE.' 2768 WHERE user_id = '.$user_id.' 2769 AND status = '.$conf_UAM[7].' 2770 ;'; 2771 2772 $count2 = pwg_db_num_rows(pwg_query($query)); 2773 2774 // Check for user privacy level 2775 $query = ' 2776 SELECT group_id 2777 FROM '.USER_INFOS_TABLE.' 2778 WHERE user_id = '.$user_id.' 2779 AND level = '.$conf_UAM[35].' 2780 ;'; 2781 2782 $count3 = pwg_db_num_rows(pwg_query($query)); 2783 2784 $count = $count1 + $count2 + $count3; // Summary of counts 2785 2814 2786 if ($count == 0) 2815 2787 { 2816 return true; // User is not in a "Waiting" group2788 return true; // User has validated his registration 2817 2789 } 2818 2790 else 2819 2791 { 2820 return false; // User is still in a "Waiting" group2792 return false; // User has not validated his registration 2821 2793 } 2822 2794 }
Note: See TracChangeset
for help on using the changeset viewer.