Revision 3
Added by Manuela over 8 years ago
| branches/main/DOCU/CHANGELOG | ||
|---|---|---|
| 1 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 2 | follow the changelog at http://project.websitebaker.org/ please!! | |
| 3 | there you can see anything what's changed and also how exactely it's done | |
| 4 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 5 |  | |
| branches/main/DOCU/README.EN | ||
|---|---|---|
| 1 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 2 | [1] General Information about version 2.10.x | |
| 3 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 4 |  | |
| 5 | WB-2.10 is the compatible follow up of all previous WB-2.8.3 releases. | |
| 6 | This packet includes all you need to run a website. In addition to the core you get a basic | |
| 7 | collection of add-ons. | |
| 8 | You also get all needed 3rd party packages like PHPMailer, pclzip, phplib, Twig, JQuery and more. | |
| 9 |  | |
| 10 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 11 | [2] Requirements | |
| 12 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 13 |  | |
| 14 | WebsiteBaker is developed in a Linux & Apache environment, therefore we can not give any | |
| 15 | guarantee that it will work without any problem in a Windows(r) Environment. | |
| 16 |  | |
| 17 | Operating system: Linux (recommended), Windows (maybe) | |
| 18 | Database : MySQL 5.5 / MariaDB 5.5 and up | |
| 19 | Webserver : Apache | |
| 20 | PHP : 5.6 and up, PHP-7 up (FastCGI, FPM) recommended | |
| 21 | !!! PHP running as Apache-Module (mod_php) can produce malfunctions in WebsiteBaker !!! | |
| 22 | Diskspace : 25MB and up | |
| 23 |  | |
| 24 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 25 | [3] Instructions for Installing WebsiteBaker 2.10 | |
| 26 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 27 |  | |
| 28 | This install pack includes a complete WebsiteBaker version 2.10.0 and can be installed | |
| 29 | on all compatible hosts. | |
| 30 |  | |
| 31 | a) Check that your webspace meets the requirements described above! | |
| 32 |  | |
| 33 | b) Make sure that you have a MySQL database available and obtain the access data! | |
| 34 |  | |
| 35 | c) Download the packet to your workstation and unzip all into an empty folder. | |
| 36 |  | |
| 37 | d) Move all to your webspace using ftp and 'overwrite all' setting. | |
| 38 |  | |
| 39 | e) switch the PHP version to 5.6 or 7.x if it's not already done. | |
| 40 |  | |
| 41 | f) now simply call your installation like http://example.com/ and follow the | |
| 42 | instructions of the install script. | |
| 43 |  | |
| 44 |  | |
| 45 | Enjoy your new WebsiteBaker installation! | |
| 46 |  | |
| 47 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 48 | [4] Upgrade WebsiteBaker from any versions of WB-2.8.3 | |
| 49 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 50 |  | |
| 51 | This install pack includes a complete WebsiteBaker version 2.10.0 and can be installed | |
| 52 | on all previously published WB 2.8.3 versions (with or without Service Pack). Additional | |
| 53 | Instructions for upgrading WebsiteBaker versions older than 2.8.3 can be found at [5]. | |
| 54 |  | |
| 55 | a) IMPORTANT:: in any case make a backup of your webspace and the database too !!! | |
| 56 |  | |
| 57 | b) Download the packet to your workstation and unzip all into an empty folder. | |
| 58 |  | |
| 59 | c) Move all to your webspace using ftp and 'overwrite all' setting. | |
| 60 |  | |
| 61 | d) switch the PHP version to 5.6 or 7.x if it's not already done. | |
| 62 |  | |
| 63 | e) now start the upgrade-script.php file and follow possible instructions. | |
| 64 |  | |
| 65 | f) some add-on pakets are not delivered with this version and must be upgraded manually. | |
| 66 | Some new versions are available on http://addon.websitebaker.org/ | |
| 67 |  | |
| 68 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 69 | [5] Upgrade WebsiteBaker from older versions before WB-2.8.3 | |
| 70 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 71 |  | |
| 72 | Before you upgrade from an older version, first you must upgrade to [WB 2.8.3 from Feb.2012]. | |
| 73 | That version is downloadable from either of these links: | |
| 74 | http://addon.websitebaker.org/pages/en/browse-add-ons.php?id=0EA85F12 or | |
| 75 | http://wiki.websitebaker.org/doku.php/en/downloads#websitebaker_283 | |
| 76 |  | |
| 77 | Instructions for upgrading to WB-2.8.3 can be found in our forum: | |
| 78 | english: http://forum.websitebaker.org/index.php/topic,23412 | |
| 79 | german: http://forum.websitebaker.org/index.php/topic,23658 | |
| 80 |  | |
| 81 |  | |
| branches/main/DOCU/README.NL | ||
|---|---|---|
| 1 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 2 | [1] Algemene informatie over WebsiteBaker versie 2.10.x | |
| 3 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 4 |  | |
| 5 | WB-2.10 is de compatibel opvolger van alle voorgaande WB-2.8.3-versies. | |
| 6 | Dit pakket bevat alles wat u nodig heeft om een website op te zetten. | |
| 7 | Behalve de basis van het CMS bevat dit pakket tevens een collectie add-ons. | |
| 8 | Ook de benodigde 'third-party' pakketten als PHPMailer, pclzip, Twig, | |
| 9 | JQuery etc. zijn in deze softwarebundel opgenomen. | |
| 10 |  | |
| 11 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 12 | [2] Vereisten | |
| 13 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 14 |  | |
| 15 | WebsiteBaker is ontwikkeld in een Linux + Apache-omgeving. Er kunnen geen | |
| 16 | garanties worden gegeven dat het CMS probleemloos zal werken in een | |
| 17 | Windows-omgeving. | |
| 18 |  | |
| 19 | Besturingssysteem: Linux (aanbevolen), Windows (misschien) | |
| 20 | Database : mySQL 5.6 en hoger | |
| 21 | Webserver : Apache | |
| 22 | PHP : 5.6 en hoger, PHP-7 en hoger aanbevolen | |
| 23 | Als PHP draait als Apache-module kan dit een verstoorde | |
| 24 | werking van WebsiteBaker veroorzaken!! | |
| 25 | Schijfruimte : 25MB en hoger | |
| 26 |  | |
| 27 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 28 | [3] Instructies voor het installeren van WebsiteBaker 2.10 | |
| 29 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 30 |  | |
| 31 | Dit installatiepakket bevat een complete versie van WebsiteBaker 2.10 en | |
| 32 | kan worden geïnstalleerd op elke compatible host. | |
| 33 |  | |
| 34 | a) Verzeker u ervan dat uw webruimte voldoet aan de eisen die hierboven | |
| 35 | beschreven staan! | |
| 36 |  | |
| 37 | b) Verzeker u ervan dat u een MySQL-database beschikbaar hebt en dat u | |
| 38 | beschikt over de databasenaam, servernaam, gebruiker en wachtwoord. | |
| 39 |  | |
| 40 | c) Download het pakket naar uw eigen PC en pak het ZIP-bestand uit in een | |
| 41 | nieuwe, lege map. | |
| 42 |  | |
| 43 | d) Kopieer alle bestanden via FTP naar uw webruimte en verzeker u ervan | |
| 44 | dat daarbij eventuele bestaande bestanden worden overschreven. | |
| 45 |  | |
| 46 | e) Zet de PHP-versie van uw webhosting naar 5.6 of 7.x (aanbevolen!) als | |
| 47 | dat al niet is gedaan. | |
| 48 |  | |
| 49 | f) Ga met een webbrowser naar het domein (bijv. http://www.uwdomein.nl) | |
| 50 | en het installatiescript zal automatisch starten. | |
| 51 |  | |
| 52 |  | |
| 53 | Veel plezier van uw nieuwe WebsiteBaker-installatie! | |
| 54 |  | |
| 55 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 56 | [4] WebsiteBaker upgraden vanaf elke versie van WB-2.8.3 | |
| 57 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 58 |  | |
| 59 | Dit installatiepakket bevat een complete WebsiteBaker versie 2.10 en kan | |
| 60 | worden geïnstalleerd op elke voorgaand uitgebrachte WB 2.8.3-versie (met | |
| 61 | of zonder Service Pack). Aanvullende instructies voor het upgraden van | |
| 62 | WebsiteBaker-versies ouder dan 2.8.3 kunt u lezen onder [5]. | |
| 63 |  | |
| 64 | a) BELANGRIJK: maak een backup van de bestanden in uw webruimte en de | |
| 65 | database! | |
| 66 |  | |
| 67 | b) Download het pakket naar uw eigen PC en pak het ZIP-bestand uit in een | |
| 68 | nieuwe, lege map. | |
| 69 |  | |
| 70 | c) Kopieer alle bestanden via FTP naar uw webruimte en verzeker u ervan | |
| 71 | dat daarbij eventuele bestaande bestanden worden overschreven. | |
| 72 |  | |
| 73 | d) Zet de PHP-versie van uw webhosting naar 5.6 of 7.x (aanbevolen!) als | |
| 74 | dat al niet is gedaan. | |
| 75 |  | |
| 76 | e) Ga met een webbrowser naar http:/www.uwdomein.nl/upgrade-script.php en | |
| 77 | volg de instructies. | |
| 78 |  | |
| 79 | f) Sommige aanvullende pakketten worden niet meegeleverd met deze versie | |
| 80 | en moeten handmatig worden bijgewerkt. Eventuele nieuwe versies kunt u | |
| 81 | vinden op http://addon.websitebaker.org/ | |
| 82 |  | |
| 83 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 84 | [5] WebsiteBaker upgraden van oudere versies (voor WB-2.8.3) | |
| 85 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| 86 |  | |
| 87 | Voordat u vanaf een oudere versie kunt upgraden naar WB-2.1.0, moet u uw | |
| 88 | installatie bijwerken naar WB-2.8.3 (van februari 2012). | |
| 89 | Deze versie is te downloaden van de volgende links: | |
| 90 | http://addon.websitebaker.org/pages/en/browse-add-ons.php?id=0EA85F12 of | |
| 91 | http://wiki.websitebaker.org/doku.php/en/downloads#websitebaker_283 | |
| 92 |  | |
| 93 | Instructies voor het upgraden naar WB-2.8.3 kunnen worden gevonden in ons | |
| 94 | forum: | |
| 95 | Engels: http://forum.websitebaker.org/index.php/topic,23412 | |
| 96 | Duits: http://forum.websitebaker.org/index.php/topic,23658 | |
| 97 |  | |
| 98 |  | |
| 99 |  | |
| branches/main/account/details.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright Ryan Djurovich | |
| 8 | * @copyright WebsiteBaker Org. e.V. | |
| 9 | * @link http://websitebaker.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.3 | |
| 12 | * @requirements PHP 5.3.6 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | // Must include code to stop this file being access directly | |
| 20 | if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
 | |
