Changeset 5328
- Timestamp:
- Mar 25, 2010, 12:24:01 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r5304 r5328 52 52 'rate_anonymous', 53 53 'email_admin_on_new_user', 54 'allow_user_customization', 54 55 ); 55 56 -
trunk/admin/themes/default/template/configuration.tpl
r5304 r5328 65 65 <span class="property">{'Allow user registration'|@translate}</span> 66 66 <input type="checkbox" name="allow_user_registration" {if ($main.allow_user_registration)}checked="checked"{/if}> 67 </label> 68 </li> 69 70 <li> 71 <label> 72 <span class="property">{'Allow user customization'|@translate}</span> 73 <input type="checkbox" name="allow_user_customization" {if ($main.allow_user_customization)}checked="checked"{/if}> 67 74 </label> 68 75 </li> -
trunk/install/config.sql
r5304 r5328 18 18 INSERT INTO piwigo_config (param,value,comment) VALUES ('history_guest','true','keep a history of guest visits on your website'); 19 19 INSERT INTO piwigo_config (param,value,comment) VALUES ('allow_user_registration','true','allow visitors to register?'); 20 INSERT INTO piwigo_config (param,value,comment) VALUES ('allow_user_customization','true','allow users to customize their gallery?'); 20 21 INSERT INTO piwigo_config (param,value,comment) VALUES ('nbm_send_html_mail','true','Send mail on HTML format for notification by mail'); 21 22 INSERT INTO piwigo_config (param,value,comment) VALUES ('nbm_send_mail_as','','Send mail as param value for notification by mail'); -
trunk/language/en_UK/admin.lang.php
r5304 r5328 750 750 $lang['Activate field "%s"'] = 'Activate field "%s"'; 751 751 $lang['Photo Properties'] = 'Photo Properties'; 752 $lang['Allow user customization'] = 'Allow user customization'; 752 753 ?> -
trunk/language/fr_FR/common.lang.php
r5316 r5328 388 388 $lang['validate this comment'] = 'valider ce commentaire'; 389 389 $lang['(!) This comment requires validation'] = '(!) Ce commentaire requiert une validation'; 390 $lang['Allow user customization'] = "Permettre la personnalisation de l'affichage"; 390 391 ?> -
trunk/profile.php
r5206 r5328 105 105 } 106 106 107 $int_pattern = '/^\d+$/'; 108 if (empty($_POST['nb_image_line']) 109 or (!preg_match($int_pattern, $_POST['nb_image_line']))) 110 { 111 $errors[] = l10n('The number of images per row must be a not null scalar'); 112 } 113 114 if (empty($_POST['nb_line_page']) 115 or (!preg_match($int_pattern, $_POST['nb_line_page']))) 116 { 117 $errors[] = l10n('The number of rows per page must be a not null scalar'); 118 } 119 120 if ($_POST['maxwidth'] != '' 121 and (!preg_match($int_pattern, $_POST['maxwidth']) 122 or $_POST['maxwidth'] < 50)) 123 { 124 $errors[] = l10n('Maximum width must be a number superior to 50'); 125 } 126 if ($_POST['maxheight'] 127 and (!preg_match($int_pattern, $_POST['maxheight']) 128 or $_POST['maxheight'] < 50)) 129 { 130 $errors[] = l10n('Maximum height must be a number superior to 50'); 131 } 132 // periods must be integer values, they represents number of days 133 if (!preg_match($int_pattern, $_POST['recent_period']) 134 or $_POST['recent_period'] <= 0) 135 { 136 $errors[] = l10n('Recent period must be a positive integer value') ; 107 if ($conf['allow_user_customization'] or defined('IN_ADMIN')) 108 { 109 $int_pattern = '/^\d+$/'; 110 if (empty($_POST['nb_image_line']) 111 or (!preg_match($int_pattern, $_POST['nb_image_line']))) 112 { 113 $errors[] = l10n('The number of images per row must be a not null scalar'); 114 } 115 116 if (empty($_POST['nb_line_page']) 117 or (!preg_match($int_pattern, $_POST['nb_line_page']))) 118 { 119 $errors[] = l10n('The number of rows per page must be a not null scalar'); 120 } 121 122 if ($_POST['maxwidth'] != '' 123 and (!preg_match($int_pattern, $_POST['maxwidth']) 124 or $_POST['maxwidth'] < 50)) 125 { 126 $errors[] = l10n('Maximum width must be a number superior to 50'); 127 } 128 if ($_POST['maxheight'] 129 and (!preg_match($int_pattern, $_POST['maxheight']) 130 or $_POST['maxheight'] < 50)) 131 { 132 $errors[] = l10n('Maximum height must be a number superior to 50'); 133 } 134 // periods must be integer values, they represents number of days 135 if (!preg_match($int_pattern, $_POST['recent_period']) 136 or $_POST['recent_period'] <= 0) 137 { 138 $errors[] = l10n('Recent period must be a positive integer value') ; 139 } 137 140 } 138 141 … … 200 203 } 201 204 202 // update user "additional" informations (specific to Piwigo)203 $fields = array(204 'nb_image_line', 'nb_line_page', 'language', 'maxwidth', 'maxheight',205 'expand', 'show_nb_comments', 'show_nb_hits', 'recent_period', 'theme'206 );207 208 $data = array();209 $data['user_id'] = $userdata['id']; 210 211 foreach ($fields as $field)212 { 213 if (isset($_POST[$field]))205 if ($conf['allow_user_customization'] or defined('IN_ADMIN')) 206 { 207 // update user "additional" informations (specific to Piwigo) 208 $fields = array( 209 'nb_image_line', 'nb_line_page', 'language', 'maxwidth', 'maxheight', 210 'expand', 'show_nb_comments', 'show_nb_hits', 'recent_period', 'theme' 211 ); 212 213 $data = array(); 214 $data['user_id'] = $userdata['id']; 215 216 foreach ($fields as $field) 214 217 { 215 $data[$field] = $_POST[$field]; 218 if (isset($_POST[$field])) 219 { 220 $data[$field] = $_POST[$field]; 221 } 216 222 } 217 } 218 mass_updates(USER_INFOS_TABLE, 219 array('primary' => array('user_id'), 'update' => $fields), 220 array($data)); 221 223 mass_updates(USER_INFOS_TABLE, 224 array('primary' => array('user_id'), 'update' => $fields), 225 array($data)); 226 } 222 227 trigger_action( 'save_profile_from_post', $userdata['id'] ); 223 228 … … 246 251 'USERNAME'=>stripslashes($userdata['username']), 247 252 'EMAIL'=>get_email_address_as_display_text(@$userdata['email']), 253 'ALLOW_USER_CUSTOMIZATION'=>$conf['allow_user_customization'], 248 254 'NB_IMAGE_LINE'=>$userdata['nb_image_line'], 249 255 'NB_ROW_PAGE'=>$userdata['nb_line_page'], -
trunk/themes/default/template/profile_content.tpl
r5123 r5328 40 40 </fieldset> 41 41 42 {if $ALLOW_USER_CUSTOMIZATION} 42 43 <fieldset> 43 44 <legend>{'Preferences'|@translate}</legend> … … 100 101 </ul> 101 102 </fieldset> 103 {/if} 102 104 103 105 <p class="bottomButtons">
Note: See TracChangeset
for help on using the changeset viewer.