Changeset 5633


Ignore:
Timestamp:
04/04/10 16:18:52 (9 years ago)
Author:
Eric
Message:

[NBC_UserAdvManager]

  • Bug 1571 fixed : Missing translation tag
  • Bug 1572 fixed : Fix unable to read resource: "ConfirmMail.tpl"
  • Bug 1574 fixed : Beautifying ConfirmMail page. Moved to a "template" folder with css file and icons.
  • Bug 1576 partially fixed : Compatibility with other database systems than MySql like PostgreSql or Sqlite. Using Piwigo's pwg_db_### integrated functions. mysql_list_fields() and mysql_num_fields() are not implemented in Piwigo's database functions. This point is still under discuss on FR forum.
Location:
extensions/NBC_UserAdvManager/trunk
Files:
8 added
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/ConfirmMail.php

    r5593 r5633  
    22//----------------------------------------------------------- include 
    33define('PHPWG_ROOT_PATH','./../../'); 
     4 
    45include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 
     6 
    57include_once (UAM_PATH.'include/constants.php'); 
    68include_once (UAM_PATH.'include/functions.inc.php'); 
     
    1113//check_status(ACCESS_NONE); 
    1214load_language('plugin.lang', UAM_PATH); 
    13  
    14 if (isset($_GET['key'])) 
    15 { 
    16  
    17   global $conf; 
    18    
    19   $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']); 
    20  
    21   if (VerifyConfirmMail($_GET['key'])) 
    22   { 
    23     $template->assign( 
    24                         array( 
    25                                 'CONFIRM_MAIL_MESSAGE' => $conf_UAM_ConfirmMail[5], 
    26                         ) 
    27                 ); 
    28   }   
    29   else 
    30   {   
    31     $template->assign( 
    32                         array( 
    33                                 'CONFIRM_MAIL_MESSAGE' => $conf_UAM_ConfirmMail[6], 
    34                         ) 
    35                 ); 
    36   } 
    37 } 
    3815 
    3916/** 
     
    5532  '/theme/'.$user['theme'].'/themeconf.inc.php'); 
    5633 
    57 $template->set_filenames( 
    58   array( 
    59         'confirm_mail'=>UAM_PATH.'ConfirmMail.tpl', 
    60         ) 
    61 ); 
     34if (isset($_GET['key'])) 
     35{ 
     36 
     37  global $conf; 
     38   
     39  $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']); 
     40 
     41  if (VerifyConfirmMail($_GET['key'])) 
     42  { 
     43    $status = true; 
     44     
     45    $template->assign( 
     46                        array( 
     47        'STATUS'               => $status, 
     48                                'CONFIRM_MAIL_MESSAGE' => $conf_UAM_ConfirmMail[5], 
     49                        ) 
     50                ); 
     51  }   
     52  else 
     53  { 
     54    $status = false; 
     55    $template->assign( 
     56                        array( 
     57        'STATUS'               => $status, 
     58                                'CONFIRM_MAIL_MESSAGE' => $conf_UAM_ConfirmMail[6], 
     59                        ) 
     60                ); 
     61  } 
     62} 
     63 
    6264if (isset($lang['Theme: '.$user['theme']])) 
    6365{ 
     
    7880} 
    7981 
     82$template->set_filenames( 
     83  array( 
     84        'confirm_mail'=>dirname(__FILE__).'/template/ConfirmMail.tpl', 
     85        ) 
     86); 
    8087 
    8188$template->pparse('confirm_mail'); 
  • extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php

    r5593 r5633  
    216216  $result = pwg_query($query); 
    217217         
    218   while ($row = mysql_fetch_assoc($result)) 
     218  while ($row = pwg_db_fetch_assoc($result)) 
    219219  { 
    220220    $groups[$row['id']] = $row['name']; 
     
    370370                  $result = pwg_query($query); 
    371371                         
    372                   while($row = mysql_fetch_assoc($result)) 
     372                  while($row = pwg_db_fetch_assoc($result)) 
    373373                { 
    374374                                $msg_error1 .= (($msg_error1 <> '') ? '<br/>' : '') . l10n('Err_audit_no_casse').stripslashes($row['username']); 
     
    388388                        $result = pwg_query($query); 
    389389                         
    390                         while($row = mysql_fetch_assoc($result)) 
     390                        while($row = pwg_db_fetch_assoc($result)) 
    391391                        { 
    392392                                if (!ValidateUsername(stripslashes($row['username']))) 
     
    407407                  $result = pwg_query($query); 
    408408                         
    409                   while($row = mysql_fetch_assoc($result)) 
     409                  while($row = pwg_db_fetch_assoc($result)) 
    410410                  { 
    411411                          $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[13]); 
     
    801801WHERE id = '".$user_id."' 
    802802;"; 
    803                                         $data = mysql_fetch_assoc(pwg_query($query)); 
     803                                        $data = pwg_db_fetch_assoc(pwg_query($query)); 
    804804                                 
    805805                ResendMail2User($typemail,$user_id,stripslashes($data['username']),$data['mail_address'],true); 
     
    886886;"; 
    887887                                         
    888                                         $data = mysql_fetch_assoc(pwg_query($query)); 
     888                                        $data = pwg_db_fetch_assoc(pwg_query($query)); 
    889889                                 
    890890                ResendMail2User($typemail,$user_id,stripslashes($data['username']),$data['mail_address'],false);                                 
     
    970970;"; 
    971971                                         
    972                                         $data = mysql_fetch_assoc(pwg_query($query)); 
     972                                        $data = pwg_db_fetch_assoc(pwg_query($query)); 
    973973                                 
    974974                ForceValidation($data['id']);                            
     
    10011001                $result = pwg_query($query); 
    10021002           
    1003     while ($row = mysql_fetch_assoc($result)) 
     1003    while ($row = pwg_db_fetch_assoc($result)) 
    10041004    { 
    10051005      $groups[$row['id']] = $row['name']; 
     
    10821082      $result = pwg_query($query); 
    10831083       
    1084       $row = mysql_fetch_assoc($result); 
     1084      $row = pwg_db_fetch_assoc($result); 
    10851085     
    10861086      if (isset($row['reminder']) and $row['reminder'] == 'true') 
     
    13531353;"; 
    13541354                                         
    1355                                         $data = mysql_fetch_assoc(pwg_query($query)); 
     1355                                        $data = pwg_db_fetch_assoc(pwg_query($query)); 
    13561356                                 
    13571357                ghostreminder($user_id,stripslashes($data['username']),$data['mail_address']);                           
     
    13781378  FROM '.USER_LASTVISIT_TABLE.';'; 
    13791379 
    1380         $count = mysql_num_rows(pwg_query($query1)); 
     1380        $count = pwg_db_num_rows(pwg_query($query1)); 
    13811381 
    13821382        if ($count <> 0) 
     
    13971397          $result = pwg_query($query); 
    13981398           
    1399           while ($row = mysql_fetch_assoc($result)) 
     1399          while ($row = pwg_db_fetch_assoc($result)) 
    14001400          { 
    1401             list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); 
     1401            list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 
    14021402             
    14031403            $query = " 
     
    14241424          $result = pwg_query($query); 
    14251425           
    1426           while($row = mysql_fetch_assoc($result)) 
     1426          while($row = pwg_db_fetch_assoc($result)) 
    14271427          { 
    1428             list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); 
     1428            list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 
    14291429             
    14301430            $query = " 
  • extensions/NBC_UserAdvManager/trunk/changelog.txt.php

    r5593 r5633  
    163163            Bug 1508 fixed - Plugin's name is now UserAdvManager (deletion of "nbc_" in code and PEM) 
    164164            Bug 1551 fixed - Database upgrade improvement 
     165 
     166-- 2.15.1 : Bug 1571 fixed - Missing translation tag 
     167            Bug 1572 fixed - Fix unable to read resource: "ConfirmMail.tpl" 
     168            Bug 1574 fixed - Beautifying ConfirmMail page 
     169            Bug 1576 fixed - Compatibility with other database systems than MySql like PostgreSql or Sqlite. Using Piwigo's pwg_db_### integrated functions. 
    165170*/ 
    166171?> 
  • extensions/NBC_UserAdvManager/trunk/include/functions.inc.php

    r5181 r5633  
    2222WHERE user_id = '.$id.' 
    2323;'; 
    24   $data = mysql_fetch_assoc(pwg_query($query)); 
     24  $data = pwg_db_fetch_assoc(pwg_query($query)); 
    2525 
    2626/* Check if user is already registered (profile changing) - If not (new registration), language is set to current gallery language */ 
     
    166166WHERE user_id = '.$user_id.' 
    167167;'; 
    168   $data = mysql_fetch_assoc(pwg_query($query)); 
     168  $data = pwg_db_fetch_assoc(pwg_query($query)); 
    169169  $language = $data['language']; 
    170170   
     
    265265WHERE user_id = '.$user_id.' 
    266266;'; 
    267   $data = mysql_fetch_assoc(pwg_query($query)); 
     267  $data = pwg_db_fetch_assoc(pwg_query($query)); 
    268268  $language = $data['language']; 
    269269 
     
    320320WHERE id = '".$id."' 
    321321;"; 
    322     list($count) = mysql_fetch_row(pwg_query($query)); 
     322    list($count) = pwg_db_fetch_row(pwg_query($query)); 
    323323 
    324324    if ($count == 0) 
     
    336336  $Confirm_Mail_ID = FindAvailableConfirmMailID(); 
    337337 
    338   list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); 
     338  list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 
    339339   
    340340  if (isset($Confirm_Mail_ID)) 
     
    345345WHERE user_id = '".$user_id."' 
    346346;"; 
    347     list($status) = mysql_fetch_row(pwg_query($query)); 
     347    list($status) = pwg_db_fetch_row(pwg_query($query)); 
    348348     
    349349    $query = " 
     
    399399  $Confirm_Mail_ID = FindAvailableConfirmMailID(); 
    400400 
    401   list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); 
     401  list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 
    402402   
    403403  if (isset($Confirm_Mail_ID)) 
     
    427427  global $conf; 
    428428 
    429   list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); 
     429  list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 
    430430 
    431431  $query = " 
     
    474474WHERE id = '".$id."' 
    475475;"; 
    476   list($count) = mysql_fetch_row(pwg_query($query)); 
     476  list($count) = pwg_db_fetch_row(pwg_query($query)); 
    477477 
    478478  if ($count == 1) 
     
    483483WHERE id = '".$id."' 
    484484;"; 
    485     $data = mysql_fetch_assoc(pwg_query($query)); 
     485    $data = pwg_db_fetch_assoc(pwg_query($query)); 
    486486         
    487487    if (!empty($data) and isset($data['user_id']) and !isset($data['date_check'])) 
     
    492492WHERE user_id = '".$data['user_id']."' 
    493493;"; 
    494       list($registration_date) = mysql_fetch_row(pwg_query($query)); 
     494      list($registration_date) = pwg_db_fetch_row(pwg_query($query)); 
    495495 
    496496/*              Time limit process              */ 
     
    516516                                        if ($deltadays <= $conf_UAM_ConfirmMail[1]) // If Nb of days is less than the limit set 
    517517                                        { 
    518                                                 list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); 
     518                                                list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 
    519519 
    520520                                                $query = ' 
     
    568568                                else 
    569569                                { 
    570                                         list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); 
     570                                        list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 
    571571 
    572572                                        $query = ' 
     
    640640WHERE user_id = '".$id."' 
    641641;"; 
    642   list($count) = mysql_fetch_row(pwg_query($query)); 
     642  list($count) = pwg_db_fetch_row(pwg_query($query)); 
    643643 
    644644  if ($count == 1) 
     
    649649WHERE user_id = '".$id."' 
    650650;"; 
    651     $data = mysql_fetch_assoc(pwg_query($query)); 
     651    $data = pwg_db_fetch_assoc(pwg_query($query)); 
    652652 
    653653    if (!empty($data) and isset($data['user_id']) and !isset($data['date_check'])) 
    654654    {       
    655                         list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); 
     655                        list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 
    656656 
    657657                        $query = " 
     
    718718WHERE LOWER(".stripslashes($conf['user_fields']['username']).") = '".strtolower($username)."' 
    719719;"; 
    720     $users = mysql_num_rows(pwg_query($query)); 
     720    $users = pwg_db_num_rows(pwg_query($query)); 
    721721    if ($users > 0) 
    722722    { 
     
    837837        $result = pwg_query($query); 
    838838       
    839   while ($row = mysql_fetch_assoc($result)) 
     839  while ($row = pwg_db_fetch_assoc($result)) 
    840840  { 
    841841        $user = $row; 
     
    864864                $result = pwg_query($query); 
    865865         
    866     while ($row = mysql_fetch_assoc($result)) 
     866    while ($row = pwg_db_fetch_assoc($result)) 
    867867    { 
    868868        array_push( 
     
    901901        $result = pwg_query($query); 
    902902       
    903   while ($row = mysql_fetch_assoc($result)) 
     903  while ($row = pwg_db_fetch_assoc($result)) 
    904904  { 
    905905        $user = $row; 
     
    942942        $result = pwg_query($query); 
    943943       
    944   while ($row = mysql_fetch_assoc($result)) 
     944  while ($row = pwg_db_fetch_assoc($result)) 
    945945  { 
    946946        $user = $row; 
     
    977977WHERE user_id = '".$id."' 
    978978;"; 
    979         list($registration_date) = mysql_fetch_row(pwg_query($query)); 
     979        list($registration_date) = pwg_db_fetch_row(pwg_query($query)); 
    980980 
    981981/*              Time limit process              */ 
     
    10881088{ 
    10891089  $query = 'DESC '.$table.';'; 
    1090   return (bool)($res=mysql_query($query)); 
     1090  return (bool)($res=pwg_query($query)); 
    10911091} 
    10921092 
  • extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php

    r5598 r5633  
    255255$lang['Err_UserManager_Settings'] = 'Diese Seite ist nur verfügbar, wenn "Bestätigung der Anmeldung" aktiv ist und wenn eine Gruppe von nicht validierte Besuchern wird in "Einstellen Bestätigungen und Validierungen der Registrierung" konfiguriert.'; 
    256256// --------- End: New or revised $lang ---- from version 2.15.0 
     257 
     258 
     259// --------- Starting below: New or revised $lang ---- from version 2.15.1 
     260$lang['reg_err_mail_address_dbl'] = 'This email address is already used.'; 
     261// --------- End: New or revised $lang ---- from version 2.15.1 
    257262?> 
  • extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php

    r5598 r5633  
    252252$lang['Err_UserManager_Settings'] = 'This page is available only if "Confirmation of registration" is active and if a group of visitors not validated is configured in "Setting confirmations and validations of registration".'; 
    253253// --------- End: New or revised $lang ---- from version 2.15.0 
     254 
     255 
     256// --------- Starting below: New or revised $lang ---- from version 2.15.1 
     257$lang['reg_err_mail_address_dbl'] = 'Diese E-Mail-Adresse wird bereits verwendet.'; 
     258// --------- End: New or revised $lang ---- from version 2.15.1 
    254259?> 
  • extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php

    r5598 r5633  
    254254$lang['Err_UserManager_Settings'] = 'Esta página está disponible sólo si "Confirmación de registro" está activo y si un grupo de visitantes no ha sido validada está configurado en "Configuración de las confirmaciones y validaciones de registro".'; 
    255255// --------- End: New or revised $lang ---- from version 2.15.0 
     256 
     257 
     258// --------- Starting below: New or revised $lang ---- from version 2.15.1 
     259$lang['reg_err_mail_address_dbl'] = 'Esta dirección de correo electrónico ya se utiliza.'; 
     260// --------- End: New or revised $lang ---- from version 2.15.1 
    256261?> 
  • extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php

    r5598 r5633  
    251251$lang['Err_UserManager_Settings'] = 'Cette page n\'est accessible que si "Confirmation d\'inscription" est actif et si un groupe de visiteurs non validés est configuré dans le "Paramétrage des confirmations et validations d\'inscriptions".'; 
    252252// --------- End: New or revised $lang ---- from version 2.15.0 
     253 
     254 
     255// --------- Starting below: New or revised $lang ---- from version 2.15.1 
     256$lang['reg_err_mail_address_dbl'] = 'Cette adresse email est déjà utilisée.'; 
     257// --------- End: New or revised $lang ---- from version 2.15.1 
    253258?> 
  • extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php

    r5598 r5633  
    254254$lang['Err_UserManager_Settings'] = 'Questa pagina è disponibile solo se "Conferma dell\'iscrizione" è attiva e se un gruppo di visitatori non convalidato è configurato in "Impostare le conferme e validazioni all\'iscrizione".'; 
    255255// --------- End: New or revised $lang ---- from version 2.15.0 
     256 
     257 
     258// --------- Starting below: New or revised $lang ---- from version 2.15.1 
     259$lang['reg_err_mail_address_dbl'] = 'Questo indirizzo e-mail è già utilizzato.'; 
     260// --------- End: New or revised $lang ---- from version 2.15.1 
    256261?> 
  • extensions/NBC_UserAdvManager/trunk/main.inc.php

    r5593 r5633  
    22/* 
    33Plugin Name: UserAdvManager 
    4 Version: 2.15.0 
     4Version: 2.15.1 
    55Description: Renforcer la gestion des utilisateurs - Enforce users management 
    66Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216 
     
    9292;'; 
    9393         
    94       $count = mysql_num_rows(pwg_query($query)); 
     94      $count = pwg_db_num_rows(pwg_query($query)); 
    9595          
    9696      if ($count == 0) 
     
    210210WHERE upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['email'].'\') 
    211211;'; 
    212     list($count) = mysql_fetch_array(pwg_query($query)); 
     212    list($count) = pwg_db_fetch_row(pwg_query($query)); 
    213213    if ($count != 0) 
    214214    { 
     
    234234WHERE upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['mail_address'].'\') 
    235235;'; 
    236     list($count) = mysql_fetch_array(pwg_query($query)); 
     236    list($count) = pwg_db_fetch_row(pwg_query($query)); 
    237237    if ($count != 0) 
    238238    { 
     
    355355;'; 
    356356           
    357           list($current_email) = mysql_fetch_row(pwg_query($query)); 
     357          list($current_email) = pwg_db_fetch_row(pwg_query($query)); 
    358358       
    359359          if ($_POST['mail_address'] != $current_email and ( isset($conf_UAM[2]) and $conf_UAM[2] == 'true')) 
     
    370370;'; 
    371371         
    372           list($username) = mysql_fetch_row(pwg_query($query)); 
     372          list($username) = pwg_db_fetch_row(pwg_query($query)); 
    373373 
    374374          SendMail2User($typemail, $user['id'], $username, $_POST['use_new_pwd'], $_POST['mail_address'], $confirm_mail_need); 
  • extensions/NBC_UserAdvManager/trunk/maintain.inc.php

    r5593 r5633  
    8989WHERE param = "nbc_UserAdvManager_ConfirmMail" 
    9090;'; 
    91   $count1 = mysql_num_rows(pwg_query($query)); 
     91  $count1 = pwg_db_num_rows(pwg_query($query)); 
    9292   
    9393        $query1 = ' 
     
    9696WHERE param = "nbc_UserAdvManager_ConfirmMail" 
    9797;'; 
    98   $count2 = mysql_num_rows(pwg_query($query1)); 
     98  $count2 = pwg_db_num_rows(pwg_query($query1)); 
    9999 
    100100/* If old params exist an upgrade is needed */ 
     
    109109WHERE param = "nbc_UserAdvManager_ConfirmMail" 
    110110;'; 
    111     $count = mysql_num_rows(pwg_query($query));  
     111    $count = pwg_db_num_rows(pwg_query($query));  
    112112   
    113113    if ($count == 0) 
  • extensions/NBC_UserAdvManager/trunk/obsolete.list

    r5593 r5633  
    44admin/userlist.tpl 
    55admin/usermanager.tpl 
     6ConfirmMail.tpl 
Note: See TracChangeset for help on using the changeset viewer.