Ignore:
Timestamp:
Sep 26, 2011, 10:26:09 PM (13 years ago)
Author:
Eric
Message:
  • Bug 2437 fixed - New feature : Request password renewal for selected users in Piwigo's users management panel.
  • Language files updates.
  • obsolete.list file creation to clean old help directories in languages.
  • Perform database upgrade.
Location:
extensions/UserAdvManager/trunk
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserAdvManager/trunk/admin/UAM_admin.php

    r12205 r12239  
    109109  case 'global':
    110110
    111         if (isset($_POST['submit']) and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) and isset($_POST['UAM_Password_Enforced']) and isset($_POST['UAM_AdminPassword_Enforced']) and isset($_POST['UAM_GhostUser_Tracker']) and isset($_POST['UAM_Admin_ConfMail']) and isset($_POST['UAM_RedirToProfile']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']))
     111        if (isset($_POST['submit']) and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) and isset($_POST['UAM_Password_Enforced']) and isset($_POST['UAM_AdminPassword_Enforced']) and isset($_POST['UAM_GhostUser_Tracker']) and isset($_POST['UAM_Admin_ConfMail']) and isset($_POST['UAM_RedirToProfile']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']) and isset($_POST['UAM_PwdReset']))
    112112  {
    113113
     
    194194      (isset($_POST['UAM_Valid_Level'])?$_POST['UAM_Valid_Level']:''),
    195195      (isset($_POST['UAM_Downgrade_Level'])?$_POST['UAM_Downgrade_Level']:''),
     196      $_POST['UAM_PwdReset'],
    196197      );
    197198
     
    243244    $dump_download = (isset($_POST['dump_download'])) ? 'true' : 'false';
    244245   
    245     if(uam_dump($dump_download) and $dump_download == 'false')
     246    if(UAM_dump($dump_download) and $dump_download == 'false')
    246247    {
    247248      array_push($page['infos'], l10n('UAM_Dump_OK'));
     
    524525                'UAM_VALID_LEVEL'                => $conf_UAM[36],
    525526    'UAM_DOWNGRADE_LEVEL'            => $conf_UAM[37],
     527    'UAM_PWDRESET_TRUE'              => $conf_UAM[38]=='true' ?  'checked="checked"' : '' ,
     528    'UAM_PWDRESET_FALSE'             => $conf_UAM[38]=='false' ?  'checked="checked"' : '' ,
    526529                'UAM_PASSWORD_TEST_SCORE'        => $UAM_Password_Test_Score,
    527530    'UAM_ERROR_REPORTS1'             => $UAM_Exclusionlist_Error,
  • extensions/UserAdvManager/trunk/admin/template/global.tpl

    r12189 r12239  
    745745            <br><br>
    746746            </li>
     747
     748            <li>
     749              <label class="cluetip" title="{'UAM_PwdResetTitle'|translate}|{'UAM_PwdResetTitle_d'|translate}">
     750                {'UAM_PwdReset'|@translate}
     751              </label>
     752            <br><br>
     753              <input type="radio" value="false" {$UAM_PWDRESET_FALSE} name="UAM_PwdReset">
     754                {'UAM_Disable'|@translate}
     755            <br>
     756              <input type="radio" value="true" {$UAM_PWDRESET_TRUE} name="UAM_PwdReset">
     757                {'UAM_Enable'|@translate}
     758            <br><br>
     759            </li>
    747760          </ul>
    748761        </fieldset>
  • extensions/UserAdvManager/trunk/changelog.txt.php

    r12227 r12239  
    264264            Piwigo 2.3.0 compliant
    265265            Bug 2415 fixed - New feature : Set automatically privacy level for users who have validated or not their registration. Automated task available.
     266            Bug 2437 fixed - New feature : Request password renewal for selected users in Piwigo's users management panel.
    266267            Bug 2445 fixed - Duplicate key MySql error when a user tries to validate his registration twice.
    267268            Help files remaned and relocated in the language root directory (no more "help" subdirectory) for compliance with the new online translation tool.
  • extensions/UserAdvManager/trunk/include/functions.inc.php

    r12227 r12239  
    223223
    224224  $conf_UAM = unserialize($conf['UserAdvManager']);
    225    
     225
     226  // Update first redirection parameter
    226227  if ((isset($conf_UAM[20]) and $conf_UAM[20] == 'true'))
    227228  {
     
    240241  }
    241242
     243  // Special message display for password reset
     244  if ((isset($conf_UAM[38]) and $conf_UAM[38] == 'true'))
     245  {
     246    if (UAM_check_pwgreset($user['id']))
     247    {
     248      $template->append('errors', l10n('UAM_Password_Reset_Msg'));
     249    }
     250  }
     251
     252  // Controls on profile page submission
    242253  if (isset($_POST['validate']) and !is_admin())
    243254  {
     
    249260        $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'");
    250261        unset($_POST['validate']);
     262      }
     263    }
     264
     265    // Password reset control
     266    if (isset($conf_UAM[38]) and $conf_UAM[38] == 'true' and UAM_check_pwgreset($user['id']))
     267    {
     268      // if password not changed then pwdreset filed = true else pwdreset field = false
     269      if (!empty($_POST['use_new_pwd']))
     270      {
     271        $query = '
     272UPDATE '.USERS_TABLE.'
     273SET UAM_pwdreset = "false"
     274WHERE id = '.$user['id'].'
     275LIMIT 1
     276;';
     277        pwg_query($query);
    251278      }
    252279    }
     
    341368  }
    342369
     370  // Performing redirection to profile page on first login
    343371  if ((isset($conf_UAM[20]) and $conf_UAM[20] == 'true'))
    344   {
    345     // Performing redirection 
     372  { 
    346373    $query ='
    347374SELECT user_id, status
     
    351378    $data = pwg_db_fetch_assoc(pwg_query($query));
    352379
    353     if ($data['status'] <> "admin" and $data['status'] <> "webmaster" and $data['status'] <> "generic")
     380    if ($data['status'] <> "admin" and $data['status'] <> "webmaster" and $data['status'] <> "generic") // Exclusion of specific accounts
    354381    {
    355382      $user_idsOK = array();
    356383      if (!UAM_check_profile($user['id'], $user_idsOK))
    357384        redirect(PHPWG_ROOT_PATH.'profile.php');
     385    }
     386  }
     387
     388  // Performing redirection to profile page for password reset
     389  if ((isset($conf_UAM[38]) and $conf_UAM[38] == 'true'))
     390  {
     391    $query ='
     392SELECT user_id, status
     393FROM '.USER_INFOS_TABLE.'
     394WHERE user_id = '.$user['id'].'
     395;';
     396    $data = pwg_db_fetch_assoc(pwg_query($query));
     397
     398    if ($data['status'] <> "admin" and $data['status'] <> "webmaster" and $data['status'] <> "generic") // Exclusion of specific accounts
     399    {
     400      if (UAM_check_pwgreset($user['id']))
     401      {
     402        redirect(PHPWG_ROOT_PATH.'profile.php');
     403      }
    358404    }
    359405  }
     
    24652511        @unlink($path);
    24662512      }
     2513      elseif (is_dir($path))
     2514      {
     2515        @rmdir($path);
     2516      }
    24672517    }
    24682518  }
     
    24892539  $v = false;
    24902540 
    2491   $query = "
     2541  $query = '
    24922542SELECT value
    2493 FROM ".CONFIG_TABLE."
    2494 WHERE param = 'UserAdvManager_Redir'
    2495 ;";
     2543FROM '.CONFIG_TABLE.'
     2544WHERE param = "UserAdvManager_Redir"
     2545;';
    24962546 
    24972547  if ($v = (($t = pwg_db_fetch_row(pwg_query($query))) !== false))
     
    25052555
    25062556/**
     2557 * UAM_check_pwdreset
     2558 * checks if a user id is registered as having already
     2559 * changed their password.
     2560 *
     2561 * @uid        : the user id
     2562 *
     2563 * @returns    : true or false whether the users has already changed his password
     2564 *
     2565 */
     2566function UAM_check_pwgreset($uid)
     2567{
     2568  $query = '
     2569SELECT UAM_pwdreset
     2570FROM '.USERS_TABLE.'
     2571WHERE id='.$uid.'
     2572;';
     2573
     2574  $result = pwg_db_fetch_assoc(pwg_query($query));
     2575 
     2576  if($result['UAM_pwdreset'] == 'true')
     2577  {
     2578    return true;
     2579  }
     2580  else return false;
     2581}
     2582
     2583/**
     2584 * UAM_Set_PwdReset
     2585 * Action in user_list to set a password reset for a user
     2586 */
     2587function UAM_Set_PwdReset($uid)
     2588{
     2589  $query ='
     2590UPDATE '.USERS_TABLE.'
     2591SET UAM_pwdreset = "true"
     2592WHERE id = '.$uid.'
     2593LIMIT 1
     2594;';
     2595
     2596  pwg_query($query);
     2597}
     2598
     2599
     2600/**
     2601 * UAM_loc_visible_user_list
     2602 * Adds a new feature in user_list to allow password reset for selected users by admin
     2603 *
     2604 */
     2605function UAM_loc_visible_user_list($visible_user_list)
     2606{
     2607  global $template;
     2608 
     2609  $template->append('plugin_user_list_column_titles', l10n('UAM_PwdReset'));
     2610 
     2611  $user_ids = array();
     2612 
     2613  foreach ($visible_user_list as $i => $user)
     2614  {
     2615    $user_ids[$i] = $user['id'];
     2616  }
     2617 
     2618  $user_nums = array_flip($user_ids);
     2619
     2620  // Query to get informations in database
     2621  if (!empty($user_ids))
     2622  {
     2623    $query = '
     2624SELECT DISTINCT id, UAM_pwdreset
     2625  FROM '.USERS_TABLE.'
     2626  WHERE id IN ('.implode(',', $user_ids).')
     2627;';
     2628    $result = pwg_query($query);
     2629   
     2630    while ($row = mysql_fetch_array($result))
     2631    {
     2632      if ($row['UAM_pwdreset'] == 'false')
     2633      {
     2634        $pwdreset = l10n('UAM_PwdReset_Done');
     2635      }
     2636      else if ($row['UAM_pwdreset'] == 'true')
     2637      {
     2638        $pwdreset = l10n('UAM_PwdReset_Todo');
     2639      }
     2640      else $pwdreset = l10n('UAM_PwdReset_NA');
     2641     
     2642                  $visible_user_list[$user_nums[$row['id']]]['plugin_columns'][] = $pwdreset; // Shows users password state in user_list
     2643    }
     2644  }
     2645  return $visible_user_list;
     2646}
     2647
     2648
     2649/**
    25072650 * UAM specific database dump (only for MySql !)
    25082651 * Creates an SQL dump of UAM specific tables and configuration settings
     
    25112654 *
    25122655 */
    2513 function uam_dump($download)
     2656function UAM_dump($download)
    25142657{
    25152658  global $conf;
  • extensions/UserAdvManager/trunk/include/upgradedb.inc.php

    r12189 r12239  
    515515  $Newconf_UAM[36] = '-1';
    516516  $Newconf_UAM[37] = '-1';
    517 
    518   $update_conf = serialize($Newconf_UAM);
    519 
    520   conf_update_param('UserAdvManager', pwg_db_real_escape_string($update_conf));
     517  $Newconf_UAM[38] = 'false';
     518
     519  $update_conf = serialize($Newconf_UAM);
     520
     521  conf_update_param('UserAdvManager', pwg_db_real_escape_string($update_conf));
     522
     523  // Piwigo's native tables modifications for password reset function - Add pwdreset column
     524  $q = '
     525ALTER TABLE '.USERS_TABLE.'
     526ADD UAM_pwdreset enum("true","false")
     527;';
     528  pwg_query($q);
    521529}
    522530?>
  • extensions/UserAdvManager/trunk/language/en_UK/help.lang.php

    r12205 r12239  
    337337...
    338338';
     339$lang['UAM_PwdResetTitle'] = 'Password renewal';
     340$lang['UAM_PwdResetTitle_d'] = 'Enabling this option will add a new feature in the Piwigo\'s user management panel (Users> Manage) that can apply to renew the password for selected users. In addition, a new column is added to show the status of passwords for each of them with the following values:<br>
     341- Password to be renewed: A password renewal request has been planned.<br>
     342- Password renewed: The password has been renewed after a request.<br>
     343- Original Password: The original password chosen at account creation and has never been required for a renewal.<br>
     344The webmaster, administrators and guest accounts are excluded from this function.<br>
     345These users will be automatically redirected to their customization page at each of their connections until they changed their password and an explicit message will be displayed on this page.';
    339346// --------- End: New or revised $lang ---- from version 2.30.0
    340347?>
  • extensions/UserAdvManager/trunk/language/en_UK/plugin.lang.php

    r12189 r12239  
    344344$lang['UAM_Title3'] = 'Ghost users management';
    345345$lang['UAM_Title5'] = 'Other miscellaneous options';
     346$lang['UAM_Password_Reset_Msg'] = 'Please, change your password!';
     347$lang['UAM_PwdReset'] = 'Password renewal';
     348$lang['UAM_Password reset selected users'] = 'Request password renewal for selected users';
     349$lang['UAM_Guest cannot be pwdreset'] = 'Password renewal can\'t be set for guests account!';
     350$lang['UAM_Default user cannot be pwgreset'] = 'Password renewal can\'t be set for default user account!';
     351$lang['UAM_Webmaster cannot be pwdreset'] = 'Password renewal can\'t be set for the webmaster account!';
     352$lang['UAM_You cannot pwdreset your account'] = 'Password renewal can\'t be set for your own account!';
     353$lang['UAM_You need to confirm pwdreset'] = 'You must confirm password renewal (check box)!';
     354$lang['UAM_PwdReset_Todo'] = 'Password to be renewed';
     355$lang['UAM_PwdReset_Done'] = 'Password renewed';
     356$lang['UAM_PwdReset_NA'] = 'Original password';
     357$lang['UAM %d user pwdreseted'] = 'Password renewal required for %d user';
     358$lang['UAM %d users pwdreseted'] = 'Password renewal required for %d users';
    346359// --------- End: New or revised $lang ---- from version 2.30.0
    347360?>
  • extensions/UserAdvManager/trunk/language/fr_FR/help.lang.php

    r12205 r12239  
    333333...
    334334';
     335$lang['UAM_PwdResetTitle'] = 'Renouvellement du mot de passe';
     336$lang['UAM_PwdResetTitle_d'] = 'L\'activation de cette option ajoutera une nouvelle fonction dans le panneau de gestion de utilisateurs (Utilisateurs > Gérer) de Piwigo qui permet de demander le renouvellement du mot de passe pour les utilisateurs sélectionnés. De plus, une nouvelle colonne s\'ajoutera pour présenter le statut des mots de passe pour chacun d\'eux avec les valeurs suivantes :<br>
     337- Mot de passe à changer : Une demande de changement de mot de passe a été programmée.<br>
     338- Mot de passe modifié : Le mot de passe a été changé suite à une demande.<br>
     339- Mot de passe original : Le mot de passe est celui choisi à la création du compte et n\'a jamais fait l\'objet d\'une demande de changement.<br>
     340Le compte du webmaster, des administrateurs et de l\'invité (Guest) sont exclus de cette fonction.<br><br>
     341Ces utilisateurs seront alors systématiquement redirigés vers leur page de personnalisation à chacune de leurs connexions tant qu\'ils n\'auront pas modifié leur mot de passe. Un message explicite sera affiché sur cette page.';
    335342// --------- End: New or revised $lang ---- from version 2.30.0
    336343?>
  • extensions/UserAdvManager/trunk/language/fr_FR/plugin.lang.php

    r12189 r12239  
    341341$lang['UAM_Title3'] = 'Gestion des utilisateurs fantômes';
    342342$lang['UAM_Title5'] = 'Autres options diverses';
     343$lang['UAM_Password_Reset_Msg'] = 'Veuillez modifier votre mot de passe !';
     344$lang['UAM_PwdReset'] = 'Renouvellement du mot de passe';
     345$lang['UAM_Password reset selected users'] = 'Demander le renouvellement du mot de passe pour les utilisateurs sélectionnés';
     346$lang['UAM_Guest cannot be pwdreset'] = 'Le renouvellement de mot de passe ne peut pas être demandé pour les invités !';
     347$lang['UAM_Default user cannot be pwgreset'] = 'Le renouvellement de mot de passe ne peut pas être demandé pour l\'utilisateur par défaut !';
     348$lang['UAM_Webmaster cannot be pwdreset'] = 'Le renouvellement de mot de passe ne peut pas être demandé pour le webmaster !';
     349$lang['UAM_You cannot pwdreset your account'] = 'Le renouvellement de mot de passe ne peut pas être demandé pour votre propre compte utilisateur !';
     350$lang['UAM_You need to confirm pwdreset'] = 'Vous devez confirmer la demande de renouvellement de mot de passe (case à cocher) !';
     351$lang['UAM_PwdReset_Todo'] = 'Mot de passe à changer';
     352$lang['UAM_PwdReset_Done'] = 'Mot de passe modifié';
     353$lang['UAM_PwdReset_NA'] = 'Mot de passe original';
     354$lang['UAM %d user pwdreseted'] = 'Renouvellement de mot de passe demandé pour %d utilisateur';
     355$lang['UAM %d users pwdreseted'] = 'Renouvellement de mot de passe demandé pour %d utilisateurs';
    343356// --------- End: New or revised $lang ---- from version 2.30.0
    344357?>
  • extensions/UserAdvManager/trunk/main.inc.php

    r12189 r12239  
    6262  add_event_handler('get_stuffs_modules', 'register_UAM_stuffs_module');
    6363}
     64
     65// Add new feature in user_list - Password Reset
     66if ((isset($conf_UAM[38]) and $conf_UAM[38] == 'true'))
     67{
     68  // add new column on user_list
     69  add_event_handler('loc_visible_user_list', 'UAM_loc_visible_user_list');
     70
     71  //add prefilter on user_list
     72  add_event_handler('loc_begin_admin', 'UAM_PwdReset_Action',60);
     73 
     74  function UAM_PwdReset_Action()
     75  {
     76    global $conf, $user, $template, $lang, $errors;
     77
     78    $page['errors'] = array();
     79    $page['infos'] = array();
     80    $page['filtered_users'] = array();
     81
     82    if (isset($_POST['pwdreset']))
     83    {
     84      $collection = array();
     85
     86      switch ($_POST['target'])
     87      {
     88        case 'all' :
     89        {
     90          foreach($page['filtered_users'] as $local_user)
     91          {
     92            array_push($collection, $local_user['id']);
     93          }
     94          break;
     95        }
     96        case 'selection' :
     97        {
     98          if (isset($_POST['selection']))
     99          {
     100            $collection = $_POST['selection'];
     101          }
     102          break;
     103        }
     104      }
     105
     106      if (count($collection) == 0)
     107      {
     108        array_push($page['errors'], l10n('Select at least one user'));
     109      }
     110    }
     111
     112    if (isset($_POST['pwdreset']) and count($collection) > 0)
     113    {
     114      if (in_array($conf['guest_id'], $collection))
     115      {
     116        array_push($page['errors'], l10n('UAM_Guest cannot be pwdreset'));
     117        $template->append('errors', l10n('UAM_Guest cannot be pwdreset'));
     118      }
     119      if (($conf['guest_id'] != $conf['default_user_id']) and
     120        in_array($conf['default_user_id'], $collection))
     121      {
     122        array_push($page['errors'], l10n('UAM_Default user cannot be pwgreset'));
     123        $template->append('errors', l10n('UAM_Default user cannot be pwgreset'));
     124      }
     125      if (in_array($conf['webmaster_id'], $collection))
     126      {
     127        array_push($page['errors'], l10n('UAM_Webmaster cannot be pwdreset'));
     128        $template->append('errors', l10n('UAM_Webmaster cannot be pwdreset'));
     129      }
     130      if (in_array($user['id'], $collection))
     131      {
     132        array_push($page['errors'], l10n('UAM_You cannot pwdreset your account'));
     133        $template->append('errors', l10n('UAM_You cannot pwdreset your account'));
     134      }
     135
     136      if (count($page['errors']) == 0)
     137      { 
     138        if (isset($_POST['confirm_pwdreset']) and 1 == $_POST['confirm_pwdreset'])
     139        {
     140          foreach ($collection as $user_id)
     141          {
     142            UAM_Set_PwdReset($user_id);
     143          }
     144          array_push(
     145            $page['infos'],
     146            l10n_dec(
     147              'UAM %d user pwdreseted', 'UAM %d users pwdreseted',
     148              count($collection)
     149              )
     150            );
     151          $template->append('infos', l10n_dec(
     152              'UAM %d user pwdreseted', 'UAM %d users pwdreseted',
     153              count($collection)));
     154          foreach ($page['filtered_users'] as $filter_key => $filter_user)
     155          {
     156            if (in_array($filter_user['id'], $collection))
     157            {
     158              unset($page['filtered_users'][$filter_key]);
     159            }
     160          }
     161        }
     162        else
     163        {
     164          array_push($page['errors'], l10n('UAM_You need to confirm pwdreset'));
     165          $template->append('errors', l10n('UAM_You need to confirm pwdreset'));
     166        }
     167      }
     168    } 
     169    $template->set_prefilter('user_list', 'UAM_PwdReset_Prefilter');
     170  }
     171
     172  function UAM_PwdReset_Prefilter($content, &$smarty)
     173  {
     174    $search = '
     175<fieldset>
     176  <legend>{\'Deletions\'|@translate}</legend>
     177  <label><input type="checkbox" name="confirm_deletion" value="1"> {\'confirm\'|@translate}</label>
     178  <input class="submit" type="submit" value="{\'Delete selected users\'|@translate}" name="delete">
     179</fieldset>
     180';
     181 
     182    $addon = '
     183<fieldset>
     184  <legend>{\'UAM_PwdReset\'|@translate}</legend>
     185  <label><input type="checkbox" name="confirm_pwdreset" value="1"> {\'confirm\'|@translate}</label>
     186  <input class="submit" type="submit" value="{\'UAM_Password reset selected users\'|@translate}" name="pwdreset">
     187</fieldset>
     188';
     189
     190    $replacement = $addon.$search;
     191
     192    return str_replace($search, $replacement, $content);
     193  }
     194}
    64195?>
  • extensions/UserAdvManager/trunk/maintain.inc.php

    r12189 r12239  
    2222Best regards,
    2323
    24 The admin of the gallery.','false','false','false','false','false','Sorry [username], your account has been deleted due to a too long time passed since your last visit at [mygallery].','Sorry [username], your account has been deprecated due to a too long time passed since your last visit at [mygallery]. Please, use the following link to revalidate your account.',-1,-1,'Thank you for registering at [mygallery]. Your account has been manually validated by _admin_. You may now log in at _link_to_site_ and make any appropriate changes to your profile. Welcome to _name_of_site_!','false','You have requested a password reset on our gallery. Please, find below your new connection settings.','false','Sorry, your account has been deleted because you have not validated your registration in requested time. Please, try registration with a valid and non blocked email account.','false','false','false',-1,-1,-1);
     24The admin of the gallery.','false','false','false','false','false','Sorry [username], your account has been deleted due to a too long time passed since your last visit at [mygallery].','Sorry [username], your account has been deprecated due to a too long time passed since your last visit at [mygallery]. Please, use the following link to revalidate your account.',-1,-1,'Thank you for registering at [mygallery]. Your account has been manually validated by _admin_. You may now log in at _link_to_site_ and make any appropriate changes to your profile. Welcome to _name_of_site_!','false','You have requested a password reset on our gallery. Please, find below your new connection settings.','false','Sorry, your account has been deleted because you have not validated your registration in requested time. Please, try registration with a valid and non blocked email account.','false','false','false',-1,-1,-1,'false');
    2525
    2626        $query = '
     
    126126ENGINE=MyISAM;";
    127127  pwg_query($q);
     128
     129  // Piwigo's native tables modifications for password reset function - Add pwdreset column
     130  $query = '
     131SHOW COLUMNS FROM '.USERS_TABLE.'
     132LIKE "UAM_pwdreset"
     133;';
     134 
     135  $result = pwg_query($query);
     136
     137  if(!pwg_db_fetch_row($result))
     138  {
     139    $q = '
     140ALTER TABLE '.USERS_TABLE.'
     141ADD UAM_pwdreset enum("true","false")
     142;';
     143    pwg_query($q);
     144  }
    128145}
    129146
     
    326343  }
    327344
    328   $q = 'DROP TABLE '.USER_CONFIRM_MAIL_TABLE.';';
     345  $q = '
     346DROP TABLE '.USER_CONFIRM_MAIL_TABLE.'
     347;';
    329348  pwg_query( $q );
    330349
    331   $q = 'DROP TABLE '.USER_LASTVISIT_TABLE.';';
     350  $q = '
     351DROP TABLE '.USER_LASTVISIT_TABLE.'
     352;';
    332353  pwg_query( $q );
     354
     355  $q = '
     356ALTER TABLE '.USERS_TABLE.'
     357DROP UAM_pwdreset
     358;';
     359  pwg_query($q);
    333360}
    334361?>
Note: See TracChangeset for help on using the changeset viewer.