| 21 | // sanitize entered values | |
| 22 |     $display_name = strip_tags( $wb->StripCodeFromText($wb->get_post('display_name')));
 | |
| 23 | $display_name = ( $display_name == '' ? $wb->get_display_name() : $display_name ); | |
| 24 |     $language = preg_match('/^[a-z]{2}$/si', $wb->get_post('language'))
 | |
| 25 |                 ? $wb->get_post('language') : 'EN';
 | |
| 26 | $user_time = true; | |
| 27 | // timezone must be between -12 and +13 or -20 as system_default | |
| 28 |     $timezone         = $wb->get_post('timezone');
 | |
| 29 | $timezone = (is_numeric($timezone) ? $timezone : DEFAULT_TIMEZONE/3600); | |
| 30 | $timezone = (($timezone >= -12 && $timezone <= 13) ? $timezone : DEFAULT_TIMEZONE/3600) * 3600; | |
| 31 |  | |
| 32 | /* | |
| 33 |     $timezone    = $wb->get_post('timezone');
 | |
| 34 |     $timezone    = is_numeric($wb->get_post('timezone')) ? $wb->get_post('timezone')*3600 : 0;
 | |
| 35 | $timezone = (is_numeric($timezone) ? $timezone : DEFAULT_TIMEZONE/3600); | |
| 36 | $timezone = (($timezone >= -12 && $timezone <= 13) ? $timezone : DEFAULT_TIMEZONE/3600) * 3600; | |
| 37 | */ | |
| 38 |     $date_format = $wb->get_post('date_format');
 | |
| 39 |     $time_format = $wb->get_post('time_format');
 | |
| 40 | // check that display_name is unique in whoole system (prevents from User-faking) | |
| 41 | $sql = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'users` '; | |
| 42 | $sql .= 'WHERE `user_id` <> '.(int)$wb->get_user_id().' AND `display_name` LIKE \''.$display_name.'\''; | |
| 43 |     if ($database->get_one($sql)) {
 | |
| 44 |         $error[] = ( @$oTrans->MESSAGE_USERS_DISPLAYNAME_TAKEN ?:$oTrans->MESSAGE_MEDIA_BLANK_NAME.' ('.$oTrans->TEXT_DISPLAY_NAME.')');
 | |
| 45 |     } else {
 | |
| 46 | // Update the database | |
| 47 | $sql = 'UPDATE `'.TABLE_PREFIX.'users` SET ' | |
| 48 | . '`display_name` = \''.$database->escapeString($display_name).'\', ' | |
| 49 | . '`language` = \''.$database->escapeString($language).'\', ' | |
| 50 | . '`timezone` = \''.$database->escapeString($timezone).'\', ' | |
| 51 | . '`date_format` = \''.$database->escapeString($date_format).'\', ' | |
| 52 | . '`time_format` = \''.$database->escapeString($time_format).'\' ' | |
| 53 | . 'WHERE `user_id` = \''.$wb->get_user_id().'\''; | |
| 54 | $database->query($sql); | |
| 55 |           if($database->is_error()) {
 | |
| 56 | $error[] = $database->get_error(); | |
| 57 |           } else {
 | |
| 58 | $success[] = $oTrans->MOD_PREFERENCE_DETAILS_SAVED; | |
| 59 | $_SESSION['DISPLAY_NAME'] = $display_name; | |
| 60 | $_SESSION['LANGUAGE'] = $language; | |
| 61 | $_SESSION['TIMEZONE'] = $timezone; | |
| 62 | // Update date format | |
| 63 |               if($date_format != '') {
 | |
| 64 | $_SESSION['DATE_FORMAT'] = $date_format; | |
| 65 |                   if(isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) { unset($_SESSION['USE_DEFAULT_DATE_FORMAT']); }
 | |
| 66 |               } else {
 | |
| 67 | $_SESSION['USE_DEFAULT_DATE_FORMAT'] = true; | |
| 68 |                   if(isset($_SESSION['DATE_FORMAT'])) { unset($_SESSION['DATE_FORMAT']); }
 | |
| 69 | } | |
| 70 |  | |
| 71 | // Update time format | |
| 72 |             if($time_format != '') {
 | |
| 73 | $_SESSION['TIME_FORMAT'] = $time_format; | |
| 74 |                 if(isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) { unset($_SESSION['USE_DEFAULT_TIME_FORMAT']); }
 | |
| 75 |             } else {
 | |
| 76 | $_SESSION['USE_DEFAULT_TIME_FORMAT'] = true; | |
| 77 |                 if(isset($_SESSION['TIME_FORMAT'])) { unset($_SESSION['TIME_FORMAT']); }
 | |
| 78 | } | |
| 79 | } | |
| 80 | } | |
| 0 | 81 | |
| branches/main/account/email.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright 2004-2009, Ryan Djurovich | |
| 8 | * @copyright 2009-2011, Website Baker Org. e.V. | |
| 9 | * @link http://www.websitebaker2.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.x | |
| 12 | * @requirements PHP 5.2.2 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | // Must include code to stop this file being access directly | |
| 20 | if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
 | |
| 21 |  | |
| 22 | // Get entered values | |
| 23 |     $password = $wb->get_post('current_password');
 | |
| 24 |     $email = $wb->get_post('email');
 | |
| 25 | // validate password | |
| 26 | $sql = 'SELECT `user_id` FROM `'.TABLE_PREFIX.'users` ' | |
| 27 | . 'WHERE `user_id` = '.$wb->get_user_id().' AND `password` = \''.md5($password).'\''; | |
| 28 | $rowset = $database->query($sql); | |
| 29 | // Validate values | |
| 30 |     if($rowset->numRows() == 0) {
 | |
| 31 | $error[] = $MESSAGE['PREFERENCES_CURRENT_PASSWORD_INCORRECT']; | |
| 32 |     }else {
 | |
| 33 |         if(!$wb->validate_email($email)) {
 | |
| 34 | $error[] = $MESSAGE['USERS_INVALID_EMAIL']; | |
| 35 |         }else {
 | |
| 36 | $email = $wb->add_slashes($email); | |
| 37 | // Update the database | |
| 38 | $sql = 'UPDATE `'.TABLE_PREFIX.'users` ' | |
| 39 | . 'SET `email` = \''.$database->escapeString($email).'\' ' | |
| 40 | . 'WHERE `user_id` = \''.$wb->get_user_id().'\''; | |
| 41 | $database->query($sql); | |
| 42 |             if($database->is_error()) {
 | |
| 43 | $error[] = $database->get_error(); | |
| 44 |             } else {
 | |
| 45 | $success[] = $MESSAGE['PREFERENCES_EMAIL_UPDATED']; | |
| 46 | $_SESSION['EMAIL'] = $email; | |
| 47 | } | |
| 48 | } | |
| 49 | } | |
| 0 | 50 | |
| branches/main/account/forgot.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright 2004-2009, Ryan Djurovich | |
| 8 | * @copyright 2009-2011, Website Baker Org. e.V. | |
| 9 | * @link http://www.websitebaker2.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.x | |
| 12 | * @requirements PHP 5.2.2 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | if ( !defined( 'WB_PATH' ) ){ require(dirname(__DIR__).'/config.php'); }
 | |
