Changeset 5064


Ignore:
Timestamp:
03/06/10 19:37:18 (10 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
Location:
extensions/NBC_UserAdvManager/trunk
Files:
16 edited

Legend:

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

    r5056 r5064  
    9595  case 'global': 
    9696 
    97         if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_No_Casse']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) and isset($_POST['UAM_No_Comment_Anonymous']) and isset($_POST['UAM_Password_Enforced']) and isset($_POST['UAM_AdminPassword_Enforced']) and isset($_POST['UAM_GhostUser_Tracker'])) 
     97        if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_No_Casse']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) and isset($_POST['UAM_No_Comment_Anonymous']) and isset($_POST['UAM_Password_Enforced']) and isset($_POST['UAM_AdminPassword_Enforced']) and isset($_POST['UAM_GhostUser_Tracker']) and isset($_POST['UAM_Admin_ConfMail'])) 
    9898  { 
    9999 
     
    158158      $_POST['UAM_GhostTracker_DayLimit'], 
    159159      $_POST['UAM_GhostTracker_ReminderText'], 
    160       $_POST['UAM_Add_LastVisit_Column']); 
     160      $_POST['UAM_Add_LastVisit_Column'], 
     161      $_POST['UAM_Admin_ConfMail']); 
    161162 
    162163    $conf['nbc_UserAdvManager'] = serialize($newconf_UAM); 
     
    362363    'UAM_ADDLASTVISIT_TRUE'          => $conf_UAM[20]=='true' ?  'checked="checked"' : '' , 
    363364    'UAM_ADDLASTVISIT_FALSE'         => $conf_UAM[20]=='false' ?  'checked="checked"' : '' , 
     365    'UAM_ADMINCONFMAIL_TRUE'         => $conf_UAM[21]=='true' ?  'checked="checked"' : '' , 
     366    'UAM_ADMINCONFMAIL_FALSE'        => $conf_UAM[21]=='false' ?  'checked="checked"' : '' , 
    364367                'UAM_PASSWORD_TEST_SCORE'        => $UAM_Password_Test_Score, 
    365368    'UAM_ERROR_REPORTS1'             => $UAM_MailInfo_Error_Txt, 
  • extensions/NBC_UserAdvManager/trunk/admin/global.tpl

    r5056 r5064  
    138138 
    139139        <ul> 
     140          <li><label class="cluetip" title="{'UAM_adminconfmailTitle'|translate}|{'UAM_adminconfmailTitle_d'|translate}">{'UAM_AdminConfMail'|@translate}</label><br><br> 
     141            <input type="radio" value="false" {$UAM_ADMINCONFMAIL_FALSE} name="UAM_Admin_ConfMail">{'UAM_Admin_ConfMail_false'|@translate}<br> 
     142            <input type="radio" value="true" {$UAM_ADMINCONFMAIL_TRUE} name="UAM_Admin_ConfMail">{'UAM_Admin_ConfMail_true'|@translate}<br><br> 
     143          </li> 
    140144{if $UAM_CONFIRM_MAIL_TRUE} 
    141145  {if $UAM_ERROR_REPORTS2}      
  • extensions/NBC_UserAdvManager/trunk/changelog.txt.php

    r4986 r5064  
    33Plugin Name: NBC_UserAdvManager 
    44** Change log ** 
     5*************************************** 
    56***** Plugin history (branch 2.10)***** 
     7*************************************** 
    68 
    79-- 2.10.0-beta : Initial beta release for Piwigo compatibility 
     
    6769 
    6870 
     71*************************************** 
    6972***** Plugin history (branch 2.12)***** 
     73*************************************** 
    7074 
    7175-- 2.12.0 : Bug 1206 fixed : All plugin functionnalities work in user's profile page 
     
    100104 
    101105 
     106*************************************** 
    102107***** Plugin history (branch 2.13)***** 
     108*************************************** 
    103109  
    104110-- 2.13.0 : Bug 1246 fixed - Extended Description tags are working again ! Caution : The language used and saved in database is the one configured by default in the visitor's browser and not the language given by Language Switch. 
     
    123129 
    124130-- 2.13.4 : Add of obsolete files management 
    125             Bug 1303 and 1387 fixed - Due to a bug in Piwigo's 2.0.8 switch_lang() function, the email contents using Extended Description tags wasn't taking user's language in account. A frist fix is now set for the current 2.0.8 Piwigo's version and another one is ready to work for the next Piwigo's release. 
     131            Bug 1303 and 1387 fixed - Due to a bug in Piwigo's 2.0.8 switch_lang() function, the email contents using Extended Description tags wasn't taking user's language in account. A first fix is now set for the current 2.0.8 Piwigo's version and another one is ready to work for the next Piwigo's release. 
    126132            Bug 1444 fixed 
    127133            Bug 1445 fixed - The plugin's administration panel have been all reviewed and improved with text simplification and display enhancement. 
     
    129135             
    130136            *** Feature temporarily postponed in a later version due to problems with ";" in text fields *** Add compatibility with FCK Editor plugin for email text fields 
     137 
     138 
     139*************************************** 
     140***** Plugin history (branch 2.14)***** 
     141*************************************** 
     142 
     143-- 2.14.0 : Bug 1308 refixed - Piwigo 2.0.9 fixes the bug on switch_lang() function so the initial UAM fix is no longer needed  
     144            Evolution 1392 - No more confirmation email for admins profile changing  
     145            Evolution 1465 - Plugin's configuration data are now serialized in database 
     146            Bug 1466 fixed - The plugin version is correctly displayed on Ghost Tracker tab 
     147            Bug 1468 fixed - Java error (thx to cljosse) 
     148            Evolution 1485 - The admin's can choose if the validation of registration have to be sent to users created by them 
     149            Improving obsolete files cleaning 
     150            Code simplification - All variables are changed from "UserAdvManager" to "UAM" 
    131151*/ 
    132152?> 
  • 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?> 
  • extensions/NBC_UserAdvManager/trunk/language/de_DE/help/plugin.lang.php

    r4987 r5064  
    136136<br> 
    137137- Generieren Sie per E-Mail-Erinnerung <b>mit dem Zurücksetzen der letzte Besuch date</b>. Dies erlaubt es, einen Platzhalter, um die angestrebten Besucher geben. Wenn der Besucher bereits eine Mahnung erhalten haben, durch nichts daran gehindert, eine neue Mail, die wieder zurückgesetzt werden, in der Tat übel, dem letzten Tag besuchen.'; 
     138 
     139 
     140// --------- Starting below: New or revised $lang ---- from version 2.14.0 
     141$lang['UAM_adminconfmailTitle'] = 'Best&auml;tigung der Anmeldung f&uuml;r Administratoren'; 
     142$lang['UAM_adminconfmailTitle_d'] = 'Sie k&ouml;nnen diese Validierung deaktivieren nur f&uuml;r Benutzer-Accounts durch den Administrator &uuml;ber Piwigo\'s Benutzer-Management-Schnittstelle geschaffen.<br><br> 
     143Bei Aktivierung dieser Option, E-Mail-Best&auml;tigung f&uuml;r die Registrierung wird f&uuml;r jeden Benutzer vom Administrator erstellt wurde gesendet werden.<br><br> 
     144Durch die Deaktivierung dieser Option (Standard), nur die E-Mail-Informationen gesendet werden (wenn &quot;Informations-E-Mail an Benutzer&quot; aktiviert ist).'; 
     145// --------- End: New or revised $lang ---- from version 2.14.0 
    138146?> 
  • extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php

    r5056 r5064  
    263263$lang['Err_Userlist_Settings'] = 'Diese Seite ist nur verfügbar, wenn &quot;Monitoring registrierte Benutzer&quot; ist aktiv in der &quot;Einstellung der Registrierung durchgeführt und andere Optionen&quot;'; 
    264264// --------- End: New or revised $lang ---- from version 2.13.4 
     265 
     266 
     267// --------- Starting below: New or revised $lang ---- from version 2.14.0 
     268$lang['UAM_AdminConfMail'] = 'Bestätigung der Anmeldung für Administratoren'; 
     269$lang['UAM_Admin_ConfMail_true'] = ' Aktivieren'; 
     270$lang['UAM_Admin_ConfMail_false'] = '  Deaktivieren (Standard)'; 
     271// --------- End: New or revised $lang ---- from version 2.14.0 
    265272?> 
  • extensions/NBC_UserAdvManager/trunk/language/en_UK/help/plugin.lang.php

    r4987 r5064  
    136136<br> 
    137137- Generate email reminder <b>with resetting the last visit date</b>. This allows to give a wildcard to targeted visitors. If the visitor has already received a reminder, nothing prevents to resent a new mail which will reset again, in fact, the last visit date.'; 
     138 
     139 
     140// --------- Starting below: New or revised $lang ---- from version 2.14.0 
     141$lang['UAM_adminconfmailTitle'] = 'Confirmation of registration for admins'; 
     142$lang['UAM_adminconfmailTitle_d'] = 'You can disable this validation only for user accounts created by the administrator via Piwigo\'s users management interface.<br><br> 
     143By activating this option, email validation for registration will be sent to each user created by admin.<br><br> 
     144By disabling this option (default), only the email information is sent (if &quot;Information email to user&quot; is enabled).'; 
     145// --------- End: New or revised $lang ---- from version 2.14.0 
    138146?> 
  • extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php

    r5056 r5064  
    263263$lang['Err_Userlist_Settings'] = 'This page is available only if "Monitoring registered users" is active in the "Setting the registrations followed and other options".'; 
    264264// --------- End: New or revised $lang ---- from version 2.13.4 
     265 
     266 
     267// --------- Starting below: New or revised $lang ---- from version 2.14.0 
     268$lang['UAM_AdminConfMail'] = 'Confirmation of registration for admins'; 
     269$lang['UAM_Admin_ConfMail_true'] = ' Enable'; 
     270$lang['UAM_Admin_ConfMail_false'] = ' Disable (default)'; 
     271// --------- End: New or revised $lang ---- from version 2.14.0 
    265272?> 
  • extensions/NBC_UserAdvManager/trunk/language/es_ES/help/plugin.lang.php

    r4987 r5064  
    136136<br> 
    137137- Generar recordatorio por correo electrónico <b>con el cambio de la fecha última visita</b>. Esto permite dar un comodín a los visitantes específicos. Si el visitante ya ha recibido un recordatorio, nada impide a resentir un nuevo correo que se restablecerá de nuevo, de hecho, la fecha de la última visita.'; 
     138 
     139 
     140// --------- Starting below: New or revised $lang ---- from version 2.14.0 
     141$lang['UAM_adminconfmailTitle'] = 'Confirmaci&oacute;n de registro por los administradores'; 
     142$lang['UAM_adminconfmailTitle_d'] = 'Puede desactivar esta validaci&oacute;n s&oacute;lo para las cuentas de usuario creadas por el administrador de Piwigo a trav&eacute;s de la interfaz de gesti&oacute;n de los usuarios.<br><br> 
     143Al activar esta opci&oacute;n, la validaci&oacute;n del email de registro ser&aacute; enviado a cada usuario creado por el administrador.<br><br> 
     144Al deshabilitar esta opci&oacute;n (por defecto), s&oacute;lo la informaci&oacute;n que se env&iacute;e (si &quot;Informaci&oacute;n por correo electr&oacute;nico para el usuario&quot; est&aacute; activado).'; 
     145// --------- End: New or revised $lang ---- from version 2.14.0 
    138146?> 
  • extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php

    r5056 r5064  
    263263$lang['Err_Userlist_Settings'] = 'Esta página está disponible sólo si "Seguimiento de los usuarios registrados" está activo en la "Configuración de los registros seguido y otras opciones".'; 
    264264// --------- End: New or revised $lang ---- from version 2.13.4 
     265 
     266 
     267// --------- Starting below: New or revised $lang ---- from version 2.14.0 
     268$lang['UAM_AdminConfMail'] = 'Confirmación de registro por los administradores'; 
     269$lang['UAM_Admin_ConfMail_true'] = ' Activar'; 
     270$lang['UAM_Admin_ConfMail_false'] = ' Desactivar (por defecto)'; 
     271// --------- End: New or revised $lang ---- from version 2.14.0 
    265272?> 
  • extensions/NBC_UserAdvManager/trunk/language/fr_FR/help/plugin.lang.php

    r4987 r5064  
    133133<br> 
    134134- Générer l\'email de rappel <b>avec réinitialisation de la date de dernière visite</b>. Ce qui permet de donner un &quot;joker&quot; au visiteur ciblé. Si le visiteur a déjà bénéficié d\'un mail de rappel, rien n\'empêche de renvoyer un nouveau mail qui réinitialisera, de fait, la date de dernière visite.'; 
     135 
     136 
     137// --------- Starting below: New or revised $lang ---- from version 2.14.0 
     138$lang['UAM_adminconfmailTitle'] = 'Validation d\'inscription pour les admins'; 
     139$lang['UAM_adminconfmailTitle_d'] = 'On peut ici désactiver la validation des inscriptions uniquement pour les comptes d\'utilisateurs créés par l\'administrateur via l\'interface de gestion des utilisateurs de Piwigo.<br><br> 
     140En activant cette option, l\'email de validation d\'inscription sera envoyé à chaque utilisateur créé par l\'admin.<br><br> 
     141En désactivant cette option (mode par défaut), seul l\'email d\'information est envoyé (si la fonction &quot;Email d\'information &agrave; l\'utilisateur&quot; est activée).'; 
     142// --------- End: New or revised $lang ---- from version 2.14.0 
    135143?> 
  • extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php

    r5056 r5064  
    263263$lang['Err_Userlist_Settings'] = 'Cette page n\'est accessible que si le "Suivi des utilisateurs inscrits" est actif dans "Paramétrage des suivis des inscrits et autres options".'; 
    264264// --------- End: New or revised $lang ---- from version 2.13.4 
     265 
     266 
     267// --------- Starting below: New or revised $lang ---- from version 2.14.0 
     268$lang['UAM_AdminConfMail'] = 'Validation d\'inscription pour les admins'; 
     269$lang['UAM_Admin_ConfMail_true'] = ' Activer'; 
     270$lang['UAM_Admin_ConfMail_false'] = ' Désactiver (valeur par défaut)'; 
     271// --------- End: New or revised $lang ---- from version 2.14.0 
    265272?> 
  • extensions/NBC_UserAdvManager/trunk/language/it_IT/help/plugin.lang.php

    r4988 r5064  
    136136<br> 
    137137- Generate email reminder <b>with resetting the last visit date</b>. This allows to give a wildcard to targeted visitors. If the visitor has already received a reminder, nothing prevents to resent a new mail which will reset again, in fact, the last visit date.'; 
     138 
     139 
     140// --------- Starting below: New or revised $lang ---- from version 2.14.0 
     141$lang['UAM_adminconfmailTitle'] = 'Conferma della registrazione per gli amministratori'; 
     142$lang['UAM_adminconfmailTitle_d'] = '&Egrave; possibile disattivare la convalida solo per gli account utente creato dall\'amministratore Piwigo tramite l\'interfaccia di gestione di utenti.<br><br> 
     143Attivando questa opzione, la convalida e-mail di registrazione verr&agrave; inviato ad ogni utente creato da admin.<br><br> 
     144Disabilitando questa opzione ((predefinito)), solo le informazioni e-mail viene inviata (se &quot;E-mail informazioni per l\'utente&quot; &egrave; abilitato).'; 
     145// --------- End: New or revised $lang ---- from version 2.14.0 
    138146?> 
  • extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php

    r5056 r5064  
    263263$lang['Err_Userlist_Settings'] = 'Questa pagina è disponibile solo se "Controllo di utenti registrati" è attiva nella sezione "Impostazione delle registrazioni seguiti e altre opzioni".'; 
    264264// --------- End: New or revised $lang ---- from version 2.13.4 
     265 
     266 
     267// --------- Starting below: New or revised $lang ---- from version 2.14.0 
     268$lang['UAM_AdminConfMail'] = 'Conferma della registrazione per gli amministratori'; 
     269$lang['UAM_Admin_ConfMail_true'] = ' Consentire'; 
     270$lang['UAM_Admin_ConfMail_false'] = ' Disattivare (predefinito)'; 
     271// --------- End: New or revised $lang ---- from version 2.14.0 
    265272?> 
  • extensions/NBC_UserAdvManager/trunk/main.inc.php

    r5056 r5064  
    22/* 
    33Plugin Name: NBC UserAdvManager 
    4 Version: 2.13.5 
     4Version: 2.14.0 
    55Description: Renforcer la gestion des utilisateurs - Enforce users management 
    66Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216 
     
    119119   
    120120  /* Sending registration confirmation by email */ 
    121   if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true' and !is_admin()) or (isset($conf_UAM[2]) and $conf_UAM[2] == 'true' and !is_admin())) 
    122   { 
     121  if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[2]) and $conf_UAM[2] == 'true')) 
     122  { 
     123    if (is_admin() and isset($conf_UAM[21]) and $conf_UAM[21] == 'true') 
     124    { 
     125    $passwd = (isset($_POST['password'])) ? $_POST['password'] : ''; 
     126    SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);  
     127    } 
     128    elseif (is_admin() and isset($conf_UAM[21]) and $conf_UAM[21] == 'false') 
     129    { 
     130    $passwd = (isset($_POST['password'])) ? $_POST['password'] : ''; 
     131    SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false); 
     132    } 
     133    elseif (!is_admin()) 
     134    { 
    123135    $passwd = (isset($_POST['password'])) ? $_POST['password'] : ''; 
    124136    SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true); 
    125   } 
    126 } 
    127  
     137    } 
     138  } 
     139} 
    128140 
    129141 
  • extensions/NBC_UserAdvManager/trunk/maintain.inc.php

    r5056 r5064  
    88include_once (NBC_UAM_PATH.'include/constants.php'); 
    99include_once (NBC_UAM_PATH.'include/functions.inc.php'); 
     10 
    1011 
    1112function plugin_install() 
     
    2122Best regards, 
    2223 
    23 The admin of the gallery.','false'); 
     24The admin of the gallery.','false','false'); 
    2425 
    2526  $q = ' 
     
    2829  ;'; 
    2930  pwg_query($q); 
    30    
    31 /*  $q = ' 
    32 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 
    33 VALUES ("nbc_UserAdvManager","false;false;false;-1;-1;-1;false;false;;-1;;;false;;false;100;false;false;10;Hello. 
    34          
    35 This is a reminder because a very long time passed since your last visit on our gallery. If you do not want anymore to use your access account, please let us know by replying to this email. Your account will be deleted. 
    36  
    37 On receipt of this message and no new visit within 15 days, we would be obliged to automatically delete your account. 
    38  
    39 Best regards, 
    40  
    41 The admin of the gallery.;false","Parametres du plugin nbc UserAdvManager") 
    42   ;'; 
    43   pwg_query($q);*/ 
     31 
    4432 
    4533  $default2 = array('false',5,'Hello. 
     
    5947  pwg_query($q); 
    6048 
    61  
    62 /*  $q = ' 
    63 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 
    64 VALUES ("nbc_UserAdvManager_ConfirmMail","false;5;Hello. 
    65                  
    66 This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key has expired. To still allow you to access to our gallery, your validation period has been reset. You have again 5 days to validate your registration. 
    67  
    68 Note: After this period, your account will be permanently deleted.;false;Hello. 
    69  
    70 This is a reminder message because you registered on our gallery but you do not validate your registration and your validation key will expire. To allow you access to our gallery, you have 2 days to confirm your registration by clicking on the link in the message you should have received when you registered. 
    71  
    72 Note: After this period, your account will be permanently deleted.","Parametres nbc_UserAdvManager - ConfirmMail") 
    73   ;'; 
    74   pwg_query($q);*/ 
    7549 
    7650        $q = " 
     
    9872} 
    9973 
     74 
    10075function plugin_activate() 
    10176{ 
    102           global $conf; 
     77  global $conf; 
    10378 
    10479/* Cleaning obsolete files */ 
    105     update_files($plugin_id); 
     80/* *********************** */ 
     81  clean_obsolete_files(); 
    10682 
    10783 
    10884/* Check for upgrade from 2.10 to 2.11 */ 
    109           $query = ' 
     85/* *********************************** */ 
     86        $query = ' 
    11087SELECT * 
    11188  FROM '.CONFIG_TABLE.' 
     
    11693        if ($count == 0) 
    11794        { 
    118          /* upgrade from branch 2.10 to 2.11 */ 
     95  /* upgrade from branch 2.10 to 2.11 */ 
     96  /* ******************************** */ 
    11997                upgrade_210(); 
    12098        } 
     
    122100 
    123101/* Check for upgrade from 2.11 to 2.12 */ 
     102/* *********************************** */ 
    124103  if (!table_exist(USER_LASTVISIT_TABLE)) 
    125104  { 
    126     /* upgrade from branch 2.11 to 2.12 */ 
     105  /* upgrade from branch 2.11 to 2.12 */ 
     106  /* ******************************** */ 
    127107                upgrade_211(); 
    128108  } 
     
    130110 
    131111/* Check for upgrade from 2.12 to 2.13 */ 
     112/* *********************************** */ 
    132113  $query = ' 
    133114SELECT * 
     
    141122  if ($numfields < 6) 
    142123  { 
    143     /* upgrade from branch 2.12 to 2.13 */ 
     124  /* upgrade from branch 2.12 to 2.13 */ 
     125  /* ******************************** */ 
    144126    upgrade_212(); 
    145127  } 
    146128 
    147129 
    148 /* Serializing conf parameters - Available since 2.13.5 */ 
     130/* Serializing conf parameters - Available since 2.14.0 */ 
     131/* **************************************************** */ 
    149132  if (unserialize($conf['nbc_UserAdvManager']) === false) 
    150133  { 
    151     $data = explode(';', $conf['nbc_UserAdvManager']); 
    152  
    153     $query = ' 
    154 UPDATE '.CONFIG_TABLE.' 
    155   SET value = "'.addslashes(serialize($data)).'" 
    156   WHERE param = "nbc_UserAdvManager" 
    157 ;'; 
    158     pwg_query($query); 
    159   } 
    160    
    161   if (unserialize($conf['nbc_UserAdvManager_ConfirmMail']) === false) 
    162   { 
    163     $data = explode(';', $conf['nbc_UserAdvManager_ConfirmMail']); 
    164  
    165     $query = ' 
    166 UPDATE '.CONFIG_TABLE.' 
    167   SET value = "'.addslashes(serialize($data)).'" 
    168   WHERE param = "nbc_UserAdvManager_ConfirmMail" 
    169 ;'; 
    170     pwg_query($query); 
     134  /* upgrade from branch 2.13 to 2.14 */ 
     135  /* ******************************** */ 
     136    upgrade_213(); 
    171137  } 
    172138} 
     
    205171 
    206172 
     173// +----------------------------------------------------------+ 
     174// |       Upgrading database from old plugin versions        | 
     175// +----------------------------------------------------------+ 
     176 
    207177/* upgrade from branch 2.10 to 2.11 */ 
     178/* ******************************** */ 
    208179function upgrade_210() 
    209180{ 
     
    229200 
    230201/* upgrade from branch 2.11 to 2.12 */ 
     202/* ******************************** */ 
    231203function upgrade_211() 
    232204{ 
     
    271243 
    272244/* upgrade from branch 2.12 to 2.13 */ 
     245/* ******************************** */ 
    273246function upgrade_212() 
    274247{ 
     
    297270;'; 
    298271                pwg_query($query); 
    299   } 
    300 } 
    301  
    302 function update_files($plugin_id) 
    303 { 
    304   $clean = clean_obsolete_files(UAM_OBSOLETE); 
     272     
     273    upgrade_213(); 
     274  } 
     275} 
     276 
     277 
     278/* upgrade from branch 2.13 to 2.14 */ 
     279/* ******************************** */ 
     280function upgrade_213() 
     281{ 
     282  $data = explode(';', $conf['nbc_UserAdvManager']); 
     283 
     284  $query = ' 
     285UPDATE '.CONFIG_TABLE.' 
     286  SET value = "'.addslashes(serialize($data)).'" 
     287  WHERE param = "nbc_UserAdvManager" 
     288;'; 
     289  pwg_query($query); 
     290   
     291  if (unserialize($conf['nbc_UserAdvManager_ConfirmMail']) === false) 
     292  { 
     293    $data = explode(';', $conf['nbc_UserAdvManager_ConfirmMail']); 
     294 
     295    $query = ' 
     296UPDATE '.CONFIG_TABLE.' 
     297  SET value = "'.addslashes(serialize($data)).'" 
     298  WHERE param = "nbc_UserAdvManager_ConfirmMail" 
     299;'; 
     300    pwg_query($query); 
     301  } 
    305302} 
    306303?> 
Note: See TracChangeset for help on using the changeset viewer.