function init($args)
{
    $pass = $args['newPassword'];
    $cp = new ConfigWriter(PF_CONFIG_FILE);
    $cp->add("settings/password", md5($pass), TRUE);
    if (!$cp->close()) {
        error("Password not changed. Configuration file could not be opened.");
        return;
    }
    success("Password successfully changed");
}
Example #2
0
}
//check for gd and dom xml extensions
if (!extension_loaded('dom')) {
    error("The DOM extension is not loaded. It is needed for Pixelframe to run");
    $allDone = FALSE;
}
if (!extension_loaded('gd')) {
    error("The GD extension is not loaded. It is needed for Pixelframe to run");
    $allDone = FALSE;
}
//generate default stuff if needed
if (file_exists(PF_CONFIG_FILE)) {
    if ($allDone) {
        success(GOOD_TO_GO);
    }
} else {
    $conf = new ConfigWriter(PF_CONFIG_FILE);
    $conf->add("settings/password", md5(PF_DEFAULT_PASSWORD));
    if (!$conf->close()) {
        error("Could not write to file " . PF_CONFIG_FILE);
        $allDone = FALSE;
    } else {
        if ($allDone) {
            success("Wrote " . PF_NAME . " settings.");
            success(GOOD_TO_GO);
        }
    }
}
?>
</div>
</body>