Changeset 396

Show
Ignore:
Timestamp:
2010-04-05 15:28:25 (2 years ago)
Author:
hannes
Message:

merging changeset [395] (checking signature length) from trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/5.2/classes/pages/Userpanel.php

    r352 r396  
    226226                            if ($s && $row = $q->fetchObject()) { 
    227227                                $q = NULL; 
    228                                 if ($INPUT['user'] != $row->membername) { 
    229                                     // update membername 
    230                                     $q = $C->prepare('UPDATE ' . $SETTINGS['dbtableprefix'] . 'members SET membername=:user WHERE memberid=:id'); 
    231                                     $q->bindParam(':user', $INPUT['user'], PDO::PARAM_STR); 
     228                                if (strlen($INPUT['signature']) <= 255) { 
     229                                    if ($INPUT['user'] != $row->membername) { 
     230                                        // update membername 
     231                                        $q = $C->prepare('UPDATE ' . $SETTINGS['dbtableprefix'] . 'members SET membername=:user WHERE memberid=:id'); 
     232                                        $q->bindParam(':user', $INPUT['user'], PDO::PARAM_STR); 
     233                                        $q->bindParam(':id', $INPUT['id'], PDO::PARAM_INT, 12); 
     234                                        $q->execute(); 
     235                                        $q = NULL; 
     236                                        // update name in the posts table, too, if necessary 
     237                                        $q = $C->prepare('UPDATE ' . $SETTINGS['dbtableprefix'] . 'posts SET poster=:user WHERE poster=:member AND postedbymember=:one'); 
     238                                        $q->bindParam(':user', $INPUT['user'], PDO::PARAM_STR); 
     239                                        $q->bindParam(':member', $row->membername, PDO::PARAM_STR); 
     240                                        $q->bindValue(':one', 1, PDO::PARAM_INT); 
     241                                        $q->execute(); 
     242                                        $q = NULL; 
     243                                    } 
     244                                    // if the crucial rest has been entered, update it one by one 
     245                                    if (isset($INPUT['avatar']) && $INPUT['avatar'] != '') { 
     246                                        $q = $C->prepare('UPDATE ' . $SETTINGS['dbtableprefix'] . 'members SET memberavatar=:avatar WHERE memberid=:id'); 
     247                                        $q->bindParam(':avatar', $INPUT['avatar'], PDO::PARAM_STR); 
     248                                        $q->bindParam(':id', $INPUT['id'], PDO::PARAM_INT, 12); 
     249                                        $q->execute(); 
     250                                        $q = NULL; 
     251                                    } 
     252                                    // update rest in bulk 
     253                                    $q = $C->prepare('UPDATE ' . $SETTINGS['dbtableprefix'] . 'members SET lang=:lang, memberhomepage=:homepage, birthday=:birthday, location=:location, icq=:icq, aim=:aim, yahoo=:yahoo, msn=:msn, jabber=:jabber, signature=:signature, memberemailhidden=:hideemail, messagenotification_email=:mn_email, messagenotification_popup=:mn_popup, boardstyle=:style, attachments=:attachments, timezone=:timezone WHERE memberid=:id'); 
     254                                    $q->bindParam(':lang', trim($INPUT['newlanguage']), PDO::PARAM_STR, 2); 
     255                                    if (isset($INPUT['homepage'])) { 
     256                                        $q->bindParam(':homepage', trim($INPUT['homepage']), PDO::PARAM_STR); 
     257                                    } else { 
     258                                        $q->bindValue(':homepage', '', PDO::PARAM_STR); 
     259                                    } 
     260                                    $q->bindParam(':birthday', $birthday, PDO::PARAM_STR); 
     261                                    $q->bindParam(':location', trim($INPUT['location']), PDO::PARAM_STR); 
     262                                    $q->bindParam(':icq', trim($INPUT['icq']), PDO::PARAM_INT, 12); 
     263                                    $q->bindParam(':aim', trim($INPUT['aim']), PDO::PARAM_STR); 
     264                                    $q->bindParam(':yahoo', trim($INPUT['yahoo']), PDO::PARAM_STR); 
     265                                    $q->bindParam(':msn', trim($INPUT['msn']), PDO::PARAM_STR); 
     266                                    $q->bindParam(':jabber', trim($INPUT['jabber']), PDO::PARAM_STR); 
     267                                    $q->bindParam(':signature', $INPUT['signature'], PDO::PARAM_STR); 
     268                                    $q->bindParam(':hideemail', $INPUT['hideemail'], PDO::PARAM_INT, 1); 
     269                                    $q->bindParam(':mn_email', $INPUT['messagenotification_email'], PDO::PARAM_INT, 1); 
     270                                    $q->bindParam(':mn_popup', $INPUT['messagenotification_popup'], PDO::PARAM_INT, 1); 
     271                                    $q->bindParam(':style', $INPUT['boardstyle'], PDO::PARAM_STR, 2); 
     272                                    $q->bindParam(':attachments', $INPUT['attachments'], PDO::PARAM_INT, 1); 
     273                                    $q->bindParam(':timezone', $INPUT['newtimezone'], PDO::PARAM_STR, 8); 
    232274                                    $q->bindParam(':id', $INPUT['id'], PDO::PARAM_INT, 12); 
    233275                                    $q->execute(); 
    234276                                    $q = NULL; 
    235                                     // update name in the posts table, too, if necessary 
    236                                     $q = $C->prepare('UPDATE ' . $SETTINGS['dbtableprefix'] . 'posts SET poster=:user WHERE poster=:member AND postedbymember=:one'); 
    237                                     $q->bindParam(':user', $INPUT['user'], PDO::PARAM_STR); 
    238                                     $q->bindParam(':member', $row->membername, PDO::PARAM_STR); 
    239                                     $q->bindValue(':one', 1, PDO::PARAM_INT); 
    240                                     $q->execute(); 
     277                                    // put new board style and language into session 
     278                                    $_SESSION['boardstyle'] = trim($INPUT['boardstyle']); 
     279                                    if (trim($INPUT['newlanguage']) != '') { 
     280                                        $_SESSION['lang'] = trim($INPUT['newlanguage']); 
     281                                    } else { 
     282                                        $_SESSION['lang'] = $SETTINGS['language']; 
     283                                    } 
     284                                    $_SESSION['attachments'] = trim($INPUT['attachments']); 
     285                                    if (trim($INPUT['newtimezone']) != '') { 
     286                                        $_SESSION['timezone'] = trim($INPUT['newtimezone']); 
     287                                    } else { 
     288                                        $_SESSION['timezone'] = $SETTINGS['timezone']; 
     289                                    } 
     290                                    // success 
     291                                    $output = $LANG['profile_updated']; 
     292                                } else { 
    241293                                    $q = NULL; 
    242                                 } 
    243                                 // if the crucial rest has been entered, update it one by one 
    244                                 if (isset($INPUT['avatar']) && $INPUT['avatar'] != '') { 
    245                                     $q = $C->prepare('UPDATE ' . $SETTINGS['dbtableprefix'] . 'members SET memberavatar=:avatar WHERE memberid=:id'); 
    246                                     $q->bindParam(':avatar', $INPUT['avatar'], PDO::PARAM_STR); 
    247                                     $q->bindParam(':id', $INPUT['id'], PDO::PARAM_INT, 12); 
    248                                     $q->execute(); 
    249                                     $q = NULL; 
    250                                 } 
    251                                 // update rest in bulk 
    252                                 $q = $C->prepare('UPDATE ' . $SETTINGS['dbtableprefix'] . 'members SET lang=:lang, memberhomepage=:homepage, birthday=:birthday, location=:location, icq=:icq, aim=:aim, yahoo=:yahoo, msn=:msn, jabber=:jabber, signature=:signature, memberemailhidden=:hideemail, messagenotification_email=:mn_email, messagenotification_popup=:mn_popup, boardstyle=:style, attachments=:attachments, timezone=:timezone WHERE memberid=:id'); 
    253                                 $q->bindParam(':lang', trim($INPUT['newlanguage']), PDO::PARAM_STR, 2); 
    254                                 if (isset($INPUT['homepage'])) { 
    255                                     $q->bindParam(':homepage', trim($INPUT['homepage']), PDO::PARAM_STR); 
    256                                 } else { 
    257                                     $q->bindValue(':homepage', '', PDO::PARAM_STR); 
    258                                 } 
    259                                 $q->bindParam(':birthday', $birthday, PDO::PARAM_STR); 
    260                                 $q->bindParam(':location', trim($INPUT['location']), PDO::PARAM_STR); 
    261                                 $q->bindParam(':icq', trim($INPUT['icq']), PDO::PARAM_INT, 12); 
    262                                 $q->bindParam(':aim', trim($INPUT['aim']), PDO::PARAM_STR); 
    263                                 $q->bindParam(':yahoo', trim($INPUT['yahoo']), PDO::PARAM_STR); 
    264                                 $q->bindParam(':msn', trim($INPUT['msn']), PDO::PARAM_STR); 
    265                                 $q->bindParam(':jabber', trim($INPUT['jabber']), PDO::PARAM_STR); 
    266                                 $q->bindParam(':signature', $INPUT['signature'], PDO::PARAM_STR); 
    267                                 $q->bindParam(':hideemail', $INPUT['hideemail'], PDO::PARAM_INT, 1); 
    268                                 $q->bindParam(':mn_email', $INPUT['messagenotification_email'], PDO::PARAM_INT, 1); 
    269                                 $q->bindParam(':mn_popup', $INPUT['messagenotification_popup'], PDO::PARAM_INT, 1); 
    270                                 $q->bindParam(':style', $INPUT['boardstyle'], PDO::PARAM_STR, 2); 
    271                                 $q->bindParam(':attachments', $INPUT['attachments'], PDO::PARAM_INT, 1); 
    272                                 $q->bindParam(':timezone', $INPUT['newtimezone'], PDO::PARAM_STR, 8); 
    273                                 $q->bindParam(':id', $INPUT['id'], PDO::PARAM_INT, 12); 
    274                                 $q->execute(); 
    275                                 $q = NULL; 
    276                                 // put new board style and language into session 
    277                                 $_SESSION['boardstyle'] = trim($INPUT['boardstyle']); 
    278                                 if (trim($INPUT['newlanguage']) != '') { 
    279                                     $_SESSION['lang'] = trim($INPUT['newlanguage']); 
    280                                 } else { 
    281                                     $_SESSION['lang'] = $SETTINGS['language']; 
    282                                 } 
    283                                 $_SESSION['attachments'] = trim($INPUT['attachments']); 
    284                                 if (trim($INPUT['newtimezone']) != '') { 
    285                                     $_SESSION['timezone'] = trim($INPUT['newtimezone']); 
    286                                 } else { 
    287                                     $_SESSION['timezone'] = $SETTINGS['timezone']; 
    288                                 } 
    289                                 // success 
    290                                 $output = $LANG['profile_updated']; 
     294                                    $output = str_replace('%field%', $LANG['Signature'], $LANG['error_overflow']); 
     295                                } 
    291296                            } else { 
    292297                                $q = NULL; 
  • branches/5.2/includes/lang/de.php

    r386 r396  
    501501$LANG['error_installer_database'] = "Fehler: Die Datenbank konte nicht korrekt aufgesetzt werden. Installation abgebrochen."; 
    502502$LANG['error_page_not_found'] = 'Fehler: Seite nicht gefunden'; 
     503$LANG['error_overflow'] = 'Fehler: Der Wert des Felds &quot;%field%&quot; ist zu lang.'; 
    503504 
    504505?> 
  • branches/5.2/includes/lang/en.php

    r386 r396  
    502502$LANG['error_installer_database'] = "Error: The database couldn't be set up correctly. Aborting."; 
    503503$LANG['error_page_not_found'] = 'Error: Page not found'; 
     504$LANG['error_overflow'] = 'Error: The contents of the field &quot;%field%&quot; are too long.'; 
    504505 
    505506?>