| 20 | if ( !class_exists('frontend')) { require(WB_PATH.'/framework/class.frontend.php');  }
 | |
| 21 | // Create new frontend object | |
| 22 | if (!isset($wb) || !($wb instanceof frontend)) { $wb = new frontend(); }
 | |
| 23 |  | |
| 24 | $page_id = @$_SESSION['PAGE_ID'] ?: 0; | |
| 25 |  | |
| 26 | // Required page details | |
| 27 | // $page_id = 0; | |
| 28 | $page_description = ''; | |
| 29 | $page_keywords = ''; | |
| 30 | define('PAGE_ID', $page_id);
 | |
| 31 | define('ROOT_PARENT', 0);
 | |
| 32 | define('PARENT', 0);
 | |
| 33 | define('LEVEL', 0);
 | |
| 34 | define('PAGE_TITLE', $MENU['FORGOT']);
 | |
| 35 | define('MENU_TITLE', $MENU['FORGOT']);
 | |
| 36 | define('VISIBILITY', 'public');
 | |
| 37 |  | |
| 38 | if(!FRONTEND_LOGIN) {
 | |
| 39 |     header('Location: '.WB_URL.'/index.php');
 | |
| 40 | exit(0); | |
| 41 | } | |
| 42 |  | |
| 43 | // Set the page content include file | |
| 44 | define('PAGE_CONTENT', WB_PATH.'/account/forgot_form.php');
 | |
| 45 |  | |
| 46 | // Set auto authentication to false | |
| 47 | $auto_auth = false; | |
| 48 |  | |
| 49 | // Include the index (wrapper) file | |
| 50 | require(WB_PATH.'/index.php'); | |
| 0 | 51 | |
| branches/main/account/forgot_form.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright Website Baker Org. e.V. | |
| 8 | * @link http://websitebaker.org/ | |
| 9 | * @license http://www.gnu.org/licenses/gpl.html | |
| 10 | * @platform WebsiteBaker 2.8.3 | |
| 11 | * @requirements PHP 5.3.6 and higher | |
| 12 | * @version $Id$ | |
| 13 | * @filesource $HeadURL$ | |
| 14 | * @lastmodified $Date$ | |
| 15 | * | |
| 16 | */ | |
| 17 |  | |
| 18 | // Must include code to stop this file being access directly | |
| 19 | if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
 | |
| 20 | // Check if the user has already submitted the form, otherwise show it | |
| 21 | $sCallingScript = WB_URL; | |
| 22 | $redirect_url = ((isset($_SESSION['HTTP_REFERER']) && $_SESSION['HTTP_REFERER'] != '') ? $_SESSION['HTTP_REFERER'] : $sCallingScript ); | |
| 23 | $redirect_url = ( isset($redirect) && ($redirect!='') ? $redirect : $redirect_url); | |
| 24 | $message = $MESSAGE['FORGOT_PASS_NO_DATA']; | |
| 25 | $errMsg =''; | |
| 26 | if(isset($_POST['email']) && $_POST['email'] != "" ) | |
| 27 | {
 | |
| 28 | $email = strip_tags($_POST['email']); | |
| 29 | if($admin->validate_email($email) == false) | |
| 30 |     {
 | |
| 31 | $errMsg = $MESSAGE['USERS_INVALID_EMAIL']; | |
| 32 | $email = ''; | |
| 33 |     } else {
 | |
| 34 | // Check if the email exists in the database | |
| 35 | $sql = 'SELECT `user_id`,`username`,`display_name`,`email`,`last_reset`,`password` '. | |
| 36 | 'FROM `'.TABLE_PREFIX.'users` '. | |
| 37 | 'WHERE `email`=\''.$database->escapeString($email).'\''; | |
| 38 | if(($results = $database->query($sql))) | |
| 39 |     {
 | |
| 40 | if(($results_array = $results->fetchRow())) | |
| 41 |         { // Get the id, username, email, and last_reset from the above db query
 | |
| 42 | // Check if the password has been reset in the last 2 hours | |
| 43 |             if( (time() - (int)$results_array['last_reset']) < (2 * 3600) ) {
 | |
| 44 | // Tell the user that their password cannot be reset more than once per hour | |
| 45 | $errMsg = $MESSAGE['FORGOT_PASS_ALREADY_RESET']; | |
| 46 |             } else {
 | |
| 47 | require_once(WB_PATH.'/framework/PasswordHash.php'); | |
| 48 | $pwh = new PasswordHash(0, true); | |
| 49 | $old_pass = $results_array['password']; | |
| 50 | // Generate a random password then update the database with it | |
| 51 | $new_pass = $pwh->NewPassword(); | |
| 52 | $sql = 'UPDATE `'.TABLE_PREFIX.'users` SET ' | |
| 53 | . '`password`=\''.$database->escapeString($pwh->HashPassword($new_pass, true)).'\', ' | |
| 54 | . '`last_reset`='.time().' ' | |
| 55 | . 'WHERE `user_id`='.(int)$results_array['user_id']; | |
| 56 | unset($pwh); // destroy $pwh-Object | |
| 57 | if($database->query($sql)) | |
| 58 |                 { // Setup email to send
 | |
| 59 | $mail_to = $email; | |
| 60 | $mail_subject = $MESSAGE['SIGNUP2_SUBJECT_LOGIN_INFO']; | |
| 61 | // Replace placeholders from language variable with values | |
| 62 |                     $search = array('{LOGIN_DISPLAY_NAME}', '{LOGIN_WEBSITE_TITLE}', '{LOGIN_NAME}', '{LOGIN_PASSWORD}');
 | |
| 63 | $replace = array($results_array['display_name'], WEBSITE_TITLE, $results_array['username'], $new_pass); | |
| 64 | $mail_message = str_replace($search, $replace, $MESSAGE['SIGNUP2_BODY_LOGIN_FORGOT']); | |
| 65 | // Try sending the email | |
| 66 |                     if($wb->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) {
 | |
| 67 | $message = $MESSAGE['FORGOT_PASS_PASSWORD_RESET']; | |
| 68 | $display_form = false; | |
| 69 |                     }else { // snd mail failed, rollback
 | |
| 70 | $sql = 'UPDATE `'.TABLE_PREFIX.'users` '. | |
| 71 | 'SET `password`=\''.$database->escapeString($old_pass).'\' '. | |
| 72 | 'WHERE `user_id`='.(int)$results_array['user_id']; | |
| 73 | $database->query($sql); | |
| 74 | $errMsg = $MESSAGE['FORGOT_PASS_CANNOT_EMAIL']; | |
| 75 | } | |
| 76 |                 }else { // Error updating database
 | |
| 77 | $errMsg = $MESSAGE['RECORD_MODIFIED_FAILED']; | |
| 78 |                     if(DEBUG) {
 | |
| 79 | $message .= '<br />'.$database->get_error(); | |
| 80 | $message .= '<br />'.$sql; | |
| 81 | } | |
| 82 | } | |
| 83 | } | |
| 84 |         }else { // no record found - Email doesn't exist, so tell the user
 | |
| 85 | $errMsg = $MESSAGE['FORGOT_PASS_EMAIL_NOT_FOUND']; | |
| 86 | } | |
| 87 |     } else { // Query failed
 | |
| 88 | $errMsg = 'SystemError:: Database query failed!'; | |
| 89 |         if(DEBUG) {
 | |
| 90 | $errMsg .= '<br />'.$database->get_error(); | |
| 91 | $errMsg .= '<br />'.$sql; | |
| 92 | } | |
| 93 | } | |
| 94 | } | |
| 95 | } else {
 | |
| 96 | $email = ''; | |
| 97 | } | |
| 98 |  | |
| 99 | if( ($errMsg=='') && ($message != '')) {
 | |
| 100 | // $message = $MESSAGE['FORGOT_PASS_NO_DATA']; | |
| 101 | $message_color = '000000'; | |
| 102 | } else {
 | |
| 103 | $message = $errMsg; | |
| 104 | $message_color = 'ff0000'; | |
| 105 | } | |
| 106 | ?> | |
| 107 | <div style="margin: 1em auto;"> | |
| 108 | <button type="button" value="cancel" onclick="window.location = '<?php echo $redirect_url; ?>';"><?php print $TEXT['CANCEL'] ?></button> | |
| 109 | </div> | |
| 110 | <h1 style="text-align: center;"><?php echo $MENU['FORGOT']; ?></h1> | |
| 111 | <form name="forgot_pass" action="<?php echo WB_URL.'/account/forgot.php'; ?>" method="post" class="account"> | |
| 112 | <table > | |
| 113 | <tr> | |
| 114 | <td height="40" align="center" style="color: #<?php echo $message_color; ?>;" colspan="3"> | |
| 115 | <strong><?php echo $message; ?></strong> | |
| 116 | </td> | |
| 117 | </tr> | |
| 118 | <?php if(!isset($display_form) OR $display_form != false) { ?>
 | |
| 119 | <tr> | |
| 120 | <td height="10" colspan="2"></td> | |
| 121 | </tr> | |
| 122 | <tr> | |
| 123 | <td width="165" height="30" align="right"><?php echo $TEXT['EMAIL']; ?>:</td> | |
| 124 | <td><input type="text" maxlength="255" name="email" value="<?php echo $email; ?>" style="width: 180px;" /></td> | |
| 125 | <td><input type="submit" name="submit" value="<?php echo $TEXT['SEND_DETAILS']; ?>" style="width: 180px; font-size: 10px; color: #003366; border: 1px solid #336699; background-color: #DDDDDD; padding: 3px; text-transform: uppercase;" /></td> | |
| 126 | </tr> | |
| 127 | <?php } ?> | |
| 128 | </table> | |
| 129 | </form> | |
| 0 | 130 | |
| branches/main/account/frontend.css | ||
|---|---|---|
| 1 | /* <![CDATA[ */ | |
| 2 | /* | |
| 3 | CSS definition for Website Baker module: WB-Preferences | |
| 4 | Copyright (C) 2008, Werner von der Decken | |
| 5 | Contact me: wkl(at)isteam.de, http://isteam.de | |
| 6 |  | |
| 7 | This CSS file is free software. You can redistribute it and/or modify it | |
| 8 | under the terms of the GNU General Public License - version 2 or later, | |
| 9 | as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html. | |
| 10 |  | |
| 11 | This CSS file is distributed in the hope that it will be useful, | |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | GNU General Public License for more details. | |
| 15 | */ | |
| 16 |     .mod_preferences_error {
 | |
| 17 | background-color:#ffb0b0; | |
| 18 | padding:5px; | |
| 19 | border:dotted 1px #ff0000; | |
| 20 | color:#ff0000; | |
| 21 | } | |
| 22 |     .mod_preferences_success {
 | |
| 23 | background-color:#b0ffb0; | |
| 24 | padding:5px; | |
| 25 | border:dotted 1px #303030; | |
| 26 | color:#303030; | |
| 27 | } | |
| 28 | table.account tr { line-height: 2.525; }
 | |
