Changeset 10958 for extensions
- Timestamp:
- May 20, 2011, 10:22:18 PM (14 years ago)
- Location:
- extensions/UserAdvManager/branches/2.20
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserAdvManager/branches/2.20/admin/UAM_admin.php
r10943 r10958 106 106 case 'global': 107 107 108 if (isset($_POST['submit']) 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']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']) )108 if (isset($_POST['submit']) 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']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']) and isset($_POST['UAM_GroupComm'])) 109 109 { 110 110 … … 179 179 $_POST['UAM_USRAutoMail'], 180 180 $_POST['UAM_Stuffs'], 181 $_POST['UAM_HidePassw'] 181 $_POST['UAM_HidePassw'], 182 $_POST['UAM_GroupComm'], 183 (isset($_POST['UAM_AllowComm_Group'])?$_POST['UAM_AllowComm_Group']:''), 182 184 ); 183 185 … … 257 259 $Valid = -1; 258 260 $Downgrade = -1; 261 $AllowComm = -1; 259 262 260 263 //Check groups list in database … … 284 287 { 285 288 $Downgrade = $row['id']; 289 } 290 //configuration value for users group allowed to post comments 291 if (isset($conf_UAM[37]) and $conf_UAM[37] == $row['id']) 292 { 293 $AllowComm = $row['id']; 286 294 } 287 295 } … … 309 317 'group_options'=> $groups, 310 318 'group_selected' => $Downgrade 319 ) 320 ); 321 //Template initialization for allowed group for comments 322 $template->assign( 323 'AllowComm_Group', 324 array( 325 'group_options'=> $groups, 326 'group_selected' => $AllowComm 311 327 ) 312 328 ); … … 449 465 'UAM_HIDEPASSW_TRUE' => $conf_UAM[35]=='true' ? 'checked="checked"' : '' , 450 466 'UAM_HIDEPASSW_FALSE' => $conf_UAM[35]=='false' ? 'checked="checked"' : '' , 467 'UAM_GROUPCOMM_TRUE' => $conf_UAM[36]=='true' ? 'checked="checked"' : '' , 468 'UAM_GROUPCOMM_FALSE' => $conf_UAM[36]=='false' ? 'checked="checked"' : '' , 469 'UAM_ALLOWCOMM_GROUP' => $conf_UAM[37], 451 470 'UAM_PASSWORD_TEST_SCORE' => $UAM_Password_Test_Score, 452 471 'UAM_ERROR_REPORTS4' => $UAM_Exclusionlist_Error, -
extensions/UserAdvManager/branches/2.20/admin/template/global.tpl
r10392 r10958 679 679 680 680 <li> 681 <label class="cluetip" title="{'UAM_GroupCommTitle'|translate}|{'UAM_GroupCommTitle_d'|translate}"> 682 {'UAM_Group_Comments'|@translate} 683 </label> 684 <br><br> 685 <input type="radio" value="false" {$UAM_GROUPCOMM_FALSE} name="UAM_GroupComm"> 686 {'UAM_Disable'|@translate} 687 <br> 688 <input type="radio" value="true" {$UAM_GROUPCOMM_TRUE} name="UAM_GroupComm"> 689 {'UAM_Enable'|@translate} 690 <br><br> 691 <ul> 692 <li> 693 <label> 694 {'UAM_AllowedComm_Group'|@translate} 695 </label> 696 <br><br> 697 <div id="uam_leftmargin"> 698 {html_options name="UAM_AllowComm_Group" options=$AllowComm_Group.group_options selected=$AllowComm_Group.group_selected} 699 </div> 700 </li> 701 </ul> 702 <br><br> 703 </li> 704 705 <li> 681 706 <label class="cluetip" title="{'UAM_RedirTitle'|translate}|{'UAM_RedirTitle_d'|translate}"> 682 707 {'UAM_RedirToProfile'|@translate} -
extensions/UserAdvManager/branches/2.20/changelog.txt.php
r10943 r10958 250 250 251 251 -- 2.20.7 : Use pwg_db_real_escape_string() instead of addslashes() 252 Database upgrade process simplied (using version_compare() and code refactoring) 253 Bug 2253 fixed - New feature to allow comments on pictures only for specific users (who belong to a group) when "comments for all" is set 252 254 */ 253 255 ?> -
extensions/UserAdvManager/branches/2.20/include/functions.inc.php
r10707 r10958 752 752 * Triggered on user_comment_check 753 753 * 754 * checks if author is mandatory and set on comments post 754 * checks if author is mandatory and set on comments post when comments for all is set 755 * 756 * cheks if author is in an allowed group to post comment when comments for all is not set 755 757 * 756 758 * @param : comment action, comment … … 762 764 { 763 765 load_language('plugin.lang', UAM_PATH); 764 global $infos, $conf, $ template;766 global $infos, $conf, $user; 765 767 766 768 $conf_UAM = unserialize($conf['UserAdvManager']); 767 769 768 // User creation OR update769 if (isset($conf_UAM[5]) and $conf_UAM[5] == 'true' and $co nf['comments_forall'] == 'true' and $comm['author'] == 'guest')770 // Does not allow empty author name on comments for all 771 if (isset($conf_UAM[5]) and $conf_UAM[5] == 'true' and $comm['author'] == 'guest' and $conf['comments_forall']) 770 772 { 771 773 $comment_action = 'reject'; 772 774 773 775 array_push($infos, l10n('UAM_Empty Author')); 776 } 777 778 779 // Do not allow comments if user is not in an allowed group 780 if (isset($conf_UAM[36]) and $conf_UAM[36] == 'true' and !$conf['comments_forall']) 781 { 782 if (!UAM_CheckAuthor($comm['author'])) 783 { 784 $comment_action = 'reject'; 785 786 array_push($infos, l10n('UAM_Not_Allowed_Author')); 787 } 774 788 } 775 789 … … 2526 2540 2527 2541 /** 2542 * Called from UAM_CheckEmptyCommentAuthor() 2543 * Checks if comment's author name is in the allowed group 2544 * 2545 * @author : author's name 2546 * 2547 * @returns : Boolean (true is user is allowed to post / false if not allowed) 2548 * 2549 */ 2550 function UAM_CheckAuthor($author) 2551 { 2552 global $conf; 2553 2554 // Get UAM configuration 2555 $conf_UAM = unserialize($conf['UserAdvManager']); 2556 2557 if (isset($conf_UAM[37]) and $conf_UAM[37] <> -1) 2558 { 2559 $query = ' 2560 SELECT u.id, 2561 u.username, 2562 ug.user_id, 2563 ug.group_id 2564 FROM '.USERS_TABLE.' AS u 2565 INNER JOIN '.USER_GROUP_TABLE.' AS ug 2566 ON u.id = ug.user_id 2567 WHERE u.username LIKE "'.$author.'" 2568 AND ug.group_id = '.$conf_UAM[37].' 2569 ;'; 2570 2571 $count = pwg_db_num_rows(pwg_query($query)); 2572 2573 if (is_null($count) or $count == 0) 2574 { 2575 return false; 2576 } 2577 else 2578 return true; 2579 } 2580 } 2581 2582 2583 /** 2528 2584 * Useful for debugging - 4 vars can be set 2529 2585 * Output result to log.txt file -
extensions/UserAdvManager/branches/2.20/include/upgradedb.inc.php
r10943 r10958 453 453 pwg_query($query); 454 454 } 455 456 /* upgrade from 2.20.4 to 2.20.7 */ 457 /* ***************************** */ 458 function upgrade_2204_2207() 459 { 460 global $conf; 461 462 // Upgrading options 463 $query = ' 464 SELECT value 465 FROM '.CONFIG_TABLE.' 466 WHERE param = "UserAdvManager" 467 ;'; 468 469 $result = pwg_query($query); 470 $conf_UAM = pwg_db_fetch_assoc($result); 471 472 $Newconf_UAM = unserialize($conf_UAM['value']); 473 474 $Newconf_UAM[36] = 'false'; 475 $Newconf_UAM[37] = '-1'; 476 477 $update_conf = serialize($Newconf_UAM); 478 479 $query = ' 480 UPDATE '.CONFIG_TABLE.' 481 SET value="'.pwg_db_real_escape_string($update_conf).'" 482 WHERE param="UserAdvManager" 483 LIMIT 1 484 ;'; 485 486 pwg_query($query); 487 } 455 488 ?> -
extensions/UserAdvManager/branches/2.20/language/de_DE/help/plugin.lang.php
r10392 r10958 285 285 /*TODO*/$lang['UAM_HidePasswTitle_d'] = 'Choose here if you want to display the password chosen by the visitor in the information email. If you enable the option, the password will then appear in clear text. If you disable the password will not appear at all.'; 286 286 // --------- End: New or revised $lang ---- from version 2.20.4 287 288 289 // --------- Starting below: New or revised $lang ---- from version 2.20.7 290 $lang['UAM_GroupCommTitle'] = 'Kommentare zulassen, um eine Gruppe von Benutzern'; 291 /*TODO*/$lang['UAM_GroupCommTitle_d'] = 'This option lets you specify a group of users who will allowed to post comments when the gallery is configured to not allow comments for all. 292 <br><br> 293 By default, when "comments for all" option is disabled, only registered users can post comments. With this option, you can restrict this behavior by specifying a user group. Thus, only registered users and members of this group may post comments.'; 294 // --------- End: New or revised $lang ---- from version 2.20.7 287 295 ?> -
extensions/UserAdvManager/branches/2.20/language/de_DE/plugin.lang.php
r10392 r10958 330 330 $lang['UAM_HidePassw'] = 'Passwort im Klartext in der Informations-E-Mail'; 331 331 // --------- End: New or revised $lang ---- from version 2.20.4 332 333 334 // --------- Starting below: New or revised $lang ---- from version 2.20.7 335 $lang['UAM_Group_Comments'] = 'Kommentare zulassen um eine Gruppe von Benutzern'; 336 $lang['UAM_AllowedComm_Group'] = 'Wählen Sie die Gruppe von Benutzern gestattet Kommentare anzulegen:'; 337 $lang['UAM_Not_Allowed_Author'] = 'Entschuldigung, Sie sind nicht befugt einen Kommentar abzugeben. Bitte kontaktieren Sie den Administrator der Website.'; 338 // --------- End: New or revised $lang ---- from version 2.20.7 332 339 ?> -
extensions/UserAdvManager/branches/2.20/language/en_UK/help/plugin.lang.php
r10392 r10958 285 285 $lang['UAM_HidePasswTitle_d'] = 'Choose here if you want to display the password chosen by the visitor in the information email. If you enable the option, the password will then appear in clear text. If you disable the password will not appear at all.'; 286 286 // --------- End: New or revised $lang ---- from version 2.20.4 287 288 289 // --------- Starting below: New or revised $lang ---- from version 2.20.7 290 $lang['UAM_GroupCommTitle'] = 'Allow comments to a group of users'; 291 $lang['UAM_GroupCommTitle_d'] = 'This option lets you specify a group of users who will allowed to post comments when the gallery is configured to not allow comments for all. 292 <br><br> 293 By default, when "comments for all" option is disabled, only registered users can post comments. With this option, you can restrict this behavior by specifying a user group. Thus, only registered users and members of this group may post comments.'; 294 // --------- End: New or revised $lang ---- from version 2.20.7 287 295 ?> -
extensions/UserAdvManager/branches/2.20/language/en_UK/plugin.lang.php
r10392 r10958 332 332 $lang['UAM_HidePassw'] = 'Password in clear text in the information email'; 333 333 // --------- End: New or revised $lang ---- from version 2.20.4 334 335 336 // --------- Starting below: New or revised $lang ---- from version 2.20.7 337 $lang['UAM_Group_Comments'] = 'Allow comments to a group of users'; 338 $lang['UAM_AllowedComm_Group'] = 'Select the group of users allowed to post comments:'; 339 $lang['UAM_Not_Allowed_Author'] = 'Sorry, you are not authorized to post a comment. Please contact the site administrator.'; 340 // --------- End: New or revised $lang ---- from version 2.20.7 334 341 ?> -
extensions/UserAdvManager/branches/2.20/language/es_ES/help/plugin.lang.php
r10392 r10958 281 281 /*TODO*/$lang['UAM_HidePasswTitle_d'] = 'Choose here if you want to display the password chosen by the visitor in the information email. If you enable the option, the password will then appear in clear text. If you disable the password will not appear at all.'; 282 282 // --------- End: New or revised $lang ---- from version 2.20.4 283 284 285 // --------- Starting below: New or revised $lang ---- from version 2.20.7 286 /*TODO*/$lang['UAM_GroupCommTitle'] = 'Allow comments to a group of users'; 287 /*TODO*/$lang['UAM_GroupCommTitle_d'] = 'This option lets you specify a group of users who will allowed to post comments when the gallery is configured to not allow comments for all. 288 <br><br> 289 By default, when "comments for all" option is disabled, only registered users can post comments. With this option, you can restrict this behavior by specifying a user group. Thus, only registered users and members of this group may post comments.'; 290 // --------- End: New or revised $lang ---- from version 2.20.7 283 291 ?> -
extensions/UserAdvManager/branches/2.20/language/es_ES/plugin.lang.php
r10392 r10958 370 370 $lang['UAM_HidePassw'] = 'Contraseña en texto claro en la información del correo electrónico'; 371 371 // --------- End: New or revised $lang ---- from version 2.20.4 372 373 374 // --------- Starting below: New or revised $lang ---- from version 2.20.7 375 /*TODO*/$lang['UAM_Group_Comments'] = 'Allow comments to a group of users'; 376 /*TODO*/$lang['UAM_AllowedComm_Group'] = 'Select the group of users allowed to post comments:'; 377 /*TODO*/$lang['UAM_Not_Allowed_Author'] = 'Sorry, you are not authorized to post a comment. Please contact the site administrator.'; 378 // --------- End: New or revised $lang ---- from version 2.20.7 372 379 ?> -
extensions/UserAdvManager/branches/2.20/language/fr_FR/help/plugin.lang.php
r10392 r10958 281 281 $lang['UAM_HidePasswTitle_d'] = 'Choisissez ici si vous souhaitez faire afficher le mot de passe choisi par le visiteur dans le mail d\'information. Si vous activez l\'option, le mot de passe apparaitra alors en clair. Si vous la désactivez, le mot de passe n\'apparaitra pas du tout.'; 282 282 // --------- End: New or revised $lang ---- from version 2.20.4 283 284 285 // --------- Starting below: New or revised $lang ---- from version 2.20.7 286 $lang['UAM_GroupCommTitle'] = 'Autoriser les commentaires pour un groupe d\'utilisateurs'; 287 $lang['UAM_GroupCommTitle_d'] = 'Cette option permet de spécifier un groupe d\'utilisateurs qui seront autorisés à poster des commentaires lorsque la galerie est configurée pour ne pas autoriser les commentaires pour tous. 288 <br><br> 289 Par défaut, lorsque les "commentaires pour tous" sont désactivés, seuls les utilisateurs inscrits peuvent poster des commentaires. Avec cette option, vous pouvez restreindre d\'avantage ce fonctionnement en précisant un groupe d\'utilisateurs. Ainsi, seuls les utilisateurs inscrits et faisant partie de ce groupe pourront poster des commentaires.'; 290 // --------- End: New or revised $lang ---- from version 2.20.7 283 291 ?> -
extensions/UserAdvManager/branches/2.20/language/fr_FR/plugin.lang.php
r10392 r10958 331 331 $lang['UAM_HidePassw'] = 'Mot de passe en clair dans le mail d\'information'; 332 332 // --------- End: New or revised $lang ---- from version 2.20.4 333 334 335 // --------- Starting below: New or revised $lang ---- from version 2.20.7 336 $lang['UAM_Group_Comments'] = 'Autoriser les commentaires pour un groupe d\'utilisateurs'; 337 $lang['UAM_AllowedComm_Group'] = 'Sélectionnez le groupe d\'utilisateurs autorisé à poster des commentaires :'; 338 $lang['UAM_Not_Allowed_Author'] = 'Désolé, vous n\'êtes pas autorisé à poster un commentaire. Veuillez contacter l\'administrateur du site.'; 339 // --------- End: New or revised $lang ---- from version 2.20.7 333 340 ?> -
extensions/UserAdvManager/branches/2.20/language/it_IT/help/plugin.lang.php
r10392 r10958 272 272 /*TODO*/$lang['UAM_HidePasswTitle_d'] = 'Choose here if you want to display the password chosen by the visitor in the information email. If you enable the option, the password will then appear in clear text. If you disable the password will not appear at all.'; 273 273 // --------- End: New or revised $lang ---- from version 2.20.4 274 275 276 // --------- Starting below: New or revised $lang ---- from version 2.20.7 277 /*TODO*/$lang['UAM_GroupCommTitle'] = 'Allow comments to a group of users'; 278 /*TODO*/$lang['UAM_GroupCommTitle_d'] = 'This option lets you specify a group of users who will allowed to post comments when the gallery is configured to not allow comments for all. 279 <br><br> 280 By default, when "comments for all" option is disabled, only registered users can post comments. With this option, you can restrict this behavior by specifying a user group. Thus, only registered users and members of this group may post comments.'; 281 // --------- End: New or revised $lang ---- from version 2.20.7 274 282 ?> -
extensions/UserAdvManager/branches/2.20/language/it_IT/plugin.lang.php
r10392 r10958 329 329 $lang['UAM_HidePassw'] = 'Password in chiaro nelle informazioni e-mail'; 330 330 // --------- End: New or revised $lang ---- from version 2.20.4 331 332 333 // --------- Starting below: New or revised $lang ---- from version 2.20.7 334 /*TODO*/$lang['UAM_Group_Comments'] = 'Allow comments to a group of users'; 335 /*TODO*/$lang['UAM_AllowedComm_Group'] = 'Select the group of users allowed to post comments:'; 336 /*TODO*/$lang['UAM_Not_Allowed_Author'] = 'Sorry, you are not authorized to post a comment. Please contact the site administrator.'; 337 // --------- End: New or revised $lang ---- from version 2.20.7 331 338 ?> -
extensions/UserAdvManager/branches/2.20/language/lv_LV/help/plugin.lang.php
r10392 r10958 307 307 /*TODO*/$lang['UAM_HidePasswTitle_d'] = 'Choose here if you want to display the password chosen by the visitor in the information email. If you enable the option, the password will then appear in clear text. If you disable the password will not appear at all.'; 308 308 // --------- End: New or revised $lang ---- from version 2.20.4 309 310 311 // --------- Starting below: New or revised $lang ---- from version 2.20.7 312 /*TODO*/$lang['UAM_GroupCommTitle'] = 'Allow comments to a group of users'; 313 /*TODO*/$lang['UAM_GroupCommTitle_d'] = 'This option lets you specify a group of users who will allowed to post comments when the gallery is configured to not allow comments for all. 314 <br><br> 315 By default, when "comments for all" option is disabled, only registered users can post comments. With this option, you can restrict this behavior by specifying a user group. Thus, only registered users and members of this group may post comments.'; 316 // --------- End: New or revised $lang ---- from version 2.20.7 309 317 ?> -
extensions/UserAdvManager/branches/2.20/language/lv_LV/plugin.lang.php
r10392 r10958 367 367 /*TODO*/$lang['UAM_HidePassw'] = 'Clear password in information email'; 368 368 // --------- End: New or revised $lang ---- from version 2.20.4 369 370 371 // --------- Starting below: New or revised $lang ---- from version 2.20.7 372 /*TODO*/$lang['UAM_Group_Comments'] = 'Allow comments to a group of users'; 373 /*TODO*/$lang['UAM_AllowedComm_Group'] = 'Select the group of users allowed to post comments:'; 374 /*TODO*/$lang['UAM_Not_Allowed_Author'] = 'Sorry, you are not authorized to post a comment. Please contact the site administrator.'; 375 // --------- End: New or revised $lang ---- from version 2.20.7 369 376 ?> -
extensions/UserAdvManager/branches/2.20/maintain.inc.php
r10943 r10958 236 236 } 237 237 238 /* Check for upgrade from 2.16 to 2.20 */ 239 /* *********************************** */ 240 if (isset($conf['UserAdvManager_Version']) and strcmp($conf['UserAdvManager_Version'], '2.20.0') < 0) 241 { 238 /* Check database upgrade since version 2.16.0 */ 239 if (isset($conf['UserAdvManager_Version'])) 240 { 241 if (version_compare($conf['UserAdvManager_Version'], '2.20.0') < 0) 242 { 242 243 /* upgrade from branch 2.16 to 2.20 */ 243 244 /* ******************************** */ 244 upgrade_216_220(); 245 } 246 247 /* Check for upgrade from 2.20.3 to 2.20.4 */ 248 /* *************************************** */ 249 if (isset($conf['UserAdvManager_Version']) and strcmp($conf['UserAdvManager_Version'], '2.20.4') < 0) 250 { 251 /* upgrade from branch 2.16 to 2.20 */ 252 /* ******************************** */ 253 upgrade_2203_2204(); 245 upgrade_216_220(); 246 } 247 248 if (version_compare($conf['UserAdvManager_Version'], '2.20.4') < 0) 249 { 250 /* upgrade from version 2.20.3 to 2.20.4 */ 251 /* ************************************* */ 252 upgrade_2203_2204(); 253 } 254 255 if (version_compare($conf['UserAdvManager_Version'], '2.20.7') < 0) 256 { 257 /* upgrade from version 2.20.4 to 2.20.7 */ 258 /* ************************************* */ 259 upgrade_2204_2207(); 260 } 254 261 } 255 262
Note: See TracChangeset
for help on using the changeset viewer.