Project

General

Profile

« Previous | Next » 

Revision 449

Added by Matthias about 17 years ago

Removed changeset [417] from the 2.6.x branches because it is for WB 2.7.x versions

View differences:

save.php
63 63
			$_SESSION['admin_username'] = $_POST['admin_username'];
64 64
			$_SESSION['admin_email'] = $_POST['admin_email'];
65 65
			$_SESSION['admin_password'] = $_POST['admin_password'];
66

  
67
			if(!isset($_POST['outgoing_mails'])) {
68
				$_SESSION['outgoing_mails'] = 'php';
69
			} else {
70
				$_SESSION['outgoing_mails'] = $_POST['outgoing_mails'];
71
			}
72
			$_SESSION['smtp_server'] = $_POST['smtp_server'];
73

  
66 74
		}
67 75
		// Set the message
68 76
		$_SESSION['message'] = $message;
......
257 265
}
258 266
// End admin user details code
259 267

  
268
// Get the SMTP server settings and check if valid
269
$smtp_server_used = "mail.example.com";
270
if(isset($_POST['outgoing_mails']) AND $_POST['outgoing_mails']=="smtp") {
271
	if($_POST['smtp_server'] == "" || $_POST['smtp_server'] == "mail.example.com") {
272
		set_error('Please define the SMTP host (Step 7) of your domain or choose option PHP mail().');
273
	} else {
274
		$smtp_server_used = $_POST['smtp_server'];
275
	}
276
}
277

  
278
// Create SMTP server output string for the config.php file
279
if($smtp_server_used == "mail.example.com") {
280
	$smtp_server_used = "// define('WBMAILER_SMTP_HOST', '" .$smtp_server_used ."');\n";
281
} else {
282
	$smtp_server_used = "define('WBMAILER_SMTP_HOST', '" .$smtp_server_used ."');\n";
283
}   
284
// End SMTP server settings
285

  
260 286
// Try and write settings to config file
261 287
$config_content = "" .
262 288
"<?php\n".
......
273 299
"define('ADMIN_PATH', WB_PATH.'/admin');\n".
274 300
"define('ADMIN_URL', '$wb_url/admin');\n".
275 301
"\n".
302
"// some mail provider do not deliver mails send via PHP mail() function as SMTP authentification is missing\n".
303
"// in that case activate SMTP for outgoing mails: un-comment next line and specify SMTP host of your domain\n".
304
$smtp_server_used.
305
"\n".
276 306
"require_once(WB_PATH.'/framework/initialize.php');\n".
277 307
"\n".
278 308
"?>";
......
446 476
	." ('media_directory', '/media'),"
447 477
	." ('operating_system', '$operating_system'),"
448 478
	." ('string_file_mode', '$file_mode'),"
449
	." ('string_dir_mode', '$dir_mode'),"
450
	." ('wbmailer_routine', 'phpmail'),"
451
	." ('wbmailer_smtp_host', ''),"
452
	." ('wbmailer_smtp_auth', ''),"
453
	." ('wbmailer_smtp_username', ''),"
454
	." ('wbmailer_smtp_password', '')";
479
	." ('string_dir_mode', '$dir_mode')";
455 480
	$database->query($settings_rows);
456 481
	
482
	
457 483
	// Users table
458 484
	$users = 'CREATE TABLE `'.TABLE_PREFIX.'users` ( `user_id` INT NOT NULL auto_increment,'
459 485
	       . ' `group_id` INT NOT NULL DEFAULT \'0\','

Also available in: Unified diff