Changeset 6775
- Timestamp:
- Aug 18, 2010, 10:43:18 PM (14 years ago)
- Location:
- extensions/NBC_UserAdvManager/trunk
- Files:
-
- 1 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php
r6754 r6775 101 101 case 'global': 102 102 103 if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UAM_Mail_Info']) 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']) )103 if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UAM_Mail_Info']) 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']) and isset($_POST['UAM_RedirToProfile'])) 104 104 { 105 105 … … 140 140 $_POST['UAM_GhostTracker_ReminderText'], 141 141 $_POST['UAM_Add_LastVisit_Column'], 142 $_POST['UAM_Admin_ConfMail']); 142 $_POST['UAM_Admin_ConfMail'], 143 $_POST['UAM_RedirToProfile']); 143 144 144 145 $conf['UserAdvManager'] = serialize($newconf_UAM); … … 331 332 'UAM_ADMINCONFMAIL_TRUE' => $conf_UAM[20]=='true' ? 'checked="checked"' : '' , 332 333 'UAM_ADMINCONFMAIL_FALSE' => $conf_UAM[20]=='false' ? 'checked="checked"' : '' , 334 'UAM_REDIRTOPROFILE_TRUE' => $conf_UAM[21]=='true' ? 'checked="checked"' : '' , 335 'UAM_REDIRTOPROFILE_FALSE' => $conf_UAM[21]=='false' ? 'checked="checked"' : '' , 333 336 'UAM_PASSWORD_TEST_SCORE' => $UAM_Password_Test_Score, 334 337 'UAM_ERROR_REPORTS4' => $UAM_Exclusionlist_Error, -
extensions/NBC_UserAdvManager/trunk/admin/template/global.tpl
r6754 r6775 497 497 <input type="radio" value="false" {$UAM_NO_COMMENT_ANO_FALSE} name="UAM_No_Comment_Anonymous">{'UAM_No_Comment_Anonymous_false'|@translate}<br> 498 498 <input type="radio" value="true" {$UAM_NO_COMMENT_ANO_TRUE} name="UAM_No_Comment_Anonymous">{'UAM_No_Comment_Anonymous_true'|@translate}<br><br> 499 </li> 500 501 <li><label class="cluetip" title="{'UAM_RedirTitle'|translate}|{'UAM_RedirTitle_d'|translate}">{'UAM_RedirToProfile'|@translate}</label><br><br> 502 <input type="radio" value="false" {$UAM_REDIRTOPROFILE_FALSE} name="UAM_RedirToProfile">{'UAM_RedirToProfile_false'|@translate}<br> 503 <input type="radio" value="true" {$UAM_REDIRTOPROFILE_TRUE} name="UAM_RedirToProfile">{'UAM_RedirToProfile_true'|@translate}<br><br> 499 504 </li> 500 505 </ul> -
extensions/NBC_UserAdvManager/trunk/changelog.txt.php
r6757 r6775 179 179 Bug 1656 fixed - New register validation mode: Manual validation by admin 180 180 Bug 1687 fixed - Login case sensitivity is no more used in this plugin because already set in Piwigo's core 181 Bug 1693 181 Bug 1727 partially fixed - New option to redirect users to profile page after their first login only. 182 Known problem: The redirection doesn't work after registration and after confirmation page (if ConfirmMail is enabled) 183 The redirection applies to already registered users including admins, webmaster and generic status. 182 184 Bug 1789 fixed - Escaping double quotes in text fields 183 185 Bug 1790 fixed - Validation tracking tab is set when correct options are set -
extensions/NBC_UserAdvManager/trunk/include/functions.inc.php
r6757 r6775 498 498 pwg_query($query); 499 499 } 500 501 502 /* Function called from main.inc.php - Triggered on user deletion */ 503 function DeleteRedir($user_id) 504 { 505 $tab = array(); 506 507 $query = " 508 SELECT value 509 FROM ".CONFIG_TABLE." 510 WHERE param = 'UserAdvManager_Redir' 511 ;"; 512 513 $tab = pwg_db_fetch_row(pwg_query($query)); 514 515 $values = explode(',', $tab[0]); 516 517 unset($values[array_search($user_id, $values)]); 518 519 $query = " 520 UPDATE ".CONFIG_TABLE." 521 SET value = \"".implode(',', $values)."\" 522 WHERE param = 'UserAdvManager_Redir';"; 523 524 pwg_query($query); 525 } 526 500 527 501 528 /* Function called from ConfirmMail.php to verify validation key used by user according time limit */ … … 1185 1212 } 1186 1213 } 1214 1215 1216 // check_consult - Thx to LucMorizur 1217 // checks if a user id is registered as having already 1218 // visited his profile.php page. 1219 // @uid : the user id 1220 // @user_idsOK : (returned) array of all users ids having already visited 1221 // their profile.php pages 1222 // 1223 // @returns : true or false whether the users has already visited his 1224 // profile.php page or not 1225 function check_consult($uid, &$user_idsOK) 1226 { 1227 $t = array(); 1228 $v = false; 1229 1230 $query = " 1231 SELECT value 1232 FROM ".CONFIG_TABLE." 1233 WHERE param = 'UserAdvManager_Redir' 1234 ;"; 1235 1236 if ($v = (($t = pwg_db_fetch_row(pwg_query($query))) !== false)) 1237 { 1238 $user_idsOK = explode(',', $t[0]); 1239 $v = (in_array($uid, $user_idsOK)); 1240 } 1241 return $v; 1242 } 1187 1243 ?> -
extensions/NBC_UserAdvManager/trunk/include/upgradedb.inc.php
r6354 r6775 247 247 $Newconf_UAM[19] = $Newconf_UAM[20]; 248 248 $Newconf_UAM[20] = $Newconf_UAM[21]; 249 unset($Newconf_UAM[21]);249 $Newconf_UAM[21] = 'false'; 250 250 251 251 $update_conf = serialize($Newconf_UAM); … … 258 258 ;'; 259 259 260 pwg_query($query); 260 pwg_query($query); 261 262 $query = ' 263 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 264 VALUES ("UserAdvManager_Redir","0","UAM Redirections") 265 ;'; 266 267 pwg_query($query); 261 268 } 262 269 ?> -
extensions/NBC_UserAdvManager/trunk/language/de_DE/help/plugin.lang.php
r6754 r6775 169 169 /*TODO*/$lang['UAM_confirmmailTitle_d'] = 'This option allows a user to either confirm registration by clicking on a link received in an email sent upon registration or the administrator to manually activate the registration.<br><br> 170 170 In first case, the e-mail is composed of a customizable part to introduce a little welcome note and a fixed part containing the activation link that is generated from a random key that can possibly regenerate through the "Tracking validations" tab.<br><br> 171 Dans le premier cas, le message envoyé comprend une partie fixe, avec le lien d\'activation généré à partir d\'une clef aléatoire (cette clé peut éventuellement être régénérée via l\'onglet "Suivi des validations"), et une partie personnalisable par un texte d\'accueil.172 171 <br><br> 173 172 In second case, <b><u>there is no validation key send by email!</u></b>. Visitors have to wait until an administrator validate them himself in "Validation tracking" tab. It\s recommanded to activate the Piwigo\'s option "Email admins when a new user registers" (see in Piwigo\'s configuration options) and to use the "Information email to user" to warn new registers to wait on their account activation. … … 176 175 <br><br> 177 176 Diese Option ist in der Regel mit der automatischen Zuordnung der Gruppe und / oder Satzung verwendet. Zum Beispiel, ein Benutzer, der nicht validiert ihre Eintragung in eine bestimmte Gruppe von Nutzern eingestellt werden (mit oder ohne Einschränkungen auf der Galerie), während ein Benutzer, der seine Registrierung bestätigt wird in einem "normalen" Gruppe eingestellt werden.'; 177 $lang['UAM_RedirTitle'] = 'Umleitung auf "Benutzerdaten" Seite'; 178 $lang['UAM_RedirTitle_d'] = 'Diese Option automatisch umleiten ein registrierter Benutzer zum sein Benutzerdaten Seite nur bei seinem ersten Anschluss an die Galerie.<br><br> 179 Bitte beachten Sie: Diese Funktion gilt für alle bereits registrierten Nutzern einschließlich derjenigen mit "admin", "Webmaster" oder "Generic" Status.'; 178 180 // --------- End: New or revised $lang ---- from version 2.15.4 179 181 ?> -
extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php
r6757 r6775 265 265 266 266 // --------- Starting below: New or revised $lang ---- from version 2.15.4 267 /*TODO*/$lang['Force_Validation'] = 'Manual validation'; 268 /*TODO*/$lang['UAM_Confirm_Mail_true'] = ' Enable - Validation by user'; 269 /*TODO*/$lang['UAM_Confirm_Mail_local'] = ' Enable - Validation by admin (no validation key sent)'; 267 $lang['Force_Validation'] = 'Handbuch Validierung'; 268 $lang['UAM_Confirm_Mail_true'] = ' Aktivieren - Validation von Benutzer'; 269 $lang['UAM_Confirm_Mail_local'] = ' Aktivieren - Validation von admin (keine Validierung Key gesendet)'; 270 $lang['UAM_RedirToProfile'] = 'Umleitung auf "Benutzerdaten" Seite'; 271 $lang['UAM_RedirToProfile_false'] = ' Deaktivieren (Standard)'; 272 $lang['UAM_RedirToProfile_true'] = ' Aktivieren'; 270 273 // --------- End: New or revised $lang ---- from version 2.15.4 271 274 ?> -
extensions/NBC_UserAdvManager/trunk/language/en_UK/help/plugin.lang.php
r6754 r6775 175 175 <br><br> 176 176 This option is generally used with the automatic assignment of group and/or statutes. For example, a user who has not validated their registration will be set in a specific group of users (with or without restrictions on the gallery) while a user who validated his registration shall be set in a "normal" group.'; 177 $lang['UAM_RedirTitle'] = 'Redirect to "Customization" page'; 178 $lang['UAM_RedirTitle_d'] = 'This option automatically redirect a registered user to his customization page only at his first connection to the gallery.<br><br> 179 Please note: This feature applies to all already registered users including those with "admin", "webmaster" or "generic" status.'; 177 180 // --------- End: New or revised $lang ---- from version 2.15.4 178 181 ?> -
extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php
r6757 r6775 265 265 $lang['UAM_Confirm_Mail_true'] = ' Enable - Validation by user'; 266 266 $lang['UAM_Confirm_Mail_local'] = ' Enable - Validation by admin (no validation key sent)'; 267 $lang['UAM_RedirToProfile'] = 'Redirect to "Customization" page'; 268 $lang['UAM_RedirToProfile_false'] = ' Disable (default)'; 269 $lang['UAM_RedirToProfile_true'] = ' Enable'; 267 270 // --------- End: New or revised $lang ---- from version 2.15.4 268 271 ?> -
extensions/NBC_UserAdvManager/trunk/language/es_ES/help/plugin.lang.php
r6754 r6775 176 176 <br><br> 177 177 Esta opción se utiliza generalmente con la asignación automática de grupo y / o estatutos. Por ejemplo, un usuario que no ha validado su registro se encuentra en un grupo específico de usuarios (con o sin restricciones a la galería) mientras que un usuario que haya validado su registro se encuentra en un "normal" del grupo.'; 178 $lang['UAM_RedirTitle'] = 'Redirigir a la página de "personalización"'; 179 $lang['UAM_RedirTitle_d'] = 'Esta opción se redireccionan automáticamente un usuario registrado para su página de personalización sólo en su primera conexión a la galería.<br><br> 180 Atención: Esta característica se aplica a todos los usuarios ya registrados, incluidos aquellos con estados "admin", "webmaster" o "generic".'; 178 181 // --------- End: New or revised $lang ---- from version 2.15.4 179 182 ?> -
extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php
r6757 r6775 264 264 265 265 // --------- Starting below: New or revised $lang ---- from version 2.15.4 266 /*TODO*/$lang['Force_Validation'] = 'Manual validation'; 267 /*TODO*/$lang['UAM_Confirm_Mail_true'] = ' Enable - Validation by user'; 268 /*TODO*/$lang['UAM_Confirm_Mail_local'] = ' Enable - Validation by admin (no validation key sent)'; 266 $lang['Force_Validation'] = 'Validación manual'; 267 $lang['UAM_Confirm_Mail_true'] = ' Activar - La validación por el usuario'; 268 $lang['UAM_Confirm_Mail_local'] = ' Activar - La validación por el administrador (sin clave de validación enviado)'; 269 $lang['UAM_RedirToProfile'] = 'Redirigir a la página de "personalización"'; 270 $lang['UAM_RedirToProfile_false'] = ' Desactivar (por defecto)'; 271 $lang['UAM_RedirToProfile_true'] = ' Activar'; 269 272 // --------- End: New or revised $lang ---- from version 2.15.4 270 273 ?> -
extensions/NBC_UserAdvManager/trunk/language/fr_FR/help/plugin.lang.php
r6754 r6775 171 171 <br><br> 172 172 Cette option est généralement utilisée avec l\'attribution automatique de groupe et/ou de statut. Selon qu\'il a validé ou non son inscription, il est en effet possible d\'affecter à l\'utilisateur un groupe différent, avec plus ou moins de restrictions d\'accès à la galerie.'; 173 $lang['UAM_RedirTitle'] = 'Redirection vers la page "Personnalisation"'; 174 $lang['UAM_RedirTitle_d'] = 'Cette option permet de rediriger automatiquement un utilisateur inscrit vers sa page de personnalisation uniquement lors de sa première connexion à la galerie.<br><br> 175 A savoir: Cette fonction s\'applique également à tous les utilisateurs déjà inscrits, y compris ceux disposant du status "admin", "webmaster" ou "generique".'; 173 176 // --------- End: New or revised $lang ---- from version 2.15.4 174 177 ?> -
extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php
r6757 r6775 264 264 $lang['UAM_Confirm_Mail_true'] = ' Activer - Validation par le visiteur'; 265 265 $lang['UAM_Confirm_Mail_local'] = ' Activer - Validation par l\'administrateur (pas d\'envoi de clé de validation)'; 266 $lang['UAM_RedirToProfile'] = 'Redirection vers la page "Personnalisation"'; 267 $lang['UAM_RedirToProfile_false'] = ' Désactiver (valeur par défaut)'; 268 $lang['UAM_RedirToProfile_true'] = ' Activer'; 266 269 // --------- End: New or revised $lang ---- from version 2.15.4 267 270 ?> -
extensions/NBC_UserAdvManager/trunk/language/it_IT/help/plugin.lang.php
r6754 r6775 172 172 <br><br> 173 173 Questa opzione è generalmente utilizzato con l\'assegnazione automatica di gruppo e / o statuto. Ad esempio, un utente che non ha convalidato la loro registrazione sarà ambientato in un gruppo specifico di utenti (con o senza le restrizioni alla galleria), mentre un utente che ha convalidato la sua registrazione è fissato in un "normale" del gruppo.'; 174 /*TODO*/$lang['UAM_RedirTitle'] = 'Redirect to "Customization" page'; 175 /*TODO*/$lang['UAM_RedirTitle_d'] = 'This option automatically redirect a registered user to his customization page only at his first connection to the gallery.<br><br> 176 Please note: This feature applies to all already registered users including those with "admin", "webmaster" or "generic" status.'; 174 177 // --------- End: New or revised $lang ---- from version 2.15.4 175 178 ?> -
extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php
r6757 r6775 267 267 /*TODO*/$lang['UAM_Confirm_Mail_true'] = ' Enable - Validation by user'; 268 268 /*TODO*/$lang['UAM_Confirm_Mail_local'] = ' Enable - Validation by admin (no validation key sent)'; 269 /*TODO*/$lang['UAM_RedirToProfile'] = 'Redirect to "Customization" page'; 270 $lang['UAM_RedirToProfile_false'] = ' Disattivare (di default)'; 271 $lang['UAM_RedirToProfile_true'] = ' Attivare'; 269 272 // --------- End: New or revised $lang ---- from version 2.15.4 270 273 ?> -
extensions/NBC_UserAdvManager/trunk/main.inc.php
r6757 r6775 2 2 /* 3 3 Plugin Name: UserAdvManager 4 Version: 2.15.4 b4 Version: 2.15.4 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 … … 13 13 /* 14 14 ***** TODO List ***** 15 ++ Adding ASC and DESC ordering for user's lists tables (Ghost Tracker, UserList and Unvalidated) ?16 17 15 ++ No validation needed for admins users comments (new trigger needed in comments.php ?) 18 16 … … 177 175 /* Cleanup for LastVisit table */ 178 176 DeleteLastVisit($user_id); 177 /* Cleanup Redirection settings */ 178 DeleteRedir($user_id); 179 179 } 180 180 … … 320 320 321 321 $conf_UAM = unserialize($conf['UserAdvManager']); 322 323 if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true')) 324 { 325 $user_idsOK = array(); 326 if (!check_consult($user['id'], $user_idsOK)) 327 { 328 $user_idsOK[] = $user['id']; 329 330 $query = " 331 UPDATE ".CONFIG_TABLE." 332 SET value = \"".implode(',', $user_idsOK)."\" 333 WHERE param = 'UserAdvManager_Redir';"; 334 335 pwg_query($query); 336 } 337 } 322 338 323 339 if (isset($_POST['validate']) and !is_admin()) … … 399 415 400 416 417 // RedirectToProfile - Thx to LucMorizur 418 // redirects a visitor (not generic (forbidden) neither admin) to his 419 // profile.php page 420 // 421 // no variable, no return 422 add_event_handler('login_success', 'RedirectToProfile'); 423 424 function RedirectToProfile() 425 { 426 global $conf, $user; 427 428 $conf_UAM = unserialize($conf['UserAdvManager']); 429 430 if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true')) 431 { 432 $user_idsOK = array(); 433 if (!check_consult($user['id'], $user_idsOK)) 434 redirect(PHPWG_ROOT_PATH.'profile.php'); 435 } 436 } 437 438 401 439 add_event_handler('init', 'UAM_InitPage'); 402 440 /* *** Important ! This is necessary to make email exclusion work in admin's users management panel *** */ -
extensions/NBC_UserAdvManager/trunk/maintain.inc.php
r6354 r6775 18 18 global $conf; 19 19 20 $default1 = array('false','false', 'false',-1,-1,-1,'false','false','',-1,'','','false','','false',100,'false','false',10,'Hello.20 $default1 = array('false','false',-1,-1,-1,'false','false','',-1,'','','false','','false',100,'false','false',10,'Hello. 21 21 22 22 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. … … 48 48 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 49 49 VALUES ("UserAdvManager_ConfirmMail","'.addslashes(serialize($default2)).'","UAM ConfirmMail parameters") 50 ;'; 51 pwg_query($q); 52 53 $q = ' 54 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 55 VALUES ("UserAdvManager_Redir","0","UAM Redirections") 50 56 ;'; 51 57 pwg_query($q); … … 160 166 } 161 167 162 /* Check if old version is > 2.15 */ 163 /* ****************************** */ 164 // In preparation of next releases 165 $query = ' 168 /* Old version is > 2.15 */ 169 /* ********************* */ 170 $query = ' 166 171 SELECT param 167 172 FROM '.CONFIG_TABLE.' 168 WHERE param LIKE "UserAdvManager%"173 WHERE param = "UserAdvManager_Redir" 169 174 ;'; 170 175 $count = pwg_db_num_rows(pwg_query($query)); 171 176 172 if ($count == 2) 173 { 174 $query = ' 175 SELECT value 176 FROM '.CONFIG_TABLE.' 177 WHERE param = "UserAdvManager" 178 ;'; 179 180 $result = pwg_query($query); 181 $conf = pwg_db_fetch_assoc($result); 182 183 $conf_UAM = unserialize($conf['value']); 184 $Nb_values = count($conf_UAM); 185 if ($Nb_values = 22) 186 { 187 upgrade_2153_2154(); 188 } 177 if ($count == 0) 178 { 179 upgrade_2153_2154(); 189 180 } 190 181
Note: See TracChangeset
for help on using the changeset viewer.