return $aryResult;
}
+function update_admin_password($conn, $password)
+{
+ $sql = "UPDATE ".$conn['tbpref']."users SET password=".db_escape($password) . "
+ WHERE user_id='admin'";
+ db_query($sql, "could not update user password for 'admin'");
+}
function write_config_db($new = false)
{
$filename = $path_to_root . "/config_db.php";
// Check if the file exists and is writable first.
- if (!file_exists($filename) || (is_writable($path_to_root) && is_writable($filename)))
+ if ((!file_exists($filename) && is_writable($path_to_root)) || is_writable($filename))
{
if (!$zp = fopen($filename, 'w'))
{
if (!isset($extensions)) {
$extensions = $installed_extensions;
}
-
+ if (!isset($next_extension_id)) {
+ $next_extension_id = 1;
+ }
// $exts = array_natsort($extensions, 'name', 'name');
// $extensions = $exts;
$all = implode("", file($path));
// convert path to name of ziped file
- $filename = ereg_replace(".*/", "", $path);
+ $filename = preg_replace("/.*\//", "", $path);
$filename = substr($filename, 0, strlen($filename) - 4);
// compare filname in zip and filename from $_GET
// check if field types are NULL or NOT NULL
$res3 = db_query("SHOW COLUMNS FROM `" . $tablename . "`");
- $field_type = array();
+ $field_null = array();
for ($j = 0; $j < db_num_rows($res3); $j++)
{
$row3 = db_fetch($res3);
- $field_type[] = $row3[2];
+ $field_null[] = $row3[2]=='YES' && $row3[4]===null;
}
$res2 = db_query("SELECT * FROM `" . $tablename . "`");
// run through each field
for ($k = 0; $k < $nf = db_num_fields($res2); $k++)
{
- $out .= db_escape(@html_entity_decode($row2[$k], ENT_QUOTES, $_SESSION['language']->encoding));
+ $out .= db_escape($row2[$k], $field_null[$k]);
if ($k < ($nf - 1))
$out .= ", ";
}