Ignore:
Timestamp:
Nov 5, 2011, 3:48:21 PM (12 years ago)
Author:
Eric
Message:

Merged from trunk to branch 2.30
Bug 2455 fixed - Exclusion of specific users (généric and admins users) for password reset function.
Bug 2451 fixed - Unable to handle Sql errors but control of backup file validity have been enforced.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserAdvManager/branches/2.30/admin/UAM_admin.php

    r12276 r12551  
    269269    $Backup_File = UAM_PATH.'/include/backup/UAM_dbbackup.sql';
    270270
    271     if (file_exists($Backup_File))
    272     {
    273       $restore = UAM_Restore_backup_file();
    274       if(empty($restore))
     271    if (file_exists($Backup_File) and $file = file($Backup_File, FILE_IGNORE_NEW_LINES) and !empty($file))
     272    {
     273      // Check backup file version
     274      // -------------------------
     275      if ($file[0] == "-- ".$version." --")
    275276      {
    276         array_push($page['infos'], l10n('UAM_Restoration_OK'));
     277        $restore = UAM_Restore_backup_file();
     278        if(empty($restore))
     279        {
     280          array_push($page['infos'], l10n('UAM_Restoration_OK'));
     281        }
     282        else
     283        {
     284          array_push($page['errors'], l10n('UAM_Restoration_NOK'));
     285        }
    277286      }
    278       else
    279       {
    280         array_push($page['errors'], l10n('UAM_Restoration_NOK'));
    281       }
     287      else array_push($page['errors'], l10n('UAM_Bad_version_backup'));
    282288    }
    283289    else
Note: See TracChangeset for help on using the changeset viewer.