You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
649 B

#!/usr/local/bin/php
<?
set_include_path("../include");
require("header.inc.php");
if (empty($argv[1])) {
die("Usage: $argv[0] " . '$username $password' . "\n");
}
$username = $argv[1];
$password = $argv[2];
$docRoot = str_replace($_SERVER['SCRIPT_NAME'], '', __FILE__);
echo $docRoot;
echo "changing password for user $username\n";
$passwordhash = md5($password, PASSWORD_DEFAULT);
Zotero_DB::beginTransaction();
$sql = "SET NAMES UTF8;";
Zotero_DB::query($sql);
$sql = "UPDATE zotero_www.users SET password=? WHERE username=?";
Zotero_DB::query($sql, array($passwordhash,$username));
Zotero_DB::commit();
?>