Ignore:
Timestamp:
Mar 6, 2010, 7:37:18 PM (14 years ago)
Author:
Eric
Message:

[NBC_UserAdvManager] Pre-2.14.0

  • Changing next version. It'll be a full version upgrade
  • Improving database upgrade process
  • Bug 1308 re-fixed
  • Bug 1392 fixed
  • Bug 1466 fixed
  • Bug 1485 fixed
  • Update of language files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/include/functions.inc.php

    r5056 r5064  
    77{
    88  /* Only available for next Piwigo release (bug in switch_lang function) */
    9   //global $conf;
    10  
    11   /* ****************************************************************** */
    12   /* Delete this after new Piwigo release (bug in switch_lang function) */
    13   global $conf, $user;
    14   $save_user = $user;
    15   /* ****************************************************************** */
     9  global $conf;
    1610
    1711  $conf_UAM = unserialize($conf['nbc_UserAdvManager']);
     
    122116
    123117/* Switching back to default language */
    124   /* ****************************************************************** */
    125   /* Delete this after new Piwigo release (bug in switch_lang function) */
    126 $user=$save_user ;
    127   /* ****************************************************************** */
    128118switch_lang_back();
    129119}
     
    134124{
    135125  /* Only available for next Piwigo release (bug in switch_lang function) */
    136   //global $conf;
    137  
    138   /* ****************************************************************** */
    139   /* Delete this after new Piwigo release (bug in switch_lang function) */
    140   global $conf, $user;
    141   $save_user = $user;
    142   /* ****************************************************************** */
     126  global $conf;
    143127
    144128  $conf_UAM = unserialize($conf['nbc_UserAdvManager']);
     
    234218
    235219/* Switching back to default language */
    236   /* ****************************************************************** */
    237   /* Delete this after new Piwigo release (bug in switch_lang function) */
    238 $user=$save_user ;
    239   /* ****************************************************************** */
    240220switch_lang_back();
    241221}
     
    246226{
    247227  /* Only available for next Piwigo release (bug in switch_lang function) */
    248   //global $conf;
    249  
    250   /* ****************************************************************** */
    251   /* Delete this after new Piwigo release (bug in switch_lang function) */
    252   global $conf, $user;
    253   $save_user = $user;
    254   /* ****************************************************************** */
     228  global $conf;
    255229
    256230  $conf_UAM = unserialize($conf['nbc_UserAdvManager']);
     
    306280
    307281/* Switching back to default language */
    308   /* ****************************************************************** */
    309   /* Delete this after new Piwigo release (bug in switch_lang function) */
    310 $user=$save_user ;
    311   /* ****************************************************************** */
    312282switch_lang_back();
    313283}
     
    500470
    501471/*              Time limit process              */
    502 /* ****************** begin ******************* */ 
     472/* ******************************************** */ 
    503473      if (!empty($registration_date))
    504474      {
     
    985955
    986956/*              Time limit process              */
    987 /* ****************** begin ******************* */ 
     957/* ******************************************** */ 
    988958        if (!empty($registration_date))
    989959  {
     
    11061076   fwrite($fo, 'Langue : '."\n" . $language . "\r\n") ;
    11071077   fclose($fo) ;
    1108  //return mail ($to,$subject) ;
     1078   //return mail ($to,$subject) ;
    11091079}
    11101080
     
    11551125}
    11561126
    1157 /* Funtion called in maintain.inc.php to clean obsolete files */
    1158 function clean_obsolete_files($obsolete_file_list)
    1159 {
    1160   if (!file_exists(NBC_UAM_PATH.$obsolete_file_list))
    1161   {
    1162     return TRUE;
    1163   }
    1164   $obsolete = file(NBC_UAM_PATH.$obsolete_file_list);
    1165   array_push($obsolete, $obsolete_file_list);
    1166   return clean_obsolete_list($obsolete);
    1167 }
    1168 
    1169 function clean_obsolete_list($file_list = array(), &$errors = array())
    1170 {
    1171   if (!function_exists('unlink'))
    1172   {
    1173       // No unlink available...
    1174       array_push($errors, l10n('uam_no_unlink'));
    1175       return FALSE;
    1176   }
    1177   $success = TRUE;
    1178   foreach ($file_list as $file)
    1179   {
    1180     $file = NBC_UAM_PATH . $file;
    1181   $to = '';
    1182   $subject ='';
    1183   $language = '';
    1184   MailLog  ($to, $subject, $file, $language);
    1185     //if (file_exists($file))
    1186     //{
    1187       // Remove obsolete file
    1188       $success &= unlink($file);
    1189   $to = '';
    1190   $subject ='';
    1191   $language = '';
    1192   MailLog  ($to, $subject, $file, $success);
    1193     //}
    1194   }
    1195   if (!$success)
    1196   {
    1197       array_push($errors, l10n('uam_unlink_errors'));
    1198   }
    1199   return $success;
     1127
     1128function clean_obsolete_files()
     1129{
     1130  if (file_exists(NBC_UAM_PATH.'obsolete.list')
     1131    and $old_files = file(NBC_UAM_PATH.'obsolete.list', FILE_IGNORE_NEW_LINES)
     1132    and !empty($old_files))
     1133  {
     1134    array_push($old_files, 'obsolete.list');
     1135    foreach($old_files as $old_file)
     1136    {
     1137      $path = NBC_UAM_PATH.$old_file;
     1138      if (is_file($path))
     1139      {
     1140        @unlink($path);
     1141      }
     1142    }
     1143  }
    12001144}
    12011145?>
Note: See TracChangeset for help on using the changeset viewer.