| 29 |  | |
| branches/main/account/languages/DE.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | Module developed for the Open Source Content Management System Website Baker (http://websitebaker.org) | |
| 4 | Copyright (C) 2008, ISTeam, Werner von der Decken | |
| 5 | Contact me: wkl(at)isteam.de, http://isteam.de | |
| 6 |  | |
| 7 | This module is free software. You can redistribute it and/or modify it | |
| 8 | under the terms of the GNU General Public License - version 2 or later, | |
| 9 | as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html. | |
| 10 |  | |
| 11 | This module is distributed in the hope that it will be useful, | |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | GNU General Public License for more details. | |
| 15 |  | |
| 16 | ----------------------------------------------------------------------------------------- | |
| 17 | DEUTSCHE SPRACHDATEI FUER DAS PREFERENCES MODUL | |
| 18 | ----------------------------------------------------------------------------------------- | |
| 19 | UPDATE HISTORY: | |
| 20 | Werner von der Decken; 17.05.2008 | |
| 21 | + erstes release der Deutschen Sprachdatei | |
| 22 | ----------------------------------------------------------------------------------------- | |
| 23 | **/ | |
| 24 |  | |
| 25 | // Array fuer alle sprachabhaengigen Textausgaben im Front- und Backend | |
| 26 | // Hinweis: Verwende nachfolgende Namenskonvention f?r die Sprachausgabe des Moduls: $MOD_MODULE_DIRECTORY | |
| 27 | $MOD_PREFERENCE = array( | |
| 28 | 'PLEASE_SELECT' => 'bitte wählen', | |
| 29 | 'DETAILS_SAVED' => 'allgemeine Einstellungen geändert', | |
| 30 | 'SAVE_SETTINGS' => 'Einstellungen speichern', | |
| 31 | 'SAVE_EMAIL' => 'Email speichern', | |
| 32 | 'SAVE_PASSWORD' => 'Passwort speichern', | |
| 33 | ); | |
| 34 | $MESSAGE['USERS_DISPLAYNAME_TAKEN'] = 'Der angegebene Anzeigename wird bereits verwendet'; | |
| 35 | $TEXT['FULL_NAME'] = 'Öffentlich sichtbarer Name'; | |
| 0 | 36 | |
| branches/main/account/languages/EN.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | Module developed for the Open Source Content Management System Website Baker (http://websitebaker.org) | |
| 4 | Copyright (C) 2008, ISTeam, Werner von der Decken | |
| 5 | Contact me: wkl(at)isteam.de, http://isteam.de | |
| 6 |  | |
| 7 | This module is free software. You can redistribute it and/or modify it | |
| 8 | under the terms of the GNU General Public License - version 2 or later, | |
| 9 | as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html. | |
| 10 |  | |
| 11 | This module is distributed in the hope that it will be useful, | |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | GNU General Public License for more details. | |
| 15 |  | |
| 16 | ----------------------------------------------------------------------------------------- | |
| 17 | ENGLISH LANGUAGE FILE FOR THE PREFERENCES MODULE | |
| 18 | ----------------------------------------------------------------------------------------- | |
| 19 | UPDATE HISTORY: | |
| 20 | Werner von der Decken; 17.05.2008 | |
| 21 | + initial release of the English language file | |
| 22 | ----------------------------------------------------------------------------------------- | |
| 23 | **/ | |
| 24 | // array for all language dependen text outputs in the front- and backend | |
| 25 | // Note: stick to the naming convention: $MOD_MODULE_DIRECTORY | |
| 26 | $MOD_PREFERENCE = array( | |
| 27 | 'PLEASE_SELECT' => 'please select', | |
| 28 | 'DETAILS_SAVED' => 'details successfully saved', | |
| 29 | 'SAVE_SETTINGS' => 'save details', | |
| 30 | 'SAVE_EMAIL' => 'save email', | |
| 31 | 'SAVE_PASSWORD' => 'save password', | |
| 32 | ); | |
| 33 | $MESSAGE['USERS_DISPLAYNAME_TAKEN'] = 'The displayname you entered is already taken'; | |
| 34 | $TEXT['FULL_NAME'] = 'Publicly visible name'; | |
| 0 | 35 | |
| branches/main/account/login.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright Ryan Djurovich | |
| 8 | * @copyright WebsiteBaker Org. e.V. | |
| 9 | * @link http://websitebaker.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.3 | |
| 12 | * @requirements PHP 5.3.6 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | if ( !defined( 'WB_PATH' ) ){ require(dirname(__DIR__).'/config.php'); }
 | |
| 20 | if ( !class_exists('frontend')) { require(WB_PATH.'/framework/class.frontend.php');  }
 | |
| 21 | // Create new frontend object | |
| 22 | if (!isset($wb) || !($wb instanceof frontend)) { $wb = new frontend(); }
 | |
| 23 |  | |
| 24 | // Make sure the login is enabled | |
| 25 | if(!FRONTEND_LOGIN) {
 | |
| 26 |     if(INTRO_PAGE) {
 | |
| 27 |         header('Location: '.WB_URL.'/index.php');
 | |
| 28 | exit(0); | |
| 29 |     } else {
 | |
| 30 |         header('Location: '.WB_URL.'/index.php');
 | |
| 31 | exit(0); | |
| 32 |           if ( $wb->get_user_id() && $wb->ami_group_member( '1' ) ) {
 | |
| 33 |           } else {
 | |
| 34 | $wb->print_missing_frontend_login(); | |
| 35 | } | |
| 36 | exit(0); | |
| 37 | } | |
| 38 | } | |
| 39 |  | |
| 40 | $page_id = @$_SESSION['PAGE_ID'] ?: 0; | |
| 41 |  | |
| 42 | // Required page details | |
| 43 | // $page_id = 0; | |
| 44 | $page_description = ''; | |
| 45 | $page_keywords = ''; | |
| 46 | define('PAGE_ID', $page_id);
 | |
| 47 | define('ROOT_PARENT', 0);
 | |
| 48 | define('PARENT', 0);
 | |
| 49 | define('LEVEL', 0);
 | |
| 50 | define('PAGE_TITLE', $TEXT['PLEASE_LOGIN']);
 | |
| 51 | define('MENU_TITLE', $TEXT['PLEASE_LOGIN']);
 | |
| 52 | define('VISIBILITY', 'public');
 | |
| 53 | // Set the page content include file | |
| 54 | define('PAGE_CONTENT', WB_PATH.'/account/login_form.php');
 | |
| 55 |  | |
| 56 | require_once(WB_PATH.'/framework/Login.php'); | |
| 57 | require_once(WB_PATH.'/framework/class.frontend.php'); | |
| 58 |  | |
| 59 | // Create new frontend object | |
| 60 | //$wb = new frontend(); | |
| 61 |  | |
| 62 | // Create new login app | |
| 63 | $requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']); | |
| 64 | $redirect  = strip_tags(isset(${$requestMethod}['redirect']) ? ${$requestMethod}['redirect'] : '');
 | |
| 65 | $redirect = ((isset($_SERVER['HTTP_REFERER']) && empty($redirect)) ? $_SERVER['HTTP_REFERER'] : $redirect); | |
| 66 | $_SESSION['HTTP_REFERER'] = str_replace(WB_URL,'',$redirect); | |
| 67 |  | |
| 68 | $loginUrl = WB_URL.'/account/login.php'; | |
| 69 | $loginUrl .= (!empty($redirect) ? '?redirect=' .$_SESSION['HTTP_REFERER'] : ''); | |
| 70 |  | |
| 71 | $ThemeUrl  = WB_URL.$wb->correct_theme_source('warning.html');
 | |
| 72 | // Setup template object, parse vars to it, then parse it | |
| 73 | $ThemePath = realpath(WB_PATH.$wb->correct_theme_source('login.htt'));
 | |
| 74 |  | |
| 75 | $thisApp = new Login( | |
| 76 | array( | |
| 77 | "MAX_ATTEMPS" => "3", | |
| 78 | "WARNING_URL" => $ThemeUrl."/warning.html", | |
| 79 | "USERNAME_FIELDNAME" => 'username', | |
| 80 | "PASSWORD_FIELDNAME" => 'password', | |
| 81 | "REMEMBER_ME_OPTION" => SMART_LOGIN, | |
| 82 | "MIN_USERNAME_LEN" => "2", | |
| 83 | "MIN_PASSWORD_LEN" => "2", | |
| 84 | "MAX_USERNAME_LEN" => "30", | |
| 85 | "MAX_PASSWORD_LEN" => "30", | |
| 86 | "LOGIN_URL" => $loginUrl, | |
| 87 | "DEFAULT_URL" => WB_URL."/index.php", | |
| 88 | "TEMPLATE_DIR" => $ThemePath, | |
| 89 | "TEMPLATE_FILE" => "login.htt", | |
| 90 | "FRONTEND" => true, | |
| 91 | "FORGOTTEN_DETAILS_APP" => WB_URL."/account/forgot.php", | |
| 92 | "USERS_TABLE" => TABLE_PREFIX."users", | |
| 93 | "GROUPS_TABLE" => TABLE_PREFIX."groups", | |
| 94 | "REDIRECT_URL" => $redirect | |
| 95 | ) | |
| 96 | ); | |
| 97 |  | |
| 98 | // Set extra outsider var | |
| 99 | $globals[] = 'thisApp'; | |
| 100 |  | |
| 101 | // Include the index (wrapper) file | |
| 102 | require(WB_PATH.'/index.php'); | |
| 0 | 103 | |
| branches/main/account/login_form.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright Ryan Djurovich | |
| 8 | * @copyright Website Baker Org. e.V. | |
| 9 | * @link http://websitebaker.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.3 | |
| 12 | * @requirements PHP 5.3.6 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | // Must include code to stop this file being access directly | |
| 20 | if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
 | |
| 21 |  | |
| 22 | $username_fieldname = 'username'; | |
| 23 | $password_fieldname = 'password'; | |
| 24 | if(defined('SMART_LOGIN') && SMART_LOGIN == 'true') {
 | |
| 25 | $sTmp = '_'.substr(md5(microtime()), -8); | |
| 26 | $username_fieldname .= $sTmp; | |
| 27 | $password_fieldname .= $sTmp; | |
| 28 | } | |
| 29 |  | |
| 30 | $thisApp->redirect_url = (isset($thisApp->redirect_url) && ($thisApp->redirect_url!='') ? $thisApp->redirect_url : $_SESSION['HTTP_REFERER'] ); | |
| 31 |  | |
| 32 | ?> | |
| 33 | <div style="margin: 1em auto;"> | |
| 34 | <button type="button" value="cancel" onclick="javascript: window.location = '<?php print $_SESSION['HTTP_REFERER'] ?>';"><?php print $TEXT['CANCEL'] ?></button> | |
| 35 | </div> | |
| 36 | <h1> Login</h1> | |
| 37 |  <?php | |
| 38 |  | |
| 39 | echo $thisApp->getMessage(); | |
| 40 | ?> | |
| 41 | <br /> | |
| 42 | <br /> | |
| 43 |  | |
| 44 | <form class="login-box account" action="<?php echo WB_URL.'/account/login.php'; ?>" method="post"> | |
| 45 | <input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" /> | |
| 46 | <input type="hidden" name="password_fieldname" value="<?php echo $password_fieldname; ?>" /> | |
| 47 | <input type="hidden" name="redirect" value="<?php echo $thisApp->redirect_url;?>" /> | |
| 48 |  | |
| 49 | <table > | |
| 50 | <tr> | |
| 51 | <td style="width:100px"><?php echo $TEXT['USERNAME']; ?>:</td> | |
| 52 | <td class="value_input"> | |
| 53 | <input type="text" name="<?php echo $username_fieldname; ?>" maxlength="30" style="width:220px;"/> | |
| 54 | <script type="text/javascript"> | |
| 55 | // document.login.<?php echo $username_fieldname; ?>.focus(); | |
| 56 |         var ref= document.getElementById("<?php echo $username_fieldname; ?>");
 | |
| 57 | if (ref) ref.focus(); | |
| 58 | </script> | |
| 59 | </td> | |
| 60 | </tr> | |
| 61 | <tr> | |
| 62 | <td style="width:100px"><?php echo $TEXT['PASSWORD']; ?>:</td> | |
| 63 | <td class="value_input"> | |
| 64 | <input type="password" name="<?php echo $password_fieldname; ?>" maxlength="30" style="width:220px;"/> | |
| 65 | </td> | |
| 66 | </tr> | |
| 67 | <?php if($username_fieldname != 'username') { ?>
 | |
| 68 | <tr> | |
| 69 | <td> </td> | |
| 70 | <td> | |
| 71 | <input type="checkbox" name="remember" id="remember" value="true"/> | |
| 72 | <label for="remember"><?php echo $TEXT['REMEMBER_ME']; ?></label> | |
| 73 | </td> | |
| 74 | </tr> | |
| 75 | <?php } ?> | |
| 76 | <tr> | |
| 77 | <td> </td> | |
| 78 | <td> | |
| 79 | <input type="submit" name="submit" value="<?php echo $TEXT['LOGIN']; ?>" /> | |
| 80 | <input type="reset" name="reset" value="<?php echo $TEXT['RESET']; ?>" /> | |
| 81 | </td> | |
| 82 | </tr> | |
| 83 | </table> | |
| 84 |  | |
| 85 | </form> | |
| 86 |  | |
| 87 | <br /> | |
| 88 |  | |
| 89 | <a href="<?php echo WB_URL; ?>/account/forgot.php"><?php echo $TEXT['FORGOTTEN_DETAILS']; ?></a> | |
| 0 | 90 | |
| branches/main/account/logout.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright Ryan Djurovich | |
| 8 | * @copyright WebsiteBaker Org. e.V. | |
| 9 | * @link http://websitebaker.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.3 | |
| 12 | * @requirements PHP 5.3.6 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | if( !defined( 'WB_PATH' ) ){ require(dirname(__DIR__).'/config.php'); }
 | |
| 20 |  | |
| 21 | if(isset($_COOKIE['REMEMBER_KEY'])) {
 | |
| 22 |     setcookie('REMEMBER_KEY', '', time()-3600, '/');
 | |
| 23 | } | |
| 24 | $redirect_url = ((isset($_SESSION['HTTP_REFERER']) && $_SESSION['HTTP_REFERER'] != '') ? $_SESSION['HTTP_REFERER'] : WB_URL ); | |
| 25 | $redirect_url = ( isset($redirect) && ($redirect!='') ? $redirect : $redirect_url); | |
| 26 | $page_id = @$_SESSION['PAGE_ID'] ?: 0; | |
| 27 |  | |
| 28 | $_SESSION['USER_ID'] = null; | |
| 29 | $_SESSION['GROUP_ID'] = null; | |
| 30 | $_SESSION['GROUPS_ID'] = null; | |
| 31 | $_SESSION['USERNAME'] = null; | |
| 32 | $_SESSION['PAGE_PERMISSIONS'] = null; | |
| 33 | $_SESSION['SYSTEM_PERMISSIONS'] = null; | |
| 34 | $_SESSION = array(); | |
| 35 |  | |
| 36 | session_unset(); | |
| 37 | unset($_COOKIE[session_name()]); | |
| 38 | session_destroy(); | |
| 39 |  | |
| 40 | if( !FRONTEND_LOGIN && INTRO_PAGE) {
 | |
| 41 |     header('Location: '.WB_URL.'/index.php');
 | |
| 42 | exit; | |
| 43 | } else {
 | |
| 44 | $no_intro = true; | |
| 45 | require(WB_PATH.'/index.php'); | |
| 46 | } | |
| 47 |  | |
| 0 | 48 | |
| branches/main/account/password.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright 2009-2012, Website Baker Org. e.V. | |
| 8 | * @link http://www.websitebaker2.org/ | |
| 9 | * @license http://www.gnu.org/licenses/gpl.html | |
| 10 | * @platform WebsiteBaker 2.8.x | |
| 11 | * @requirements PHP 5.2.2 and higher | |
| 12 | * @version $Id$ | |
| 13 | * @filesource $HeadURL$ | |
| 14 | * @lastmodified $Date$ | |
| 15 | * | |
| 16 | */ | |
| 17 |  | |
| 18 | // Must include code to stop this file being access directly | |
| 19 | if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
 | |
| 20 |  | |
| 21 | // Get entered values | |
| 22 | $iMinPassLength = 6; | |
| 23 |     $sCurrentPassword = $wb->get_post('current_password');
 | |
| 24 | $sCurrentPassword = (is_null($sCurrentPassword) ? '' : $sCurrentPassword); | |
| 25 |     $sNewPassword = $wb->get_post('new_password');
 | |
| 26 | $sNewPassword = is_null($sNewPassword) ? '' : $sNewPassword; | |
| 27 |     $sNewPasswordRetyped = $wb->get_post('new_password2');
 | |
| 28 | $sNewPasswordRetyped= is_null($sNewPasswordRetyped) ? '' : $sNewPasswordRetyped; | |
| 29 | // Check existing password | |
| 30 | $sql = 'SELECT `password` '; | |
| 31 | $sql .= 'FROM `'.TABLE_PREFIX.'users` '; | |
| 32 | $sql .= 'WHERE `user_id` = '.$wb->get_user_id(); | |
| 33 | // Validate values | |
| 34 |     if (md5($sCurrentPassword) != $database->get_one($sql)) {
 | |
| 35 | $error[] = $MESSAGE['PREFERENCES_CURRENT_PASSWORD_INCORRECT']; | |
| 36 |     }else {
 | |
| 37 |         if(strlen($sNewPassword) < $iMinPassLength) {
 | |
| 38 | $error[] = $MESSAGE['USERS_PASSWORD_TOO_SHORT']; | |
| 39 |         }else {
 | |
| 40 |             if($sNewPassword != $sNewPasswordRetyped) {
 | |
| 41 | $error[] = $MESSAGE['USERS_PASSWORD_MISMATCH']; | |
| 42 |             }else {
 | |
| 43 | $pattern = '/[^'.$wb->password_chars.']/'; | |
| 44 |                 if (preg_match($pattern, $sNewPassword)) {
 | |
| 45 | $error[] = $MESSAGE['PREFERENCES_INVALID_CHARS']; | |
| 46 |                 }else {
 | |
| 47 | // generate new password hash | |
| 48 | $sPwHashNew = md5($sNewPassword); | |
| 49 | // Update the database | |
| 50 | $sql = 'UPDATE `'.TABLE_PREFIX.'users` ' | |
| 51 | . 'SET `password`=\''.$database->escapeString($sPwHashNew).'\' ' | |
| 52 | . 'WHERE `user_id`='.$wb->get_user_id(); | |
| 53 |                     if ($database->query($sql)) {
 | |
| 54 | $success[] = $MESSAGE['PREFERENCES_PASSWORD_CHANGED']; | |
| 55 |                     }else {
 | |
| 56 | $error[] = $database->get_error(); | |
| 57 | } | |
| 58 | } | |
| 59 | } | |
| 60 | } | |
| 61 | } | |
| 0 | 62 | |
| branches/main/account/preferences.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright 2004-2009, Ryan Djurovich | |
| 8 | * @copyright 2009-2011, Website Baker Org. e.V. | |
| 9 | * @link http://www.websitebaker2.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.x | |
| 12 | * @requirements PHP 5.2.2 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | if (!defined( 'WB_PATH')){ require(dirname(__DIR__).'/config.php'); }
 | |
| 20 | if (!class_exists('frontend')) {require(WB_PATH.'/framework/class.frontend.php');}
 | |
| 21 |  | |
| 22 | require_once(WB_PATH.'/framework/functions.php'); | |
| 23 |  | |
| 24 | // Create new frontend object | |
| 25 | if (!isset($wb) || !($wb instanceof frontend)) {
 | |
| 26 | $wb = new frontend(); | |
| 27 | } | |
| 28 |  | |
| 29 | if(!FRONTEND_LOGIN) {
 | |
| 30 |     header('Location: '.WB_URL.'/index.php');
 | |
| 31 | exit(0); | |
| 32 | } | |
| 33 |  | |
| 34 | if ($wb->is_authenticated()==false) {
 | |
| 35 |     header('Location: '.WB_URL.'/account/login.php');
 | |
| 36 | exit(0); | |
| 37 | } | |
| 38 | $redirect_url = ((isset($_SESSION['HTTP_REFERER']) && $_SESSION['HTTP_REFERER'] != '') ? $_SESSION['HTTP_REFERER'] : WB_URL ); | |
| 39 | $redirect_url = ( isset($redirect) && ($redirect!='') ? $redirect : $redirect_url); | |
| 40 | $page_id = @$_SESSION['PAGE_ID'] ?: PAGE_ID; | |
| 41 | /* | |
| 42 | $requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']); | |
| 43 | $redirect  = strip_tags(isset(${$requestMethod}['redirect']) ? ${$requestMethod}['redirect'] : '');
 | |
| 44 | $redirect = ((isset($_SERVER['HTTP_REFERER']) && empty($redirect)) ? $_SERVER['HTTP_REFERER'] : $redirect); | |
| 45 | $_SESSION['HTTP_REFERER'] = str_replace(WB_URL,'',$redirect); | |
| 46 | */ | |
| 47 |  | |
| 48 | // Required page details | |
| 49 | $page_description = ''; | |
| 50 | $page_keywords = ''; | |
| 51 | define('PAGE_ID', $page_id);
 | |
| 52 | define('ROOT_PARENT', 0);
 | |
| 53 | define('PARENT', 0);
 | |
| 54 | define('LEVEL', 0);
 | |
| 55 |  | |
| 56 | define('PAGE_TITLE', $MENU['PREFERENCES']);
 | |
| 57 | define('MENU_TITLE', $MENU['PREFERENCES']);
 | |
| 58 | define('MODULE', '');
 | |
| 59 | define('VISIBILITY', 'public');
 | |
| 60 |  | |
| 61 | define('PAGE_CONTENT', WB_PATH.'/account/preferences_form.php');
 | |
| 62 | // Include the index (wrapper) file | |
| 63 | $no_intro = true; | |
| 64 | require(WB_PATH.'/index.php'); | |
| 0 | 65 | |
| branches/main/account/preferences_form.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright Ryan Djurovich | |
| 8 | * @copyright WebsiteBaker Org. e.V. | |
| 9 | * @link http://websitebaker.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.3 | |
| 12 | * @requirements PHP 5.3.6 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 | // prevent this file from being accesses directly | |
| 19 | if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
 | |
| 20 | $sCallingScript = WB_URL; | |
| 21 |  | |
| 22 | $redirect_url = (isset($_SESSION['HTTP_REFERER']) && ($_SESSION['HTTP_REFERER'] != '') ? $_SESSION['HTTP_REFERER'] : $sCallingScript ); | |
| 23 | $redirect_url = (isset($redirect) && ($redirect!='') ? $redirect : $redirect_url); | |
| 24 | /* | |
| 25 | print '<pre class="mod-pre rounded">function <span>'.__FUNCTION__.'( '.$page_id.' );</span> filename: <span>'.basename(__FILE__).'</span> line: '.__LINE__.' -> <br />'; | |
| 26 | print_r( $redirect_url ); print '</pre>'; flush (); // ob_flush();;sleep(10); die(); | |
| 27 | */ | |
| 28 |     if($wb->is_authenticated() === false) {
 | |
| 29 | // User needs to login first | |
| 30 |         header("Location: ".WB_URL."/account/login.php?redirect=".$wb->link);
 | |
| 31 | exit(0); | |
| 32 | } | |
| 33 | // load module default language file (EN) | |
| 34 | $sAddonName = basename(__DIR__); | |
| 35 | $oTrans = Translate::getInstance(); | |
| 36 | $oTrans->enableAddon('account');
 | |
| 37 |  | |
| 38 | //require(WB_PATH .'/'.$sAddonName.'/languages/EN.php'); | |
| 39 | //if(file_exists(WB_PATH .'/'.$sAddonName.'/languages/'.LANGUAGE .'.php')) {
 | |
| 40 | // require(WB_PATH .'/'.$sAddonName.'/languages/'.LANGUAGE .'.php'); | |
| 41 | //} | |
| 42 | require_once(WB_PATH.'/framework/functions-utf8.php'); | |
| 43 | /* | |
| 44 | echo '<style type="text/css">'; | |
| 45 | include(WB_PATH .'/account/frontend.css'); | |
| 46 | echo "\n</style>\n"; | |
| 47 | */ | |
| 48 |  | |
| 49 | $user_time = true; | |
| 50 | require(ADMIN_PATH.'/interface/timezones.php'); | |
| 51 | require(ADMIN_PATH.'/interface/date_formats.php'); | |
| 52 | require(ADMIN_PATH.'/interface/time_formats.php'); | |
| 53 | $error = array(); | |
| 54 | $success = array(); | |
| 55 | $template = new Template(WB_PATH .'/account','remove'); | |
| 56 |     switch($wb->get_post('action')):
 | |
| 57 | case 'details': | |
| 58 | require_once(WB_PATH .'/account/details.php'); | |
| 59 | break; | |
| 60 | case 'email': | |
| 61 | require_once(WB_PATH .'/account/email.php'); | |
| 62 | break; | |
| 63 | case 'password': | |
| 64 | require_once(WB_PATH .'/account/password.php'); | |
| 65 | break; | |
| 66 | default: | |
| 67 | // do nothing | |
| 68 | endswitch; // switch | |
| 69 | // show template | |
| 70 |     $template->set_file('page', 'template.htt');
 | |
| 71 |     $template->set_block('page', 'main_block', 'main');
 | |
| 72 | // get existing values from database | |
| 73 | $sql = "SELECT `display_name`,`email` FROM `".TABLE_PREFIX."users` WHERE `user_id` = '".$wb->get_user_id()."'"; | |
| 74 | $rowset = $database->query($sql); | |
| 75 |     if($database->is_error()) { $error[] = $database->get_error(); }
 | |
| 76 | $row = $rowset->fetchRow(MYSQLI_ASSOC); | |
| 77 | // insert values into form | |
| 78 |     $template->set_var('DISPLAY_NAME', $row['display_name']);
 | |
| 79 |     $template->set_var('EMAIL', $row['email']);
 | |
| 80 | // read available languages from table addons and assign it to the template | |
| 81 | $sql = 'SELECT * FROM `'.TABLE_PREFIX.'addons` '; | |
| 82 | $sql .= 'WHERE `type` = \'language\' ORDER BY `directory`'; | |
| 83 |     if( $res_lang = $database->query($sql) ) {
 | |
| 84 |         $template->set_block('main_block', 'language_list_block', 'language_list');
 | |
| 85 | $iCurrentLanguage = (@$_SESSION['LANGUAGE'] ? : LANGUAGE); | |
| 86 | while( $rec_lang = $res_lang->fetchRow(MYSQLI_ASSOC) ) | |
| 87 |         {
 | |
| 88 | $langIcons = (empty($rec_lang['directory'])) ? 'none' : strtolower($rec_lang['directory']); | |
| 89 |             $template->set_var('CODE',        $rec_lang['directory']);
 | |
| 90 |             $template->set_var('NAME',        $rec_lang['name']);
 | |
| 91 |             $template->set_var('FLAG',        THEME_URL.'/images/flags/'.$langIcons);
 | |
| 92 |             $template->set_var('SELECTED',    ($iCurrentLanguage == $rec_lang['directory'] ? ' selected="selected"' : '') );
 | |
| 93 |             $template->parse('language_list', 'language_list_block', true);
 | |
| 94 | } | |
| 95 | } | |
| 96 | // Insert default timezone values | |
| 97 |     $template->set_block('main_block', 'timezone_list_block', 'timezone_list');
 | |
| 98 |     if( isset($_SESSION['TIMEZONE'])) {
 | |
| 99 | $actual_time = time()+ $_SESSION['TIMEZONE']; | |
| 100 |         foreach($TIME_FORMATS as $key => &$val) {
 | |
| 101 |             if($key == "system_default") {
 | |
| 102 |                 if(isset($oTrans->TEXT_SYSTEM_DEFAULT)) {
 | |
| 103 |                     $TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $actual_time).' ('.$oTrans->TEXT_SYSTEM_DEFAULT.')';
 | |
| 104 |                 } else {
 | |
| 105 | $TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $actual_time).' (System Default)'; | |
| 106 | } | |
| 107 |             } else {
 | |
| 108 |                 $format = str_replace("|", " ", $key);
 | |
| 109 | $TIME_FORMATS[ $key ] = gmdate( $format, $actual_time); | |
| 110 | } | |
| 111 | } | |
| 112 | // Keep in mind we've also update the Date! (± one day) | |
| 113 |         foreach($DATE_FORMATS as $key => &$val) {
 | |
| 114 |             if($key == "system_default") {
 | |
| 115 |                 if(isset($oTrans->TEXT_SYSTEM_DEFAULT)) {
 | |
| 116 |                     $DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $actual_time).' ('.$oTrans->TEXT_SYSTEM_DEFAULT.')';
 | |
| 117 |                 } else {
 | |
| 118 | $DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $actual_time).' (System Default)'; | |
| 119 | } | |
| 120 |             } else {
 | |
| 121 |                 $format = str_replace("|", " ", $key);
 | |
| 122 | $DATE_FORMATS[ $key ] = gmdate( $format, $actual_time); | |
| 123 | } | |
| 124 | } | |
| 125 | } | |
| 126 |  | |
| 127 | $iActualTimezone = ((DEFAULT_TIMEZONE <> 0) ? DEFAULT_TIMEZONE : 0); | |
| 128 | $iActualTimezone = (($iActualTimezone == $wb->get_timezone())? 'system_default':$wb->get_timezone()); | |
| 129 | $iCurrentTimeZone = intval(@$_SESSION['TIMEZONE'] ? : $iActualTimezone); | |
| 130 |     foreach($TIMEZONES AS $hour_offset => $title) {
 | |
| 131 | $iTmpOffset = (is_numeric($hour_offset)?$hour_offset*3600:$hour_offset); | |
| 132 |         $template->set_var('VALUE',    $hour_offset);
 | |
| 133 |         $template->set_var('NAME',     $title);
 | |
| 134 |         $template->set_var('SELECTED', (($iTmpOffset === $iActualTimezone) ? ' selected="selected"' : ''));
 | |
| 135 | /* | |
| 136 |         $template->set_var('VALUE', $hour_offset);
 | |
| 137 |         $template->set_var('NAME', $title);
 | |
| 138 |         if($iCurrentTimeZone == $hour_offset*3600) {
 | |
| 139 |             $template->set_var('SELECTED', 'selected="selected"');
 | |
| 140 |         } else {
 | |
| 141 |             $template->set_var('SELECTED', '');
 | |
| 142 | } | |
| 143 | */ | |
| 144 |         $template->parse('timezone_list', 'timezone_list_block', true);
 | |
| 145 | } | |
| 146 | // Insert date format list | |
| 147 |     $template->set_block('main_block', 'date_format_list_block', 'date_format_list');
 | |
