Changeset 11

Show
Ignore:
Timestamp:
2007-11-21 22:50:58 (5 years ago)
Author:
hannes
Message:

blind programming of an installer (ticket #8)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/classes/pages/Register.php

    r9 r11  
    9797                             * not every db supports this, but usually, it should work without locking, too; there just is the risk of a wrong member id being returned in the second query which is very unlikely - it can only occur on forums with very high traffic */ 
    9898                            @$C->query('LOCK TABLE ' . $SETTINGS['dbtableprefix'] . 'members WRITE'); 
    99                             $q = $C->prepare('INSERT INTO ' . $SETTINGS['dbtableprefix'] . 'members (membername, memberemail, memberpassword, registered, memberstatus, memberavatar) VALUES (:user, :email, :pw, :ts, :member, :avatar)'); 
     99                            $q = $C->prepare('INSERT INTO ' . $SETTINGS['dbtableprefix'] . 'members (membername, memberemail, memberpassword, registered, memberstatus) VALUES (:user, :email, :pw, :ts, :member)'); 
    100100                            // the actual password will be entered seperately 
    101101                            $_pw = '*'; 
    102102                            $_member = 'Member'; 
    103                             $_avatar = 'images/spacer.gif'; 
    104103                            $_t = new DateTime('now', new DateTimeZone('UTC')); 
    105104                            $q->bindParam(':user', $user, PDO::PARAM_STR); 
     
    108107                            $q->bindParam(':ts', $_t->format('Y-m-d H:i:s'), PDO::PARAM_STR, 19); 
    109108                            $q->bindParam(':member', $_member, PDO::PARAM_STR, 6); 
    110                             $q->bindParam(':avatar',$_avatar, PDO::PARAM_STR, 17); 
    111109                            $q->execute(); 
    112110                            $q = $C->query('SELECT MAX(memberid) AS id FROM ' . $SETTINGS['dbtableprefix'] . 'members'); 
     
    117115                            // set group membership to 'Member' 
    118116                            $q = $C->prepare('SELECT id FROM ' . $SETTINGS['dbtableprefix'] . 'usergroups WHERE name=:member'); 
    119                             $q->bindParam(':member', $_member,PDO::PARAM_STR,6); 
     117                            $q->bindParam(':member', $_member, PDO::PARAM_STR, 6); 
    120118                            $q->execute(); 
    121119                            $row2 = $q->fetchObject(); 
    122120                            $q = $C->prepare('INSERT INTO ' . $SETTINGS['dbtableprefix'] . 'groupmemberships (member, usergroup) VALUES (:member, :group)'); 
    123                             $q->bindParam(':member', $row->id,PDO::PARAM_INT, 12); 
    124                             $q->bindParam(':group', $row2->id,PDO::PARAM_INT, 12); 
     121                            $q->bindParam(':member', $row->id, PDO::PARAM_INT, 12); 
     122                            $q->bindParam(':group', $row2->id, PDO::PARAM_INT, 12); 
    125123                            $q->execute(); 
    126124                            // send e-mail 
  • trunk/db/spamboard.sql

    r9 r11  
    411411  memberemailhidden INTEGER NOT NULL DEFAULT 0, 
    412412  memberhomepage VARCHAR(255) NULL, 
    413   memberavatar VARCHAR(255) NOT NULL
     413  memberavatar VARCHAR(255) NOT NULL DEFAULT 'images/spacer.gif'
    414414  memberpassword TEXT NOT NULL, 
    415415  memberstatus VARCHAR(255) NOT NULL, 
     
    421421  signature VARCHAR(255) NULL, 
    422422  lastvisit DATETIME NOT NULL, 
    423   boardstyle VARCHAR(32) NOT NULL, 
    424   addressbook TEXT
     423  boardstyle VARCHAR(32) NULL, 
     424  addressbook TEXT NULL
    425425  birthday DATE DEFAULT NULL, 
    426426  messagenotification_email INTEGER NOT NULL DEFAULT 0, 
    427427  messagenotification_popup INTEGER NOT NULL DEFAULT 1, 
    428428  registered DATETIME NOT NULL, 
    429   salt VARCHAR(16) NOT NULL, 
    430   lang VARCHAR(16) NOT NULL, 
    431   offset INTEGER NOT NULL, 
     429  salt VARCHAR(16) NULL, 
     430  lang VARCHAR(16) NULL, 
     431  offset INTEGER NULL, 
    432432  PRIMARY KEY (memberid) 
    433433); 
  • trunk/includes/config/crypt.tmpl

    r1 r11  
    99 
    1010// cipher key (512 bytes); randomized on install time 
    11 $CIPHER['key'] = ''; 
     11$CIPHER['key'] = '%key%'; 
    1212 
    1313// padding for password hashes (512 bytes); randomized on install time 
    14 $HASH['padding'] = ''; 
     14$HASH['padding'] = '%padding%'; 
    1515 
    1616$HASH['salt_length'] = 8; 
  • trunk/includes/config/settings.tmpl

    r8 r11  
    1919$SETTINGS['slogan'] = 'The Tastiest Forum on Earth!'; // displayed in browser's title 
    2020$SETTINGS['forumlogo'] = 'logo.png'; // has to be placed in the images directory 
    21 $SETTINGS['sitename'] = ''; // name of the site the forum should link back to 
    22 $SETTINGS['siteurl'] = ''; // URL of the site the forum should link back to 
     21$SETTINGS['sitename'] = 'Spam Board Website'; // name of the site the forum should link back to 
     22$SETTINGS['siteurl'] = 'http://www.spamboard.net'; // URL of the site the forum should link back to 
    2323$SETTINGS['forumadmin'] = ''; // The admin's name. This'll be used to 'sign' all outgoing e-mail. 
    2424$SETTINGS['forumadminemail'] = ''; // e-mail address for outgoing mail 
  • trunk/includes/lang/en.php

    r9 r11  
    306306$LANG['Webserver_Path'] = 'Webserver Path'; 
    307307$LANG['New_Subscription'] = 'New Subscription'; 
     308$LANG['Spam_Board_Installer'] = 'Spam Board Installer'; 
     309$LANG['Start_Over'] = 'Start Over'; 
     310$LANG['Next_Page'] = 'Next Page'; 
     311$LANG['Set_Permissions'] = 'Set Permissions?'; 
    308312 
    309313/* actual sentences */ 
     
    379383$LANG['subscriptions_updated'] = 'Your subscriptions have been updated successfully.'; 
    380384$LANG['group_memberships_updated'] = 'Your group memberships have been updated successfully.'; 
     385$LANG['installer_intro'] = 'Hello and welcome to the Spam Board installer script! You are about to install version ' . $VERSION . " of this forum.<br /><br />We will ask you a few questions now. Don't worry, nothing will be committed before you had a chance to review all the options again. Please don't use your browser's back and forward buttons, as they'll break things. If you feel the need to change anything, you can start over at any time by using the respective button."; 
     386$LANG['installer_permissions'] = "To function properly, the board needs write permissions on certain directories and files. If your webserver runs on a UNIX-ish system, the script can attempt to set these permissions automatically for you. However, if you've just downloaded a release archive from the official website and extracted it directly on your webserver, this isn't necessary, as everything should already be set up correctly. If, however, you extracted the archive on another system (e.g. Microsoft Windows) first and uploaded the files to your webspace from there, the permissions have been lost. Check the box below if you want the script to set the permissions again."; 
     387$LANG['installer_database'] = "Now please enter some information about the database system you're going to use. If you select SQLite, you don't have to enter a username and password. For other database systems, the database you enter here already has to exist. The table prefix is put in front of the name of each table the board will create. This enabled you to run the board within a database which also contains other tables."; 
     388$LANG['installer_pathes'] = "Please enter two pathes which define the location you're installing the board to. The file system path is the board root in respect to the filesystem root. The web path is the directory tree after the top level domain (.com, .net, .org) to the board root. The installer script has already tried to guess them and entered these values into the respective fields. Usually, this should be correct. Only change these values if you know what you're doing."; 
     389$LANG['installer_board'] = "As you can see, it's getting less critical with every page. What you need to enter now is some general information about your forum and the site it should link back to."; 
     390$LANG['installer_admin_account'] = "This is the last page of the setup. You have to create an initial administrator account which you can use in the post-setup phase to customize everything even more. This account (including its e-mail address) will also be used to sign all outgoing mail. Of course, you can change these settings again later on. Finally, you have to select the hash algorithm which should be used to 'encrypt' the passwords. In case you don't know what that is, RIPEMD or SHA (greater 1) are common choices.<br /><br />After this page, you'll see all the settings you've chosen again and then you can choose whether to commit them or not."; 
     391$LANG['installer_overview'] = "Here's everything you entered once again. <i>Everything should have a value, with the exception of SQL username and password if you've selected SQLite!</i> If you've confirmed everything to be correct, proceed."; 
     392$LANG['installer_rewrite'] = "If you are running a webserver which is capable of URL rewriting, you can take advantage of that by using shorter URLs than otherwise. The installer script can set this up for you automatically if your webserver is Apache (requires mod_rewrite). Lighttpd can also rewrite your URLs, but you have to set up the rules for that webserver by hand for now. If you're unsure, don't select this, the board will run anyway then."; 
     393$LANG['installer_permissions_success'] = 'The file permissions have been set successfully.'; 
     394$LANG['installer_rewriting_success'] = 'URL Rewriting has been set up successfully.'; 
     395$LANG['installer_config_success'] = 'The configuration files have been set up successfully.'; 
     396$LANG['installer_database_success'] = 'The database has been set up successfully.'; 
     397$LANG['installer_overall_success'] = "Congratulations! Your Spam Board has been fully set up. If you didn't see any error messages or warnings, it should now be fully functional.<br /><br />You still have some work to do, of course:<ol><li>delete this installer script</li><li>go to %boardurl%</li><li>log in with the admin account you just created</li><li></li></ol>"; 
    381398 
    382399/* error messages */ 
     
    429446$LANG['error_avatar_filename'] = "Error: A file with the same name as the one you tried to upload already exists among the avatars. Please rename it and try again."; 
    430447$LANG['error_avatar_move'] = "Error: Something unforseen went wrong with the upload. Please try again. If this error persists, contact the administrators."; 
     448$LANG['error_installer_permissions'] = "Error: Couldn't set file permissions. Please do it manually. Aborting."; 
     449$LANG['error_installer_rewriting'] = "Error: URL Rewriting couldn't be set up. Please do it manually or restart the installation without it. Aborting."; 
     450$LANG['error_installer_config'] = "Error: The configuration files couldn't be set up correctly. Aborting."; 
     451$LANG['error_installer_database'] = "Error: The database couldn't be set up correctly. Aborting."; 
    431452 
    432453?>