Viewing file: upgrade.php (1.81 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/* As of 0.8beta5 admin password is stored hashed in the DB, so we
need to update it ! */
if(!file_exists("include/config.php")){
header("Location:./admin/index.php");
exit;
}
include("include/config.php");
include("include/lib/libconfig.php");
include("include/interface.php");
include("include/db/db_".$db_type.".inc.php");
include("admin/include/function.php");
$conf = new config();
$r = $conf->getConfig($hostname,$login,$pass,$database, $table_global_config);
if ( $r != 'SUCCESS'){
include("./include/lang/english.php");
echo "<div class='error'>".translate($r)."<br>";
echo "</div>";
exit;
}
if(empty($conf->language)) $conf->language="english";
include("./include/lang/".$conf->language.".php");
$admin_pass = (empty($_POST['admin_pass']) ? null : $_POST['admin_pass']);
if(!isset($admin_pass)){
print '<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="phpmynewsletter.css" type="text/css" />
<title></title></head><body>
<br />';
print info_msg(translate("PASSWORD_MD5_NOTICE"));
print '
<form action="upgrade.php" method="post">
'.translate("PASSWORD_MD5_PWD").'<input type="password" name="admin_pass"> <input type="submit">
</form>';
} else {
if( upgrade_password($hostname,$login ,$pass,$database,$table_global_config, $admin_pass) ){
header("Location:admin/index.php?form_pass=$admin_pass");
exit();
} else {
print '<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="phpmynewsletter.css" type="text/css" />
<title></title></head><body>
<br />';
print error_msg((DbError() ? translate("PASSWORD_MD5_ERR2", DbError()) : translate("PASSWORD_MD5_ERR")));
}
}
print '</body></html>';
?>
|