Changeset 71
- Timestamp:
- 2007-11-30 19:38:14 (1 year ago)
- Files:
-
- branches/5.0/admin/classes/pages/Settings.php (modified) (3 diffs)
- branches/5.0/classes/misc/Format.php (modified) (1 diff)
- branches/5.0/classes/misc/Forumjump.php (modified) (1 diff)
- branches/5.0/classes/misc/Postform.php (modified) (1 diff)
- branches/5.0/classes/pages/Category.php (modified) (2 diffs)
- branches/5.0/classes/pages/Page.php (modified) (1 diff)
- branches/5.0/classes/pages/Topic.php (modified) (1 diff)
- branches/5.0/db/spamboard.sql (modified) (3 diffs)
- branches/5.0/includes/checklogin.php (modified) (3 diffs)
- branches/5.0/includes/config/settings.tmpl (modified) (1 diff)
- branches/5.0/includes/config/version.php (modified) (1 diff)
- branches/5.0/includes/input.php (modified) (1 diff)
- branches/5.0/includes/js/js.js (modified) (4 diffs)
- branches/5.0/includes/lang/de.php (modified) (2 diffs)
- branches/5.0/includes/lang/en.php (modified) (1 diff)
- branches/5.0/includes/styles/default.css (modified) (2 diffs)
- branches/5.0/install.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/5.0/admin/classes/pages/Settings.php
r41 r71 32 32 public function __construct() { 33 33 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; 35 35 // define location and title parameter 36 36 $this->title = ''; … … 73 73 fwrite($file, "\$SETTINGS['floodcontrol'] = " . $newfloodcontrol . "; // number of seconds someone has to wait between two posts\n"); 74 74 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"); 75 76 fwrite($file, "\$SETTINGS['maxuploadsize'] = " . $newmaxuploadsize . "; // maximum file size of attachments in bytes\n"); 76 77 fwrite($file, "\$SETTINGS['uploadextensions'] = '" . $newuploadextensions . "'; // allowed file extensions for attachments (seperated by commas)\n"); … … 201 202 $form->addTableRow($LANG['Flood_Control'], 'text', 'newfloodcontrol', $SETTINGS['floodcontrol']); 202 203 $form->addTableRow($LANG['Flood_Control_search'], 'text', 'newfloodcontrol_search', $SETTINGS['floodcontrol_search']); 204 $form->addTableRow($LANG['Login_Attempts'], 'text', 'newloginattempts', $SETTINGS['loginattempts']); 203 205 $form->addTableRow($LANG['Max_attachment_size'], 'text', 'newmaxuploadsize', $SETTINGS['maxuploadsize']); 204 206 $form->addTableRow($LANG['Attachment_Extensions'], 'text', 'newuploadextensions', $SETTINGS['uploadextensions']); branches/5.0/classes/misc/Format.php
r24 r71 92 92 * 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... */ 93 93 $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>'); 95 95 // initialize string for comparison 96 96 $str_prev = ''; branches/5.0/classes/misc/Forumjump.php
r19 r71 36 36 public function __construct() { 37 37 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>'); 39 39 $_sel = '<select name="search_scope">'; 40 40 $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 119 119 } 120 120 $_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>')); 122 122 // poll choices 123 123 if ($show_orig === 'newpoll') { branches/5.0/classes/pages/Category.php
r58 r71 101 101 // get poster information 102 102 $_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>'; 104 104 } 105 105 /* new posts since user's last visit; … … 126 126 } 127 127 // 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>')); 129 129 } 130 130 } branches/5.0/classes/pages/Page.php
r40 r71 244 244 $i = 0; $n = 0; $_str = ''; 245 245 foreach ($rows as $row) { 246 if ($row ->onlinememberid> 0) {246 if ($row['onlinememberid'] > 0) { 247 247 // if it's a member 248 248 if ($i !=0 ) { branches/5.0/classes/pages/Topic.php
r19 r71 191 191 $this->html->body->addElement($_jump->get()); 192 192 // 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>'); 194 194 // show ALL moderation options at all times; authentication is done later 195 195 $_opt = $_mod->form->select->addChild('option', $LANG['Edit_Title']); branches/5.0/db/spamboard.sql
r33 r71 31 31 onlinetime INTEGER NOT NULL, 32 32 onlinesession VARCHAR(255) NOT NULL, 33 onlineposted INTEGER NOT NULL, 34 onlinelogins INTEGER NOT NULL 33 onlineposted INTEGER NOT NULL DEFAULT 0 35 34 ); 36 35 … … 49 48 poster VARCHAR(255) NOT NULL, 50 49 post TEXT NOT NULL, 51 ip VARCHAR( 255) NOT NULL,50 ip VARCHAR(16) NOT NULL, 52 51 attachment VARCHAR(255) NOT NULL, 53 52 postedbymember INTEGER NOT NULL, 54 edited datetimeDEFAULT NULL,53 edited DATETIME DEFAULT NULL, 55 54 editedby VARCHAR(255) DEFAULT NULL, 56 posttime datetimeNOT NULL,55 posttime DATETIME NOT NULL, 57 56 PRIMARY KEY (postid) 58 57 ); … … 88 87 memberhomepage VARCHAR(255) NULL, 89 88 memberavatar VARCHAR(255) NOT NULL DEFAULT 'images/spacer.gif', 90 memberpassword TEXTNOT NULL,89 memberpassword VARCHAR(255) NOT NULL, 91 90 memberstatus VARCHAR(255) NOT NULL, 92 91 memberposts INTEGER NOT NULL DEFAULT 0, branches/5.0/includes/checklogin.php
r4 r71 31 31 } 32 32 // check if user should be allowed even to TRY logging in 33 if ($ _COOKIE['sb_logins'] >= 3) { // check for cookie33 if ($SETTINGS['loginattempts'] > 0 && $_COOKIE['sb_logins'] >= $SETTINGS['loginattempts']) { // check for cookie 34 34 exit; 35 35 } else { // also check for sessions 36 if ($ _SESSION['loginattempts'] >= 3) {36 if ($SETTINGS['loginattempts'] > 0 && $_SESSION['loginattempts'] >= $SETTINGS['loginattempts']) { 37 37 exit; 38 38 } else { // finally, check with text log … … 46 46 $logindata = explode('|', $logins[$i]); 47 47 // 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']) { 49 49 $found = 1; 50 50 } … … 54 54 // blocked - copy information to cookie 55 55 $exp = time() + $SETTINGS['expire'] * 24 * 60 * 60; 56 setcookie('sb_logins', '3', $exp, '/');56 setcookie('sb_logins', $SETTINGS['loginattempts'], $exp, '/'); 57 57 } 58 58 } branches/5.0/includes/config/settings.tmpl
r38 r71 31 31 $SETTINGS['floodcontrol'] = 30; // number of seconds someone has to wait between two posts 32 32 $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) 33 34 $SETTINGS['maxuploadsize'] = 102400; // maximum file size of attachments in bytes 34 35 $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 28 28 * Also good: Spam Board Viking Edition 1.0 (then, you can do your own version numbering from there) */ 29 29 30 $VERSION = '5.0 RC 2';30 $VERSION = '5.0 RC3'; 31 31 32 32 ?> branches/5.0/includes/input.php
r38 r71 573 573 } 574 574 575 $newloginattempts = $_POST['newloginattempts']; 576 if (preg_match('/^[0-9]*$/', $newloginattempts) != 1) { 577 die($LANG['error_input']); 578 } 579 575 580 ?> branches/5.0/includes/js/js.js
r20 r71 76 76 // the textarea 77 77 var obj = document.getElementsByName('postform')[0].post; 78 if (obj.selectionStart ) {78 if (obj.selectionStart !== false) { 79 79 // Gecko / Opera 80 80 var start = obj.selectionStart; … … 84 84 var pos = start + smiley.length; 85 85 obj.setSelectionRange(pos, pos); 86 } else if (document.selection ) {86 } else if (document.selection !== false) { 87 87 // Internet Exploder (*choke*) 88 88 obj.focus(); … … 98 98 // the textarea 99 99 var obj = document.getElementsByName('postform')[0].post; 100 if (obj.selectionStart ) {100 if (obj.selectionStart !== false) { 101 101 // Gecko / Opera 102 102 var start = obj.selectionStart; … … 106 106 var pos = start + code.length + 2; 107 107 obj.setSelectionRange(pos, pos); 108 } else if (document.selection ) {108 } else if (document.selection !== false) { 109 109 // Internet Exploder (*choke*) 110 110 obj.focus(); branches/5.0/includes/lang/de.php
r42 r71 84 84 $LANG['members'] = 'Mitglieder'; 85 85 $LANG['and'] = 'und'; 86 $LANG['none'] = ' keine';86 $LANG['none'] = '-'; 87 87 $LANG['Statistics'] = 'Statistiken'; 88 88 $LANG['Register'] = 'Anmelden'; … … 306 306 $LANG['Set_Permissions'] = 'Rechte setzen?'; 307 307 $LANG['IP_Logging'] = 'IP-Logging'; 308 $LANG['Login_Attempts'] = 'Erlaubte Loginversuche (0 = unendlich)'; 308 309 309 310 /* actual sentences */ branches/5.0/includes/lang/en.php
r38 r71 307 307 $LANG['Set_Permissions'] = 'Set Permissions?'; 308 308 $LANG['IP_Logging'] = 'IP Logging'; 309 $LANG['Login_Attempts'] = 'Allowed Login Attempts (0 = infinite)'; 309 310 310 311 /* actual sentences */ branches/5.0/includes/styles/default.css
r58 r71 382 382 left:5%; 383 383 top:-1em; 384 display:inline; 384 385 } 385 386 … … 388 389 left:5%; 389 390 top:-0.8em; 391 display:inline; 390 392 } 391 393 branches/5.0/install.php
r41 r71 152 152 fwrite($file, "\$SETTINGS['floodcontrol'] = " . $SETTINGS['floodcontrol'] . "; // number of seconds someone has to wait between two posts\n"); 153 153 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"); 154 155 fwrite($file, "\$SETTINGS['maxuploadsize'] = " . $SETTINGS['maxuploadsize'] . "; // maximum file size of attachments in bytes\n"); 155 156 fwrite($file, "\$SETTINGS['uploadextensions'] = '" . $SETTINGS['uploadextensions'] . "'; // allowed file extensions for attachments (seperated by commas)\n");
