Project

General

Profile

« Previous | Next » 

Revision 451

Added by Matthias over 17 years ago

Added Changeset [417] again to the trunk because removing it from the branches also removed it from the trunk

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

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

  
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

  
286 260
// Try and write settings to config file
287 261
$config_content = "" .
288 262
"<?php\n".
......
299 273
"define('ADMIN_PATH', WB_PATH.'/admin');\n".
300 274
"define('ADMIN_URL', '$wb_url/admin');\n".
301 275
"\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".
306 276
"require_once(WB_PATH.'/framework/initialize.php');\n".
307 277
"\n".
308 278
"?>";
......
476 446
	." ('media_directory', '/media'),"
477 447
	." ('operating_system', '$operating_system'),"
478 448
	." ('string_file_mode', '$file_mode'),"
479
	." ('string_dir_mode', '$dir_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', '')";
480 455
	$database->query($settings_rows);
481 456
	
482
	
483 457
	// Users table
484 458
	$users = 'CREATE TABLE `'.TABLE_PREFIX.'users` ( `user_id` INT NOT NULL auto_increment,'
485 459
	       . ' `group_id` INT NOT NULL DEFAULT \'0\','

Also available in: Unified diff