Changeset 71

Show
Ignore:
Timestamp:
2007-11-30 19:38:14 (1 year ago)
Author:
hannes
Message:

merging changesets [60] to [70]; upgrading to version 5.0 RC3

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/5.0/admin/classes/pages/Settings.php

    r41 r71  
    3232    public function __construct() { 
    3333        global $LANG, $C, $F, $SETTINGS, $LANG; 
    34         global $commit, $newsqltype, $newsqlhost, $newsqluser, $newsqlpassword, $newdbname, $newdbtableprefix, $newforumname, $newslogan, $newforumlogo, $newsitename, $newsiteurl, $newforumadmin, $newforumadminemail, $newtopicsperpage, $newpostsperpage, $newmaxavatarsize, $newguestemail, $newfloodcontrol, $newfloodcontrol_search, $newmaxuploadsize, $newuploadextensions, $newlanguage, $newurl_rewriting, $newtimezone, $newencoding, $newdefaultstyle, $newexpire, $newdebug, $newhash, $newseveralaccountspermail, $newmaintainancemode, $newfspath, $newwebpath, $newpolls, $newip_logging
     34        global $commit, $newsqltype, $newsqlhost, $newsqluser, $newsqlpassword, $newdbname, $newdbtableprefix, $newforumname, $newslogan, $newforumlogo, $newsitename, $newsiteurl, $newforumadmin, $newforumadminemail, $newtopicsperpage, $newpostsperpage, $newmaxavatarsize, $newguestemail, $newfloodcontrol, $newfloodcontrol_search, $newmaxuploadsize, $newuploadextensions, $newlanguage, $newurl_rewriting, $newtimezone, $newencoding, $newdefaultstyle, $newexpire, $newdebug, $newhash, $newseveralaccountspermail, $newmaintainancemode, $newfspath, $newwebpath, $newpolls, $newip_logging, $newloginattempts
    3535        // define location and title parameter 
    3636        $this->title = ''; 
     
    7373                    fwrite($file, "\$SETTINGS['floodcontrol'] = " . $newfloodcontrol . "; // number of seconds someone has to wait between two posts\n"); 
    7474                    fwrite($file, "\$SETTINGS['floodcontrol_search'] = " . $newfloodcontrol_search . "; // number of seconds someone has to wait between two searches\n"); 
     75                    fwrite($file, "\$SETTINGS['loginattempts'] = " . $newloginattempts . "; // number of failed login attempts by a user after which the board will try to lock him or her out for good (set to 0 to disable)\n"); 
    7576                    fwrite($file, "\$SETTINGS['maxuploadsize'] = " . $newmaxuploadsize . "; // maximum file size of attachments in bytes\n"); 
    7677                    fwrite($file, "\$SETTINGS['uploadextensions'] = '" . $newuploadextensions . "'; // allowed file extensions for attachments (seperated by commas)\n"); 
     
    201202                $form->addTableRow($LANG['Flood_Control'], 'text', 'newfloodcontrol', $SETTINGS['floodcontrol']); 
    202203                $form->addTableRow($LANG['Flood_Control_search'], 'text', 'newfloodcontrol_search', $SETTINGS['floodcontrol_search']); 
     204                $form->addTableRow($LANG['Login_Attempts'], 'text', 'newloginattempts', $SETTINGS['loginattempts']); 
    203205                $form->addTableRow($LANG['Max_attachment_size'], 'text', 'newmaxuploadsize', $SETTINGS['maxuploadsize']); 
    204206                $form->addTableRow($LANG['Attachment_Extensions'], 'text', 'newuploadextensions', $SETTINGS['uploadextensions']); 
  • branches/5.0/classes/misc/Format.php

    r24 r71  
    9292         * The string contained between opening and closing board tag will automatically appear between opening and closing HTML part anyway. Note that I wrote 'HTML part', not 'tag', since in some cases (e.g. images), the latter doesn't apply. If you're planning to add more code tags, just look at the existing ones and you should understand the different ways to use those definitions to the best effect... */ 
    9393        $tags_open_html = Array('<b>', '<i>', '<u>', '<s>', '<span style="color:%%">', '<span style="font-size:%%px">', '<span style="font-family:%%">', '<div align="%%">', '<div class="quote1">' . $LANG['Quote'] . ':</div><div class="quote">', '<div class="code1">' . $LANG['Code'] . ':</div><pre class="code">', '<img src="', '<a target="_blank" href="', '<a target="_blank" href="%%">', '<a href="mailto:', '<a href="mailto:%%">'); 
    94         $tags_close_html = Array('</b>', '</i>', '</u>', '<s>', '</span>', '</span>', '</span>', '</div>', '</div>', '</pre>', '" %% alt="' . $LANG['Image'] . '" />', '">%%</a>', '</a>', '">%%</a>', '</a>'); 
     94        $tags_close_html = Array('</b>', '</i>', '</u>', '</s>', '</span>', '</span>', '</span>', '</div>', '</div>', '</pre>', '" %% alt="' . $LANG['Image'] . '" />', '">%%</a>', '</a>', '">%%</a>', '</a>'); 
    9595        // initialize string for comparison 
    9696        $str_prev = ''; 
  • branches/5.0/classes/misc/Forumjump.php

    r19 r71  
    3636    public function __construct() { 
    3737        global $F, $LANG, $C, $SETTINGS; 
    38         $this->html = new XMLElement('<span id="forumjump"><form action="redirectors/forumjump.php" method="post"></form></span>'); 
     38        $this->html = new XMLElement('<div id="forumjump"><form action="redirectors/forumjump.php" method="post"></form></div>'); 
    3939        $_sel = '<select name="search_scope">'; 
    4040        $q = $C->prepare('SELECT category_id, category_name FROM ' . $SETTINGS['dbtableprefix'] . 'categories ORDER BY category_order ASC'); 
  • branches/5.0/classes/misc/Postform.php

    r35 r71  
    119119        } 
    120120        $_col1 .= '</td>'; 
    121         $this->form->addRawTableRow(Array($_col1, '<td><textarea name="post" cols="50" rows="15" wrap="virtual">' . $quote . '</textarea></td>')); 
     121        $this->form->addRawTableRow(Array($_col1, '<td><textarea name="post" cols="50" rows="15">' . $quote . '</textarea></td>')); 
    122122        // poll choices 
    123123        if ($show_orig === 'newpoll') { 
  • branches/5.0/classes/pages/Category.php

    r58 r71  
    101101                        // get poster information 
    102102                        $_poster = new Member($row5->poster, $row5->postedbymember); 
    103                         $_col4 = $LANG['by'] . ' ' . $_poster->getProfileLink() . '</div><div>' . $LANG['in'] . ' <a href="' . $F->link('topic') . 'id=' . $row5->topicid . '">' . $row5->topictitle . '</a>'; 
     103                        $_col4 = '<div>' . $LANG['by'] . ' ' . $_poster->getProfileLink() . '</div><div>' . $LANG['in'] . ' <a href="' . $F->link('topic') . 'id=' . $row5->topicid . '">' . $row5->topictitle . '</a></div><div>' . $F->datetime($row5->posttime) . '</div>'; 
    104104                    } 
    105105                    /* new posts since user's last visit; 
     
    126126                    } 
    127127                    // show forum overview 
    128                     $table->addRow(Array($_mark, '<td><h3><a href="' . $F->link('forum') . 'id=' . $row2['forumid'] . '">' . $row2['forumtitle'] . '</a></h3>' . $_mods . $row2['forumdescription'] . '</td>', '<td align="center">' . $row3->topics . '</td>', '<td align="center">' . $row4->posts . '</td>', '<td><div>' . $_col4  . '</div><div>' . $F->datetime($row5->posttime) . '</div></td>')); 
     128                    $table->addRow(Array($_mark, '<td><h3><a href="' . $F->link('forum') . 'id=' . $row2['forumid'] . '">' . $row2['forumtitle'] . '</a></h3>' . $_mods . $row2['forumdescription'] . '</td>', '<td align="center">' . $row3->topics . '</td>', '<td align="center">' . $row4->posts . '</td>', '<td>' . $_col4  . '</td>')); 
    129129                } 
    130130            } 
  • branches/5.0/classes/pages/Page.php

    r40 r71  
    244244                $i = 0; $n = 0; $_str = ''; 
    245245                foreach ($rows as $row) { 
    246                     if ($row->onlinememberid > 0) { 
     246                    if ($row['onlinememberid'] > 0) { 
    247247                        // if it's a member 
    248248                        if ($i !=0 ) { 
  • branches/5.0/classes/pages/Topic.php

    r19 r71  
    191191            $this->html->body->addElement($_jump->get()); 
    192192            // moderation 
    193             $_mod = new XMLElement('<span id="moderation"><form action="' . $F->link('moderate') . 'id=' . $id . '" method="post"><select name="all"></select></form></span>'); 
     193            $_mod = new XMLElement('<div id="moderation"><form action="' . $F->link('moderate') . 'id=' . $id . '" method="post"><select name="all"></select></form></div>'); 
    194194            // show ALL moderation options at all times; authentication is done later 
    195195            $_opt = $_mod->form->select->addChild('option', $LANG['Edit_Title']); 
  • branches/5.0/db/spamboard.sql

    r33 r71  
    3131  onlinetime INTEGER NOT NULL, 
    3232  onlinesession VARCHAR(255) NOT NULL, 
    33   onlineposted INTEGER NOT NULL, 
    34   onlinelogins INTEGER NOT NULL 
     33  onlineposted INTEGER NOT NULL DEFAULT 0 
    3534); 
    3635 
     
    4948  poster VARCHAR(255) NOT NULL, 
    5049  post TEXT NOT NULL, 
    51   ip VARCHAR(255) NOT NULL, 
     50  ip VARCHAR(16) NOT NULL, 
    5251  attachment VARCHAR(255) NOT NULL, 
    5352  postedbymember INTEGER NOT NULL, 
    54   edited datetime DEFAULT NULL, 
     53  edited DATETIME DEFAULT NULL, 
    5554  editedby VARCHAR(255) DEFAULT NULL, 
    56   posttime datetime NOT NULL, 
     55  posttime DATETIME NOT NULL, 
    5756  PRIMARY KEY  (postid) 
    5857); 
     
    8887  memberhomepage VARCHAR(255) NULL, 
    8988  memberavatar VARCHAR(255) NOT NULL DEFAULT 'images/spacer.gif', 
    90   memberpassword TEXT NOT NULL, 
     89  memberpassword VARCHAR(255) NOT NULL, 
    9190  memberstatus VARCHAR(255) NOT NULL, 
    9291  memberposts INTEGER NOT NULL DEFAULT 0, 
  • branches/5.0/includes/checklogin.php

    r4 r71  
    3131} 
    3232// check if user should be allowed even to TRY logging in 
    33 if ($_COOKIE['sb_logins'] >= 3) { // check for cookie 
     33if ($SETTINGS['loginattempts'] > 0 && $_COOKIE['sb_logins'] >= $SETTINGS['loginattempts']) { // check for cookie 
    3434    exit; 
    3535} else { // also check for sessions 
    36     if ($_SESSION['loginattempts'] >= 3) { 
     36    if ($SETTINGS['loginattempts'] > 0 && $_SESSION['loginattempts'] >= $SETTINGS['loginattempts']) { 
    3737        exit; 
    3838    } else { // finally, check with text log 
     
    4646            $logindata = explode('|', $logins[$i]); 
    4747            // IP of visitor matches entry? 
    48             if ($logindata[0] == $_SERVER['REMOTE_ADDR'] && $logindata[1] >= 3) { 
     48            if ($logindata[0] == $_SERVER['REMOTE_ADDR'] && $SETTINGS['loginattempts'] > 0 && $logindata[1] >= $SETTINGS['loginattempts']) { 
    4949                $found = 1; 
    5050            } 
     
    5454            // blocked - copy information to cookie 
    5555            $exp = time() + $SETTINGS['expire'] * 24 * 60 * 60; 
    56             setcookie('sb_logins', '3', $exp, '/'); 
     56            setcookie('sb_logins', $SETTINGS['loginattempts'], $exp, '/'); 
    5757        } 
    5858    } 
  • branches/5.0/includes/config/settings.tmpl

    r38 r71  
    3131$SETTINGS['floodcontrol'] = 30; // number of seconds someone has to wait between two posts 
    3232$SETTINGS['floodcontrol_search'] = 15; // number of seconds someone has to wait between two searches 
     33$SETTINGS['loginattempts'] = 5; // number of failed login attempts by a user after which the board will try to lock him or her out for good (set to 0 to disable) 
    3334$SETTINGS['maxuploadsize'] = 102400; // maximum file size of attachments in bytes 
    3435$SETTINGS['uploadextensions'] = '.gif,.jpg,.jpeg,.bmp,.png,.zip,.rar,.ace,.7z,.txt,.rtf'; // allowed file extensions for attachments (seperated by commas) 
  • branches/5.0/includes/config/version.php

    r58 r71  
    2828 * Also good: Spam Board Viking Edition 1.0 (then, you can do your own version numbering from there) */ 
    2929 
    30 $VERSION = '5.0 RC2'; 
     30$VERSION = '5.0 RC3'; 
    3131 
    3232?> 
  • branches/5.0/includes/input.php

    r38 r71  
    573573} 
    574574 
     575$newloginattempts = $_POST['newloginattempts']; 
     576if (preg_match('/^[0-9]*$/', $newloginattempts) != 1) { 
     577    die($LANG['error_input']); 
     578} 
     579 
    575580?> 
  • branches/5.0/includes/js/js.js

    r20 r71  
    7676    // the textarea 
    7777    var obj = document.getElementsByName('postform')[0].post; 
    78     if (obj.selectionStart) { 
     78    if (obj.selectionStart !== false) { 
    7979        // Gecko / Opera 
    8080        var start = obj.selectionStart; 
     
    8484        var pos = start + smiley.length; 
    8585        obj.setSelectionRange(pos, pos); 
    86     } else if (document.selection) { 
     86    } else if (document.selection !== false) { 
    8787        // Internet Exploder (*choke*) 
    8888        obj.focus(); 
     
    9898    // the textarea 
    9999    var obj = document.getElementsByName('postform')[0].post; 
    100     if (obj.selectionStart) { 
     100    if (obj.selectionStart !== false) { 
    101101        // Gecko / Opera 
    102102        var start = obj.selectionStart; 
     
    106106        var pos = start + code.length + 2; 
    107107        obj.setSelectionRange(pos, pos); 
    108     } else if (document.selection) { 
     108    } else if (document.selection !== false) { 
    109109        // Internet Exploder (*choke*) 
    110110        obj.focus(); 
  • branches/5.0/includes/lang/de.php

    r42 r71  
    8484$LANG['members'] = 'Mitglieder'; 
    8585$LANG['and'] = 'und'; 
    86 $LANG['none'] = 'keine'; 
     86$LANG['none'] = '-'; 
    8787$LANG['Statistics'] = 'Statistiken'; 
    8888$LANG['Register'] = 'Anmelden'; 
     
    306306$LANG['Set_Permissions'] = 'Rechte setzen?'; 
    307307$LANG['IP_Logging'] = 'IP-Logging'; 
     308$LANG['Login_Attempts'] = 'Erlaubte Loginversuche (0 = unendlich)'; 
    308309 
    309310/* actual sentences */ 
  • branches/5.0/includes/lang/en.php

    r38 r71  
    307307$LANG['Set_Permissions'] = 'Set Permissions?'; 
    308308$LANG['IP_Logging'] = 'IP Logging'; 
     309$LANG['Login_Attempts'] = 'Allowed Login Attempts (0 = infinite)'; 
    309310 
    310311/* actual sentences */ 
  • branches/5.0/includes/styles/default.css

    r58 r71  
    382382    left:5%; 
    383383    top:-1em; 
     384    display:inline; 
    384385} 
    385386 
     
    388389    left:5%; 
    389390    top:-0.8em; 
     391    display:inline; 
    390392} 
    391393 
  • branches/5.0/install.php

    r41 r71  
    152152                    fwrite($file, "\$SETTINGS['floodcontrol'] = " . $SETTINGS['floodcontrol'] . "; // number of seconds someone has to wait between two posts\n"); 
    153153                    fwrite($file, "\$SETTINGS['floodcontrol_search'] = " . $SETTINGS['floodcontrol_search'] . "; // number of seconds someone has to wait between two searches\n"); 
     154                    fwrite($file, "\$SETTINGS['loginattempts'] = " . $SETTINGS['loginattempts'] . "; // number of failed login attempts by a user after which the board will try to lock him or her out for good (set to 0 to disable)\n"); 
    154155                    fwrite($file, "\$SETTINGS['maxuploadsize'] = " . $SETTINGS['maxuploadsize'] . "; // maximum file size of attachments in bytes\n"); 
    155156                    fwrite($file, "\$SETTINGS['uploadextensions'] = '" . $SETTINGS['uploadextensions'] . "'; // allowed file extensions for attachments (seperated by commas)\n");