Changeset 3921 for extensions/NBC_UserAdvManager/branches
- Timestamp:
- Sep 27, 2009, 6:24:29 PM (15 years ago)
- Location:
- extensions/NBC_UserAdvManager/branches/2.11
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/branches/2.11/admin/UserAdvManager_admin.php
r3882 r3921 384 384 $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array(); 385 385 386 if (isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2]=='true' and isset($conf_nbc_UserAdvManager[3]) and $conf_nbc_UserAdvManager[3] <> '-1'and isset($conf_nbc_UserAdvManager_ConfirmMail[0]) and $conf_nbc_UserAdvManager_ConfirmMail[0]=='true')386 if (isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2]=='true' and ((isset($conf_nbc_UserAdvManager[3]) and $conf_nbc_UserAdvManager[3] <> '-1') or (isset($conf_nbc_UserAdvManager[9]) and $conf_nbc_UserAdvManager[9] <> '-1')) and isset($conf_nbc_UserAdvManager_ConfirmMail[0]) and $conf_nbc_UserAdvManager_ConfirmMail[0]=='true') 387 387 { 388 388 // +-----------------------------------------------------------------------+ … … 747 747 } 748 748 } 749 749 750 750 751 // +-----------------------------------------------------------------------+ … … 848 849 (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true')) 849 850 ? l10n('is_high_enabled') : l10n('is_high_disabled'); 851 852 $expiration = expiration($local_user['id']); 850 853 851 if (isset($conf_nbc_UserAdvManager_ConfirmMail[1]) and $conf_nbc_UserAdvManager_ConfirmMail[0]=='true' ) 852 { 853 $template->append( 854 'users', 855 array( 856 'ID' => $local_user['id'], 857 'CHECKED' => $checked, 858 'U_PROFILE' => $profile_url.$local_user['id'], 859 'U_PERM' => $perm_url.$local_user['id'], 860 'USERNAME' => $local_user['username'] 861 .($local_user['id'] == $conf['guest_id'] 862 ? '<BR />['.l10n('is_the_guest').']' : '') 863 .($local_user['id'] == $conf['default_user_id'] 864 ? '<BR />['.l10n('is_the_default').']' : ''), 865 'STATUS' => l10n('user_status_'. 866 $local_user['status']).(($local_user['adviser'] == 'true') 867 ? '<BR />['.l10n('adviser').']' : ''), 868 'EMAIL' => get_email_address_as_display_text($local_user['email']), 869 'GROUPS' => $groups_string, 870 'REGISTRATION' => $local_user['registration_date'], 871 ) 872 ); 873 } 854 $template->append( 855 'users', 856 array( 857 'ID' => $local_user['id'], 858 'CHECKED' => $checked, 859 'U_PROFILE' => $profile_url.$local_user['id'], 860 'U_PERM' => $perm_url.$local_user['id'], 861 'USERNAME' => $local_user['username'] 862 .($local_user['id'] == $conf['guest_id'] 863 ? '<BR />['.l10n('is_the_guest').']' : '') 864 .($local_user['id'] == $conf['default_user_id'] 865 ? '<BR />['.l10n('is_the_default').']' : ''), 866 'STATUS' => l10n('user_status_'. 867 $local_user['status']).(($local_user['adviser'] == 'true') 868 ? '<BR />['.l10n('adviser').']' : ''), 869 'EMAIL' => get_email_address_as_display_text($local_user['email']), 870 'GROUPS' => $groups_string, 871 'REGISTRATION' => $local_user['registration_date'], 872 'EXPIRATION' => $expiration, 873 ) 874 ); 874 875 } 875 876 -
extensions/NBC_UserAdvManager/branches/2.11/admin/global.tpl
r3859 r3921 63 63 </li> 64 64 <li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br> 65 <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols=" 80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea>65 <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="30" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea> 66 66 </li> 67 67 </ul> -
extensions/NBC_UserAdvManager/branches/2.11/admin/usermanager.tpl
r3859 r3921 29 29 <td>{$user.EMAIL}</td> 30 30 <td>{$user.GROUPS}</td> 31 <td style="text-align:center;">{$user.REGISTRATION}</td>31 <td {if $user.EXPIRATION == True}style="color:red;text-align:center;"{else}style="color:lime;text-align:center;"{/if}>{$user.REGISTRATION}</td> 32 32 {foreach from=$user.plugin_columns item=data} 33 33 <td>{$data}</td> … … 35 35 </tr> 36 36 {/foreach} 37 </table>37 </table> 38 38 <br/> 39 39 </li> -
extensions/NBC_UserAdvManager/branches/2.11/include/functions_UserAdvManager.inc.php
r3882 r3921 616 616 617 617 $users = array(); 618 618 619 619 /* search users depending expiration date */ 620 620 $query = ' 621 621 SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id, 622 622 u.'.$conf['user_fields']['username'].' AS username, 623 u.'.$conf['user_fields']['email'].' AS email, 624 ui.status, 625 ui.adviser, 626 ui.enabled_high, 627 ui.level, 628 ui.registration_date, 629 ug.group_id 623 u.'.$conf['user_fields']['email'].' AS email, 624 ui.status, 625 ui.adviser, 626 ui.enabled_high, 627 ui.level, 628 ui.registration_date 630 629 FROM '.USERS_TABLE.' AS u 631 INNER JOIN '.USER_INFOS_TABLE.' AS ui 632 ON u.'.$conf['user_fields']['id'].' = ui.user_id 633 INNER JOIN '.USER_GROUP_TABLE.' AS ug 634 ON u.'.$conf['user_fields']['id'].' = ug.user_id 635 WHERE u.'.$conf['user_fields']['id'].' >= 0 636 AND ug.group_id = "'.$conf_nbc_UserAdvManager[3].'" 637 AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'" 638 OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'") 639 ORDER BY id ASC 640 ;'; 630 INNER JOIN '.USER_INFOS_TABLE.' AS ui 631 ON u.'.$conf['user_fields']['id'].' = ui.user_id 632 LEFT JOIN '.USER_GROUP_TABLE.' AS ug 633 ON u.'.$conf['user_fields']['id'].' = ug.user_id 634 WHERE u.'.$conf['user_fields']['id'].' >= 3 635 AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'" 636 OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'")'; 637 638 if ($conf_nbc_UserAdvManager[3] <> '-1' and $conf_nbc_UserAdvManager[9] == '-1') 639 { 640 $query.= ' 641 AND ug.group_id = '.$conf_nbc_UserAdvManager[3]; 642 } 643 if ($conf_nbc_UserAdvManager[3] == '-1' and $conf_nbc_UserAdvManager[9] <> '-1') 644 { 645 $query.= ' 646 AND ui.status = \''.$conf_nbc_UserAdvManager[9]."'"; 647 } 648 if ($conf_nbc_UserAdvManager[3] <> '-1' and $conf_nbc_UserAdvManager[9] <> '-1') 649 { 650 $query.= ' 651 AND ug.group_id = \''.$conf_nbc_UserAdvManager[3]."'"; 652 } 653 $query.= ' 654 ORDER BY id ASC 655 ;'; 641 656 642 657 $result = pwg_query($query); … … 680 695 return $users; 681 696 } 697 698 /* Function called from UserAdvManager.php - to determine who is expired or not and giving a different display color */ 699 function expiration($id) 700 { 701 global $conf, $page; 702 703 /* Get ConfirmMail configuration */ 704 $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array(); 705 706 /* Get UserAdvManager configuration */ 707 $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array(); 708 709 $query = " 710 SELECT registration_date 711 FROM ".USER_INFOS_TABLE." 712 WHERE user_id = '".$id."' 713 ;"; 714 list($registration_date) = mysql_fetch_row(pwg_query($query)); 715 716 /* Time limit process */ 717 /* ****************** begin ******************* */ 718 if (!empty($registration_date)) 719 { 720 // dates formating and compare 721 $today = date("d-m-Y"); // Get today's date 722 list($day, $month, $year) = explode('-', $today); // explode date of today 723 $daytimestamp = mktime(0, 0, 0, $month, $day, $year);// Generate UNIX timestamp 724 725 list($regdate, $regtime) = explode(' ', $registration_date); // Explode date and time from registration date 726 list($regyear, $regmonth, $regday) = explode('-', $regdate); // Explode date from registration date 727 $regtimestamp = mktime(0, 0, 0, $regmonth, $regday, $regyear);// Generate UNIX timestamp 728 729 $deltasecs = $daytimestamp - $regtimestamp;// Compare the 2 UNIX timestamps 730 $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days 731 732 // Condition with the value set for time limit 733 if ($deltadays <= $conf_nbc_UserAdvManager_ConfirmMail[1]) // If Nb of days is less than the limit set 734 { 735 return false; 736 } 737 else 738 { 739 return True; 740 } 741 } 742 } 682 743 ?> -
extensions/NBC_UserAdvManager/branches/2.11/language/fr_FR/plugin.lang.php
r3888 r3921 101 101 $lang['UserAdvManager_Empty Author'] = 'Le champs auteur doit être rempli pour enregistrer un commentaire.'; 102 102 if ( isset($conf_UserAdvManager[1]) and $conf_UserAdvManager[1] == 'true' ) 103 $lang[' new_reg_err_login5'] = 'ce nom utilisateur est déjà pris, ATTENTION le nom est insensible à la casse (Majuscule = Minuscule).';103 $lang['reg_err_login5'] = 'ce nom utilisateur est déjà pris, ATTENTION le nom est insensible à la casse (Majuscule = Minuscule).'; 104 104 $lang['reg_err_login6'] = 'le nom utilisateur ne doit pas contenir les caractère suivants : '; 105 105 $lang['reg_err_login7'] = 'L\'adresse email est issue d\'un prestataire interdit. Les prestataires d\'adresses email interdits à l\'inscription sont : '; -
extensions/NBC_UserAdvManager/branches/2.11/main.inc.php
r3882 r3921 2 2 /* 3 3 Plugin Name: NBC UserAdvManager 4 Version: 2.11. 24 Version: 2.11.3 5 5 Description: Permet de renforcer les possibilités de gestion des utilisateurs - Enforce users management 6 6 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216 … … 58 58 -- 2.11.2 : Bug fixed on bad query for unvalidated users display in unvalidated users list 59 59 Bug fixed : Sql syntax error on plugin activation 60 61 -- 2.11.3 : On Patricia's request (french forum), the unvalidated users management tab shows users according with the settings of unvalidated group and / or unvalidated status. 62 Email providers exclusion list can be set with CR/LF between each entry. The comma seperator (,) is still mandatory. 63 Bug fixed : Bad translation tag in french language file. 64 Improvement of unvalidated users management tab - Expired users are displayed in red color text. 60 65 61 66 */ … … 153 158 154 159 if ( isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true' ) 155 $lang['reg_err_login5'] = l10n(' new_reg_err_login5');160 $lang['reg_err_login5'] = l10n('reg_err_login5'); 156 161 157 162 … … 204 209 { 205 210 $ncsemail = strtolower($_POST['email']); 206 $conf_nbc_MailExclusion = preg_split( '/,/',$conf_nbc_UserAdvManager[13]);211 $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]); 207 212 for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++) 208 213 { … … 250 255 { 251 256 $ncsemail = strtolower($_POST['mail_address']); 252 $conf_nbc_MailExclusion = preg_split( '/,/',$conf_nbc_UserAdvManager[13]);257 $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]); 253 258 for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++) 254 259 { … … 312 317 { 313 318 $ncsemail = strtolower($_POST['mail_address']); 314 $conf_nbc_MailExclusion = preg_split( '/,/',$conf_nbc_UserAdvManager[13]);319 $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]); 315 320 for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++) 316 321 {
Note: See TracChangeset
for help on using the changeset viewer.