Changeset 630
- Timestamp:
- Dec 2, 2004, 4:42:57 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r625 r630 410 410 // retrieving all the favorites for this user and comparing their 411 411 // categories to the restricted categories 412 $query = 'SELECT image_id'; 413 $query.= ' FROM '.PREFIX_TABLE.'favorites'; 412 $query = 'SELECT image_id FROM '.FAVORITES_TABLE; 414 413 $query.= ' WHERE user_id = '.$user_id; 415 414 $query.= ';'; … … 433 432 if ( count( array_diff( $picture_cat, $restricted_cat ) ) == 0 ) 434 433 { 435 $query = 'DELETE FROM '. PREFIX_TABLE.'favorites';434 $query = 'DELETE FROM '.FAVORITES_TABLE; 436 435 $query.= ' WHERE image_id = '.$row['image_id']; 437 436 $query.= ' AND user_id = '.$user_id; -
trunk/include/functions_category.inc.php
r629 r630 547 547 $query = 'SELECT COUNT(DISTINCT(id)) AS nb_total_images'; 548 548 $query.= ' FROM '.IMAGES_TABLE; 549 $query.= ' INNER JOIN '. PREFIX_TABLE.'image_categoryAS ic';549 $query.= ' INNER JOIN '.IMAGE_CATEGORY_TABLE.'AS ic'; 550 550 $query.= ' ON id = ic.image_id'; 551 551 $query.= $page['where']; -
trunk/include/functions_group.inc.php
r593 r630 31 31 { 32 32 // 1. retrieving ids of private categories 33 $query = 'SELECT id'; 34 $query.= ' FROM '.PREFIX_TABLE.'categories'; 33 $query = 'SELECT id FROM '.CATEGORIES_TABLE; 35 34 $query.= " WHERE status = 'private'"; 36 35 $query.= ';'; … … 43 42 // 2. retrieving all authorized categories for the group 44 43 $authorized = array(); 45 $query = 'SELECT cat_id'; 46 $query.= ' FROM '.PREFIX_TABLE.'group_access'; 44 $query = 'SELECT cat_id FROM '.GROUP_ACCESS_TABLE; 47 45 $query.= ' WHERE group_id = '.$group_id; 48 46 $query.= ';'; … … 89 87 while ( !$is_root and !in_array( $category_id, $restrictions ) ) 90 88 { 91 $query = 'SELECT id_uppercat'; 92 $query.= ' FROM '.PREFIX_TABLE.'categories'; 89 $query = 'SELECT id_uppercat FROM '.CATEGORIES_TABLE; 93 90 $query.= ' WHERE id = '.$category_id; 94 91 $query.= ';'; -
trunk/include/functions_user.inc.php
r593 r630 117 117 $query.= ');'; 118 118 pwg_query( $query ); 119 // 3. retrieving the id of the newly created user120 $query = 'SELECT id';121 $query.= ' FROM '.USERS_TABLE;122 $query.= " WHERE username = '".$login."';";123 $row = mysql_fetch_array( pwg_query( $query ) );124 $user_id = $row['id'];125 // 4. adding access to the new user, the same as the user "guest"126 $query = 'SELECT cat_id';127 $query.= ' FROM '.PREFIX_TABLE.'user_access as ua';128 $query.= ','.PREFIX_TABLE.'users as u ';129 $query.= ' where u.id = ua.user_id';130 $query.= " and u.username = 'guest';";131 $result = pwg_query( $query );132 while( $row = mysql_fetch_array( $result ) )133 {134 $query = 'INSERT INTO '.PREFIX_TABLE.'user_access';135 $query.= ' (user_id,cat_id) VALUES';136 $query.= ' ('.$user_id.','.$row['cat_id'].');';137 pwg_query ( $query );138 }139 // 5. associate new user to the same groups that the guest140 $query = 'SELECT group_id';141 $query.= ' FROM '.PREFIX_TABLE.'user_group AS ug';142 $query.= ', '.PREFIX_TABLE.'users AS u';143 $query.= " WHERE u.username = 'guest'";144 $query.= ' AND ug.user_id = u.id';145 $query.= ';';146 $result = pwg_query( $query );147 while( $row = mysql_fetch_array( $result ) )148 {149 $query = 'INSERT INTO '.PREFIX_TABLE.'user_group';150 $query.= ' (user_id,group_id) VALUES';151 $query.= ' ('.$user_id.','.$row['group_id'].')';152 $query.= ';';153 pwg_query ( $query );154 }155 119 } 156 120 return $error; -
trunk/language/en_UK.iso-8859-1/common.lang.php
r629 r630 123 123 124 124 // Customization 125 $lang['customize_page_title'] = ' Customization';125 $lang['customize_page_title'] = 'Your Gallery Customization '; 126 126 $lang['customize_title'] = 'Customization'; 127 $lang['preferences'] = 'Preferences'; 128 $lang['mail_address'] = 'E-mail address'; 129 $lang['password_hint'] = 'You only have to give your password if you wish to change your e-mail'; 130 $lang['new_password'] = 'New password'; 131 $lang['new_password_hint'] = 'You only have to give a password if you wish to change it.'; 132 $lang['confirm_password_hint'] = 'You only have to confirm your new password if you wish to change it.'; 127 133 $lang['nb_image_per_row'] = 'Number of images per row'; 128 134 $lang['nb_row_per_page'] = 'Number of rows per page'; … … 136 142 $lang['recent_period'] = 'Recent period'; 137 143 $lang['periods_error'] = 'Recent period must be a positive integer value'; 138 $lang['create_cookie'] = 'Create a cookie'; 139 144 145 // Registration 146 $lang['register_page_title'] = 'Registration'; 147 $lang['register_title'] = 'Registration'; 148 $lang['reg_err_login1'] = 'Please, enter a login'; 149 $lang['reg_err_login2'] = 'login mustn\'t end with a space character'; 150 $lang['reg_err_login3'] = 'login mustn\'t start with a space character'; 151 $lang['reg_err_login4'] = 'login mustn\'t contain characters " and \''; 152 $lang['reg_err_login5'] = 'this login is already used'; 153 $lang['reg_err_pass'] = 'please enter your password again'; 154 $lang['reg_confirm'] = 'Confirm password'; 155 $lang['reg_err_mail_address'] = 'mail address must be like xxx@yyy.eee (example : jack@altern.org)'; 140 156 141 157 // search … … 226 242 $lang['del_favorites_alt'] = 'Delete from favorites'; 227 243 $lang['del_favorites_hint'] = 'Delete this picture from your favorites'; 228 $lang['register_page_title'] = 'Registration'; 229 $lang['register_title'] = 'Registration'; 230 $lang['reg_err_login1'] = 'Please, enter a login'; 231 $lang['reg_err_login2'] = 'login mustn\'t end with a space character'; 232 $lang['reg_err_login3'] = 'login mustn\'t start with a space character'; 233 $lang['reg_err_login4'] = 'login mustn\'t contain characters " and \''; 234 $lang['reg_err_login5'] = 'this login is already used'; 235 $lang['reg_err_pass'] = 'please enter your password again'; 236 $lang['reg_confirm'] = 'confirm'; 237 $lang['reg_err_mail_address'] = 'mail address must be like xxx@yyy.eee (example : jack@altern.org)'; 244 238 245 $lang['upload_forbidden'] = 'You can\'t upload pictures in this category'; 239 246 $lang['upload_file_exists'] = 'A picture\'s name already used'; … … 252 259 253 260 $lang['guest'] = 'guest'; 254 $lang['mail_address'] = 'mail address';255 261 $lang['add'] = 'add'; 256 262 $lang['dissociate'] = 'dissociate'; -
trunk/language/fr_FR.iso-8859-1/common.lang.php
r629 r630 124 124 125 125 // Customization 126 $lang['customize_page_title'] = 'Personnalisation ';126 $lang['customize_page_title'] = 'Personnalisation de votre galerie'; 127 127 $lang['customize_title'] = 'Personnalisation'; 128 $lang['preferences'] = 'Préférences'; 129 $lang['password_hint'] = 'Vous devez confirmer votre mot de passe si vous souhaitez modifier votre adresse e-mail'; 130 $lang['new_password'] = 'Nouveau mot de passe'; 131 $lang['new_password_hint'] = 'Vous avez seulement besoin de fournir un mot de passe si vous voulez le changer'; 132 $lang['confirm_password_hint'] = 'Vous avez seulement besoin de confirmer votre mot de passe si vous l\'avez changé ci-dessus'; 128 133 $lang['nb_image_per_row'] = 'Nombre d\'images par ligne'; 129 134 $lang['nb_row_per_page'] = 'Nombre de lignes par page'; … … 134 139 $lang['show_nb_comments'] = 'Montrer le nombre de commentaires'; 135 140 $lang['recent_period'] = 'Durée de nouveauté'; 136 $lang['create_cookie'] = 'Créer un cookie';137 141 $lang['theme'] = 'Thème de l\'interface'; 138 $lang['mail_address'] = 'Adresse mail';142 $lang['mail_address'] = 'Adresse e-mail'; 139 143 $lang['periods_error'] = 'La période doit être entière.'; 140 144 $lang['maxwidth_error'] = 'La largeur maximum des images doit être un entier supérieur à 50'; 141 145 $lang['maxheight_error'] = 'La hauteur maximum des images doit être un entier supérieur à 50'; 146 147 // Register 148 $lang['register_page_title'] = 'Enregistrement'; 149 $lang['register_title'] = 'Enregistrement'; 150 $lang['reg_err_login1'] = 'veuillez rentrer un pseudo'; 151 $lang['reg_err_login2'] = 'le pseudo ne doit pas se terminer par un espace'; 152 $lang['reg_err_login3'] = 'le pseudo ne doit pas commencer par un espace'; 153 $lang['reg_err_login4'] = 'le pseudo ne doit pas comporter les caractère " et \''; 154 $lang['reg_err_login5'] = 'ce pseudo est déjà utilisé'; 155 $lang['reg_err_pass'] = 'veuillez retaper le mot de passe'; 156 $lang['reg_confirm'] = 'Confirmer le mot de passe'; 157 $lang['reg_err_mail_address'] = 'l\'adresse mail doit être de la forme xxx@yyy.eee (exemple : jack@altern.org)'; 142 158 143 159 // search … … 225 241 $lang['del_favorites_alt'] = 'Retirer des favoris'; 226 242 $lang['del_favorites_hint'] = 'supprimer cette image de vos favoris'; 227 $lang['register_page_title'] = 'Enregistrement'; 228 $lang['register_title'] = 'Enregistrement'; 229 $lang['reg_err_login1'] = 'veuillez rentrer un pseudo'; 230 $lang['reg_err_login2'] = 'le pseudo ne doit pas se terminer par un espace'; 231 $lang['reg_err_login3'] = 'le pseudo ne doit pas commencer par un espace'; 232 $lang['reg_err_login4'] = 'le pseudo ne doit pas comporter les caractère " et \''; 233 $lang['reg_err_login5'] = 'ce pseudo est déjà utilisé'; 234 $lang['reg_err_pass'] = 'veuillez retaper le mot de passe'; 235 $lang['reg_confirm'] = 'confirmer'; 236 $lang['reg_err_mail_address'] = 'l\'adresse mail doit être de la forme xxx@yyy.eee (exemple : jack@altern.org)'; 243 237 244 $lang['upload_forbidden'] = 'On ne peut pas ajouter d\'image dans cette catégorie'; 238 245 $lang['upload_file_exists'] = 'Une image du même nom existe déjà'; -
trunk/profile.php
r593 r630 68 68 array_push( $errors, $lang['periods_error'] ); 69 69 } 70 $mail_error = validate_mail_address( $_POST['mail_address'] ); 71 if ( $mail_error != '' ) array_push( $errors, $mail_error ); 70 71 if ( $_POST['mail_address']!= $user['mail_address']) 72 { 73 if (!empty($_POST['password'])) 74 array_push( $errors, $lang['reg_err_pass'] ); 75 else 76 { 77 // retrieving the encrypted password of the login submitted 78 $query = 'SELECT password FROM '.USERS_TABLE.' 79 WHERE username = \''.$user['username'].'\';'; 80 $row = mysql_fetch_array(pwg_query($query)); 81 if ($row['password'] == md5($_POST['password'])) 82 { 83 $mail_error = validate_mail_address( $_POST['mail_address'] ); 84 if ( !empty($mail_error)) array_push( $errors, $mail_error ); 85 } 86 else 87 array_push( $errors, $lang['reg_err_pass'] ); 88 } 89 } 90 72 91 // password must be the same as its confirmation 73 92 if ( isset( $_POST['use_new_pwd'] ) 74 and $_POST[' password'] != $_POST['passwordConf'] )93 and $_POST['use_new_pwd'] != $_POST['passwordConf'] ) 75 94 array_push( $errors, $lang['reg_err_pass'] ); 76 95 … … 93 112 { 94 113 $query = 'UPDATE '.USERS_TABLE; 95 $query.= " SET password = '".md5( $_POST[' password'] )."'";114 $query.= " SET password = '".md5( $_POST['use_new_pwd'] )."'"; 96 115 $query.= ' WHERE id = '.$user['id']; 97 116 $query.= ';'; 98 117 pwg_query( $query ); 99 118 } 100 if ( isset( $_POST['create_cookie'] ) ) 101 { 102 setcookie( 'id',$page['session_id'],$_POST['cookie_expiration'], 103 cookie_path() ); 104 // update the expiration date of the session 105 $query = 'UPDATE '.SESSIONS_TABLE; 106 $query.= ' SET expiration = '.$_POST['cookie_expiration']; 107 $query.= " WHERE id = '".$page['session_id']."'"; 108 $query.= ';'; 109 pwg_query( $query ); 110 } 119 111 120 // redirection 112 $url = 'category.php'; 113 if ( !isset($_POST['create_cookie']) ) $url = add_session_id( $url,true ); 114 redirect( $url ); 121 redirect(add_session_id(PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING'])); 115 122 } 116 123 } … … 125 132 126 133 $template->assign_vars(array( 134 'USERNAME'=>$user['username'], 135 'EMAIL'=>$user['mail_address'], 127 136 'LANG_SELECT'=>language_select($user['language'], 'language'), 128 137 'NB_IMAGE_LINE'=>$user['nb_image_line'], … … 130 139 'STYLE_SELECT'=>style_select($user['template'], 'template'), 131 140 'RECENT_PERIOD'=>$user['recent_period'], 141 'MAXWIDTH'=>$user['maxwidth'], 142 'MAXHEIGHT'=>$user['maxheight'], 132 143 133 144 $expand=>'checked="checked"', … … 135 146 136 147 'L_TITLE' => $lang['customize_title'], 137 'L_PASSWORD' => $lang['password'], 138 'L_NEW' => $lang['new'], 139 'L_CONFIRM' => $lang['reg_confirm'], 140 'L_COOKIE' => $lang['create_cookie'], 148 'L_REGISTRATION_INFO' => $lang['register_title'], 149 'L_PREFERENCES' => $lang['preferences'], 150 'L_USERNAME' => $lang['login'], 151 'L_EMAIL' => $lang['mail_address'], 152 'L_CURRENT_PASSWORD' => $lang['password'], 153 'L_CURRENT_PASSWORD_HINT' => $lang['password_hint'], 154 'L_NEW_PASSWORD' => $lang['new_password'], 155 'L_NEW_PASSWORD_HINT' => $lang['new_password_hint'], 156 'L_CONFIRM_PASSWORD' => $lang['reg_confirm'], 157 'L_CONFIRM_PASSWORD_HINT' => $lang['confirm_password_hint'], 141 158 'L_LANG_SELECT'=>$lang['language'], 142 159 'L_NB_IMAGE_LINE'=>$lang['nb_image_per_row'], … … 146 163 'L_EXPAND_TREE'=>$lang['auto_expand'], 147 164 'L_NB_COMMENTS'=>$lang['show_nb_comments'], 165 'L_MAXWIDTH'=>$lang['maxwidth'], 166 'L_MAXHEIGHT'=>$lang['maxheight'], 148 167 'L_YES'=>$lang['yes'], 149 168 'L_NO'=>$lang['no'], 150 169 'L_SUBMIT'=>$lang['submit'], 170 'L_RETURN' => $lang['home'], 171 'L_RETURN_HINT' => $lang['home_hint'], 151 172 152 173 'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'profile.php'), … … 154 175 'U_RETURN' => add_session_id(PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING']) 155 176 )); 156 177 157 178 //-------------------------------------------------------------- errors display 158 179 if ( sizeof( $errors ) != 0 ) … … 164 185 } 165 186 } 166 167 $template->assign_block_vars('text',array(168 'F_LABEL'=>$lang['maxwidth'],169 'F_NAME'=>'maxwidth',170 'F_VALUE'=>$user['maxwidth']171 ));172 173 $template->assign_block_vars('text',array(174 'F_LABEL'=>$lang['maxheight'],175 'F_NAME'=>'maxheight',176 'F_VALUE'=>$user['maxheight']177 ));178 179 $template->assign_block_vars('text',array(180 'F_LABEL'=>$lang['mail_address'],181 'F_NAME'=>'mail_address',182 'F_VALUE'=>$user['mail_address']183 ));184 185 187 //----------------------------------------------------------- html code display 186 188 $template->pparse('profile'); -
trunk/template/default/profile.tpl
r452 r630 11 11 <!-- END errors --> 12 12 <table width="70%" align="center"> 13 <tr class="admin"> 14 <th colspan="2">{L_REGISTRATION_INFO}</th> 15 </tr> 16 <tr> 17 <td width="50%">{L_USERNAME}</td> 18 <td><input type="text" name="username" value="{USERNAME}" /></td> 19 </tr> 20 <tr> 21 <td>{L_EMAIL}</td> 22 <td><input type="text" name="mail_address" value="{EMAIL}" /></td> 23 </tr> 24 <tr> 25 <td>{L_CURRENT_PASSWORD} : <br /><span class="small">{L_CURRENT_PASSWORD_HINT}</span></td> 26 <td><input type="password" name="password" value="" /></td> 27 </tr> 28 <tr> 29 <td>{L_NEW_PASSWORD} : <br /><span class="small">{L_NEW_PASSWORD_HINT}</span></td> 30 <td><input type="password" name="use_new_pwd" value="" /></td> 31 </tr> 32 <tr> 33 <td>{L_CONFIRM_PASSWORD} : <br /><span class="small">{L_CONFIRM_PASSWORD_HINT}</span></td> 34 <td><input type="password" name="passwordConf" value="" /></td> 35 </tr> 36 <tr class="admin"> 37 <th colspan="2">{L_PREFERENCES}</th> 38 </tr> 13 39 <tr> 14 40 <td width="60%">{L_NB_IMAGE_LINE}</td> … … 41 67 <input type="radio" class="radio" name="show_nb_comments" value="false" {NB_COMMENTS_NO} />{L_NO}</td> 42 68 </tr> 43 <!-- BEGIN text --> 44 <tr> 45 <td>{text.F_LABEL}</td> 46 <td> 47 <input type="text" name="{text.F_NAME}" value="{text.F_VALUE}" /> 69 <tr> 70 <td>{L_MAXWIDTH}</td> 71 <td><input type="text" size="4" maxlength="4" name="maxwidth" value="{MAXWIDTH}" /> 48 72 </td> 49 73 </tr> 50 <!-- END text --> 51 <tr> 52 <td colspan="2"> </td> 74 <tr> 75 <td>{L_MAXHEIGHT}</td> 76 <td><input type="text" size="4" maxlength="4" name="maxheight" value="{MAXHEIGHT}" /> 77 </td> 53 78 </tr> 54 <tr>55 <td>{L_NEW} {L_PASSWORD} <input type="checkbox" name="use_new_pwd" value="1" /></td>56 <td><input type="password" name="password" value="" /></td>57 </tr>58 <tr>59 <td>{L_CONFIRM}</td>60 <td><input type="password" name="passwordConf" value="" /></td>61 </tr>62 <tr>63 <td colspan="2"> </td>64 </tr>65 <tr>66 79 <td colspan="2" align="center"> 67 80 <input type="submit" name="submit" value="{L_SUBMIT}" class="bouton" /> … … 70 83 </table> 71 84 </form> 85 <div style="text-align:center;margin:5px;"> 86 <a href="{U_RETURN}" title="{L_RETURN_HINT}">[{L_RETURN}]</a> 87 </div> -
trunk/template/default/search.tpl
r629 r630 1 1 <div class="titrePage">{L_SEARCH_TITLE}</div> 2 <br />3 2 <form method="post" name="post" action="{S_SEARCH_ACTION}"> 4 3 <!-- BEGIN errors -->
Note: See TracChangeset
for help on using the changeset viewer.