| 148 | $sTempDateFormat = (@$_SESSION['DATE_FORMAT'] ?: DATE_FORMAT); | |
| 149 |     foreach($DATE_FORMATS AS $format => $title) {
 | |
| 150 |         $format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
 | |
| 151 |         if($format != 'system_default') {
 | |
| 152 |             $template->set_var('VALUE', $format);
 | |
| 153 |         } else {
 | |
| 154 |             $template->set_var('VALUE', '');
 | |
| 155 | } | |
| 156 |         $template->set_var('NAME', $title);
 | |
| 157 |         if($sTempDateFormat == $format AND !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
 | |
| 158 |             $template->set_var('SELECTED', 'selected="selected"');
 | |
| 159 |         } elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
 | |
| 160 |             $template->set_var('SELECTED', 'selected="selected"');
 | |
| 161 |         } else {
 | |
| 162 |             $template->set_var('SELECTED', '');
 | |
| 163 | } | |
| 164 |         $template->parse('date_format_list', 'date_format_list_block', true);
 | |
| 165 | } | |
| 166 | // Insert time format list | |
| 167 |     $template->set_block('main_block', 'time_format_list_block', 'time_format_list');
 | |
| 168 | $sTimeFormat = (@$_SESSION['TIME_FORMAT'] ? : TIME_FORMAT ); | |
| 169 |     foreach($TIME_FORMATS AS $format => $title) {
 | |
| 170 |         $format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
 | |
| 171 |         if($format != 'system_default') {
 | |
| 172 |             $template->set_var('VALUE', $format);
 | |
| 173 |         } else {
 | |
| 174 |             $template->set_var('VALUE', '');
 | |
| 175 | } | |
| 176 |         $template->set_var('NAME', $title);
 | |
| 177 |         if($sTimeFormat == $format AND !isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) {
 | |
| 178 |             $template->set_var('SELECTED', 'selected="selected"');
 | |
| 179 |         } elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) {
 | |
| 180 |             $template->set_var('SELECTED', 'selected="selected"');
 | |
| 181 |         } else {
 | |
| 182 |             $template->set_var('SELECTED', '');
 | |
| 183 | } | |
| 184 |         $template->parse('time_format_list', 'time_format_list_block', true);
 | |
