Changeset 5064 for extensions/NBC_UserAdvManager/trunk
- Timestamp:
- Mar 6, 2010, 7:37:18 PM (15 years ago)
- Location:
- extensions/NBC_UserAdvManager/trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php
r5056 r5064 95 95 case 'global': 96 96 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'])) 98 98 { 99 99 … … 158 158 $_POST['UAM_GhostTracker_DayLimit'], 159 159 $_POST['UAM_GhostTracker_ReminderText'], 160 $_POST['UAM_Add_LastVisit_Column']); 160 $_POST['UAM_Add_LastVisit_Column'], 161 $_POST['UAM_Admin_ConfMail']); 161 162 162 163 $conf['nbc_UserAdvManager'] = serialize($newconf_UAM); … … 362 363 'UAM_ADDLASTVISIT_TRUE' => $conf_UAM[20]=='true' ? 'checked="checked"' : '' , 363 364 '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"' : '' , 364 367 'UAM_PASSWORD_TEST_SCORE' => $UAM_Password_Test_Score, 365 368 'UAM_ERROR_REPORTS1' => $UAM_MailInfo_Error_Txt, -
extensions/NBC_UserAdvManager/trunk/admin/global.tpl
r5056 r5064 138 138 139 139 <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> 140 144 {if $UAM_CONFIRM_MAIL_TRUE} 141 145 {if $UAM_ERROR_REPORTS2} -
extensions/NBC_UserAdvManager/trunk/changelog.txt.php
r4986 r5064 3 3 Plugin Name: NBC_UserAdvManager 4 4 ** Change log ** 5 *************************************** 5 6 ***** Plugin history (branch 2.10)***** 7 *************************************** 6 8 7 9 -- 2.10.0-beta : Initial beta release for Piwigo compatibility … … 67 69 68 70 71 *************************************** 69 72 ***** Plugin history (branch 2.12)***** 73 *************************************** 70 74 71 75 -- 2.12.0 : Bug 1206 fixed : All plugin functionnalities work in user's profile page … … 100 104 101 105 106 *************************************** 102 107 ***** Plugin history (branch 2.13)***** 108 *************************************** 103 109 104 110 -- 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. … … 123 129 124 130 -- 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 f rist 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. 126 132 Bug 1444 fixed 127 133 Bug 1445 fixed - The plugin's administration panel have been all reviewed and improved with text simplification and display enhancement. … … 129 135 130 136 *** 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" 131 151 */ 132 152 ?> -
extensions/NBC_UserAdvManager/trunk/include/functions.inc.php
r5056 r5064 7 7 { 8 8 /* 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; 16 10 17 11 $conf_UAM = unserialize($conf['nbc_UserAdvManager']); … … 122 116 123 117 /* Switching back to default language */ 124 /* ****************************************************************** */125 /* Delete this after new Piwigo release (bug in switch_lang function) */126 $user=$save_user ;127 /* ****************************************************************** */128 118 switch_lang_back(); 129 119 } … … 134 124 { 135 125 /* 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; 143 127 144 128 $conf_UAM = unserialize($conf['nbc_UserAdvManager']); … … 234 218 235 219 /* Switching back to default language */ 236 /* ****************************************************************** */237 /* Delete this after new Piwigo release (bug in switch_lang function) */238 $user=$save_user ;239 /* ****************************************************************** */240 220 switch_lang_back(); 241 221 } … … 246 226 { 247 227 /* 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; 255 229 256 230 $conf_UAM = unserialize($conf['nbc_UserAdvManager']); … … 306 280 307 281 /* Switching back to default language */ 308 /* ****************************************************************** */309 /* Delete this after new Piwigo release (bug in switch_lang function) */310 $user=$save_user ;311 /* ****************************************************************** */312 282 switch_lang_back(); 313 283 } … … 500 470 501 471 /* Time limit process */ 502 /* ****************** begin******************* */472 /* ******************************************** */ 503 473 if (!empty($registration_date)) 504 474 { … … 985 955 986 956 /* Time limit process */ 987 /* ****************** begin******************* */957 /* ******************************************** */ 988 958 if (!empty($registration_date)) 989 959 { … … 1106 1076 fwrite($fo, 'Langue : '."\n" . $language . "\r\n") ; 1107 1077 fclose($fo) ; 1108 //return mail ($to,$subject) ;1078 //return mail ($to,$subject) ; 1109 1079 } 1110 1080 … … 1155 1125 } 1156 1126 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 1128 function 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 } 1200 1144 } 1201 1145 ?> -
extensions/NBC_UserAdvManager/trunk/language/de_DE/help/plugin.lang.php
r4987 r5064 136 136 <br> 137 137 - 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ätigung der Anmeldung für Administratoren'; 142 $lang['UAM_adminconfmailTitle_d'] = 'Sie können diese Validierung deaktivieren nur für Benutzer-Accounts durch den Administrator über Piwigo\'s Benutzer-Management-Schnittstelle geschaffen.<br><br> 143 Bei Aktivierung dieser Option, E-Mail-Bestätigung für die Registrierung wird für jeden Benutzer vom Administrator erstellt wurde gesendet werden.<br><br> 144 Durch die Deaktivierung dieser Option (Standard), nur die E-Mail-Informationen gesendet werden (wenn "Informations-E-Mail an Benutzer" aktiviert ist).'; 145 // --------- End: New or revised $lang ---- from version 2.14.0 138 146 ?> -
extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php
r5056 r5064 263 263 $lang['Err_Userlist_Settings'] = 'Diese Seite ist nur verfügbar, wenn "Monitoring registrierte Benutzer" ist aktiv in der "Einstellung der Registrierung durchgeführt und andere Optionen"'; 264 264 // --------- 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 265 272 ?> -
extensions/NBC_UserAdvManager/trunk/language/en_UK/help/plugin.lang.php
r4987 r5064 136 136 <br> 137 137 - 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> 143 By activating this option, email validation for registration will be sent to each user created by admin.<br><br> 144 By disabling this option (default), only the email information is sent (if "Information email to user" is enabled).'; 145 // --------- End: New or revised $lang ---- from version 2.14.0 138 146 ?> -
extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php
r5056 r5064 263 263 $lang['Err_Userlist_Settings'] = 'This page is available only if "Monitoring registered users" is active in the "Setting the registrations followed and other options".'; 264 264 // --------- 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 265 272 ?> -
extensions/NBC_UserAdvManager/trunk/language/es_ES/help/plugin.lang.php
r4987 r5064 136 136 <br> 137 137 - 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ón de registro por los administradores'; 142 $lang['UAM_adminconfmailTitle_d'] = 'Puede desactivar esta validación sólo para las cuentas de usuario creadas por el administrador de Piwigo a través de la interfaz de gestión de los usuarios.<br><br> 143 Al activar esta opción, la validación del email de registro será enviado a cada usuario creado por el administrador.<br><br> 144 Al deshabilitar esta opción (por defecto), sólo la información que se envíe (si "Información por correo electrónico para el usuario" está activado).'; 145 // --------- End: New or revised $lang ---- from version 2.14.0 138 146 ?> -
extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php
r5056 r5064 263 263 $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".'; 264 264 // --------- 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 265 272 ?> -
extensions/NBC_UserAdvManager/trunk/language/fr_FR/help/plugin.lang.php
r4987 r5064 133 133 <br> 134 134 - 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 "joker" 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> 140 En activant cette option, l\'email de validation d\'inscription sera envoyé à chaque utilisateur créé par l\'admin.<br><br> 141 En désactivant cette option (mode par défaut), seul l\'email d\'information est envoyé (si la fonction "Email d\'information à l\'utilisateur" est activée).'; 142 // --------- End: New or revised $lang ---- from version 2.14.0 135 143 ?> -
extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php
r5056 r5064 263 263 $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".'; 264 264 // --------- 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 265 272 ?> -
extensions/NBC_UserAdvManager/trunk/language/it_IT/help/plugin.lang.php
r4988 r5064 136 136 <br> 137 137 - 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'] = 'È possibile disattivare la convalida solo per gli account utente creato dall\'amministratore Piwigo tramite l\'interfaccia di gestione di utenti.<br><br> 143 Attivando questa opzione, la convalida e-mail di registrazione verrà inviato ad ogni utente creato da admin.<br><br> 144 Disabilitando questa opzione ((predefinito)), solo le informazioni e-mail viene inviata (se "E-mail informazioni per l\'utente" è abilitato).'; 145 // --------- End: New or revised $lang ---- from version 2.14.0 138 146 ?> -
extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php
r5056 r5064 263 263 $lang['Err_Userlist_Settings'] = 'Questa pagina è disponibile solo se "Controllo di utenti registrati" è attiva nella sezione "Impostazione delle registrazioni seguiti e altre opzioni".'; 264 264 // --------- 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 265 272 ?> -
extensions/NBC_UserAdvManager/trunk/main.inc.php
r5056 r5064 2 2 /* 3 3 Plugin Name: NBC UserAdvManager 4 Version: 2.1 3.54 Version: 2.14.0 5 5 Description: Renforcer la gestion des utilisateurs - Enforce users management 6 6 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216 … … 119 119 120 120 /* 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 { 123 135 $passwd = (isset($_POST['password'])) ? $_POST['password'] : ''; 124 136 SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true); 125 }126 }127 137 } 138 } 139 } 128 140 129 141 -
extensions/NBC_UserAdvManager/trunk/maintain.inc.php
r5056 r5064 8 8 include_once (NBC_UAM_PATH.'include/constants.php'); 9 9 include_once (NBC_UAM_PATH.'include/functions.inc.php'); 10 10 11 11 12 function plugin_install() … … 21 22 Best regards, 22 23 23 The admin of the gallery.','false' );24 The admin of the gallery.','false','false'); 24 25 25 26 $q = ' … … 28 29 ;'; 29 30 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 44 32 45 33 $default2 = array('false',5,'Hello. … … 59 47 pwg_query($q); 60 48 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);*/75 49 76 50 $q = " … … 98 72 } 99 73 74 100 75 function plugin_activate() 101 76 { 102 77 global $conf; 103 78 104 79 /* Cleaning obsolete files */ 105 update_files($plugin_id); 80 /* *********************** */ 81 clean_obsolete_files(); 106 82 107 83 108 84 /* Check for upgrade from 2.10 to 2.11 */ 109 $query = ' 85 /* *********************************** */ 86 $query = ' 110 87 SELECT * 111 88 FROM '.CONFIG_TABLE.' … … 116 93 if ($count == 0) 117 94 { 118 /* upgrade from branch 2.10 to 2.11 */ 95 /* upgrade from branch 2.10 to 2.11 */ 96 /* ******************************** */ 119 97 upgrade_210(); 120 98 } … … 122 100 123 101 /* Check for upgrade from 2.11 to 2.12 */ 102 /* *********************************** */ 124 103 if (!table_exist(USER_LASTVISIT_TABLE)) 125 104 { 126 /* upgrade from branch 2.11 to 2.12 */ 105 /* upgrade from branch 2.11 to 2.12 */ 106 /* ******************************** */ 127 107 upgrade_211(); 128 108 } … … 130 110 131 111 /* Check for upgrade from 2.12 to 2.13 */ 112 /* *********************************** */ 132 113 $query = ' 133 114 SELECT * … … 141 122 if ($numfields < 6) 142 123 { 143 /* upgrade from branch 2.12 to 2.13 */ 124 /* upgrade from branch 2.12 to 2.13 */ 125 /* ******************************** */ 144 126 upgrade_212(); 145 127 } 146 128 147 129 148 /* Serializing conf parameters - Available since 2.13.5 */ 130 /* Serializing conf parameters - Available since 2.14.0 */ 131 /* **************************************************** */ 149 132 if (unserialize($conf['nbc_UserAdvManager']) === false) 150 133 { 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(); 171 137 } 172 138 } … … 205 171 206 172 173 // +----------------------------------------------------------+ 174 // | Upgrading database from old plugin versions | 175 // +----------------------------------------------------------+ 176 207 177 /* upgrade from branch 2.10 to 2.11 */ 178 /* ******************************** */ 208 179 function upgrade_210() 209 180 { … … 229 200 230 201 /* upgrade from branch 2.11 to 2.12 */ 202 /* ******************************** */ 231 203 function upgrade_211() 232 204 { … … 271 243 272 244 /* upgrade from branch 2.12 to 2.13 */ 245 /* ******************************** */ 273 246 function upgrade_212() 274 247 { … … 297 270 ;'; 298 271 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 /* ******************************** */ 280 function upgrade_213() 281 { 282 $data = explode(';', $conf['nbc_UserAdvManager']); 283 284 $query = ' 285 UPDATE '.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 = ' 296 UPDATE '.CONFIG_TABLE.' 297 SET value = "'.addslashes(serialize($data)).'" 298 WHERE param = "nbc_UserAdvManager_ConfirmMail" 299 ;'; 300 pwg_query($query); 301 } 305 302 } 306 303 ?>
Note: See TracChangeset
for help on using the changeset viewer.