/**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     // write master password file
     $file = new File(WCF_DIR . 'acp/masterPassword.inc.php');
     $file->write("<?php\n/** MASTER PASSWORD STORAGE\nDO NOT EDIT THIS FILE */\ndefine('MASTER_PASSWORD', '" . PasswordUtil::getDoubleSaltedHash($this->masterPassword) . "');\n?>");
     $file->close();
     FileUtil::makeWritable(WCF_DIR . 'acp/masterPassword.inc.php');
     parent::save();
 }
Ejemplo n.º 2
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();
	}