function setupMode() { global $init; if (empty($this->dataSet['MPASS1']) || empty($this->dataSet['MPASS2']) || strcmp($this->dataSet['MPASS1'], $this->dataSet['MPASS2'])) { HakoError::wrongMasterPassword(); return 0; } else { if (empty($this->dataSet['SPASS1']) || empty($this->dataSet['SPASS2']) || strcmp($this->dataSet['SPASS1'], $this->dataSet['SPASS2'])) { HakoError::wrongSpecialPassword(); return 0; } } $masterPassword = crypt($this->dataSet['MPASS1'], 'ma'); $specialPassword = crypt($this->dataSet['SPASS1'], 'sp'); $fp = fopen("{$init->passwordFile}", "w"); fputs($fp, "{$masterPassword}\n"); fputs($fp, "{$specialPassword}\n"); fclose($fp); }