| 185 | } | |
| 186 | // insert all translations | |
| 187 | $template->set_var($oTrans->getLangArray()); | |
| 188 |     $template->set_var('HTTP_REFERER', $redirect_url); //$_SESSION['HTTP_REFERER'],
 | |
| 189 | // Insert language headings | |
| 190 | // $template->set_var(array( | |
| 191 | // 'HEADING_MY_SETTINGS' => $oTrans->HEADING_MY_SETTINGS, | |
| 192 | // 'HEADING_MY_EMAIL' => $oTrans->HEADING_MY_EMAIL, | |
| 193 | // 'HEADING_MY_PASSWORD' => $oTrans->HEADING_MY_PASSWORD | |
| 194 | // ) | |
| 195 | // ); | |
| 196 | //// Insert language text and messages | |
| 197 | // $template->set_var(array( | |
| 198 | // 'TEXT_SAVE' => $oTrans->TEXT_SAVE, | |
| 199 | // 'TEXT_RESET' => $oTrans->TEXT_RESET, | |
| 200 | // 'TEXT_CANCEL' => $oTrans->TEXT_CANCEL, | |
| 201 | // 'TEXT_DISPLAY_NAME' => $oTrans->TEXT_DISPLAY_NAME, | |
| 202 | // 'TEXT_EMAIL' => $oTrans->TEXT_EMAIL, | |
| 203 | // 'TEXT_LANGUAGE' => $oTrans->TEXT_LANGUAGE, | |
| 204 | // 'TEXT_TIMEZONE' => $oTrans->TEXT_TIMEZONE, | |
| 205 | // 'TEXT_DATE_FORMAT' => $oTrans->TEXT_DATE_FORMAT, | |
| 206 | // 'TEXT_TIME_FORMAT' => $oTrans->TEXT_TIME_FORMAT, | |
| 207 | // 'TEXT_CURRENT_PASSWORD' => $oTrans->TEXT_CURRENT_PASSWORD, | |
| 208 | // 'TEXT_NEW_PASSWORD' => $oTrans->TEXT_NEW_PASSWORD, | |
| 209 | // 'TEXT_RETYPE_NEW_PASSWORD' => $oTrans->TEXT_RETYPE_NEW_PASSWORD | |
| 210 | // ) | |
| 211 | // ); | |
| 212 | //// Insert module releated language text and messages | |
| 213 | // $template->set_var(array( | |
| 214 | // 'MOD_PREFERENCE_PLEASE_SELECT' => $oTrans->MOD_PREFERENCE_PLEASE_SELECT, | |
| 215 | // 'MOD_PREFERENCE_SAVE_SETTINGS' => $oTrans->MOD_PREFERENCE_SAVE_SETTINGS, | |
| 216 | // 'MOD_PREFERENCE_SAVE_EMAIL' => $oTrans->MOD_PREFERENCE_SAVE_EMAIL, | |
| 217 | // 'MOD_PREFERENCE_SAVE_PASSWORD' => $oTrans->MOD_PREFERENCE_SAVE_PASSWORD, | |
| 218 | // ) | |
| 219 | // ); | |
| 220 | // Insert error and/or success messages | |
| 221 |     $template->set_block('main_block', 'error_block', 'error_list');
 | |
