コード例 #1
0
	/**
	 * @see	wcf\form\IForm::save()
	 */
	public function save() {
		// generate salt
		$salt = PasswordUtil::getRandomSalt();
		
		// write master password file
		$file = new File(WCF_DIR.'acp/masterPassword.inc.php');
		$file->write("<?php
/** MASTER PASSWORD STORAGE
DO NOT EDIT THIS FILE */
define('MASTER_PASSWORD', '".PasswordUtil::getSaltedHash($this->masterPassword, $salt)."');
define('MASTER_PASSWORD_SALT', '".$salt."');
?>");
		$file->close();
		@chmod(WCF_DIR.'acp/masterPassword.inc.php', 0777);
		
		parent::save();
	}