| 222 |     if(sizeof($error)>0){
 | |
| 223 |         foreach($error AS $value){
 | |
| 224 |             $template->set_var('ERROR_VALUE', $value);
 | |
| 225 |             $template->parse('error_list', 'error_block', true);
 | |
| 226 | } | |
| 227 | } | |
| 228 |     $template->set_block('main_block', 'success_block', 'success_list');
 | |
| 229 |     if(sizeof($success)!=0){
 | |
| 230 |         foreach($success AS $value){
 | |
| 231 |             $template->set_var('SUCCESS_VALUE', $value);
 | |
| 232 |             $template->parse('success_list', 'success_block', true);
 | |
| 233 | } | |
| 234 | } | |
| 235 | // Parse template for preferences form | |
| 236 |     $template->parse('main', 'main_block', false);
 | |
| 237 |     $template->pparse('output', 'page');
 | |
| 0 | 238 | |
| branches/main/account/signup.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright Ryan Djurovich | |
| 8 | * @copyright WebsiteBaker Org. e.V. | |
| 9 | * @link http://websitebaker.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.3 | |
| 12 | * @requirements PHP 5.3.6 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | if ( !defined( 'WB_PATH' ) ){ require(dirname(__DIR__).'/config.php'); }
 | |
| 20 |  | |
| 21 | if (!(int)FRONTEND_SIGNUP || (int)($_SESSION['USER_ID'] ?: 0)) {
 | |
| 22 |     if(INTRO_PAGE) {
 | |
| 23 | $no_intro = true; | |
| 24 | } | |
| 25 | include dirname(__DIR__).'/index.php'; | |
| 26 | } | |
| 27 |  | |
| 28 | if(ENABLED_ASP && isset($_POST['username']) && ( // form faked? Check the honeypot-fields. | |
| 29 | (!isset($_POST['submitted_when']) OR !isset($_SESSION['submitted_when'])) OR | |
| 30 | ($_POST['submitted_when'] != $_SESSION['submitted_when']) OR | |
| 31 | (!isset($_POST['email-address']) OR $_POST['email-address']) OR | |
| 32 | (!isset($_POST['name']) OR $_POST['name']) OR | |
| 33 | (!isset($_POST['full_name']) OR $_POST['full_name']) | |
| 34 | )) {
 | |
| 35 |     exit(header("Location: ".WB_URL."/index.php"));
 | |
| 36 | } | |
| 37 |  | |
| 38 | // Load the language file | |
| 39 | if(!file_exists(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php')) {
 | |
| 40 |     exit('Error loading language file '.DEFAULT_LANGUAGE.', please check configuration');
 | |
| 41 | } else {
 | |
| 42 | require_once(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php'); | |
| 43 | $load_language = false; | |
| 44 | } | |
| 45 | $_SESSION['display_form'] = true; | |
| 46 |  | |
| 47 | $page_id = (int)($_SESSION['PAGE_ID'] ?: 0); | |
| 48 |  | |
| 49 | // Required page details | |
| 50 | // $page_id = 0; | |
| 51 | $page_description = ''; | |
| 52 | $page_keywords = ''; | |
| 53 | define('PAGE_ID', $page_id);
 | |
| 54 | define('ROOT_PARENT', 0);
 | |
| 55 | define('PARENT', 0);
 | |
| 56 | define('LEVEL', 0);
 | |
| 57 | define('PAGE_TITLE', $TEXT['SIGNUP']);
 | |
| 58 | define('MENU_TITLE', $TEXT['SIGNUP']);
 | |
| 59 | define('MODULE', '');
 | |
| 60 | define('VISIBILITY', 'public');
 | |
| 61 |  | |
| 62 | // Set the page content include file | |
| 63 |     define('PAGE_CONTENT', WB_PATH.'/account/signup_form.php');
 | |
| 64 |  | |
| 65 | // Set auto authentication to false | |
| 66 | $auto_auth = false; | |
| 67 |  | |
| 68 | // Include the index (wrapper) file | |
| 69 | require(WB_PATH.'/index.php'); | |
| 0 | 70 | |
| branches/main/account/signup2.php | ||
|---|---|---|
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category frontend | |
| 5 | * @package account | |
| 6 | * @author WebsiteBaker Project | |
Also available in: Unified diff
=== create main branch ===