2017-07-30 16:33:11 -04:00
|
|
|
#!/usr/local/bin/php
|
2014-11-18 21:27:07 -05:00
|
|
|
<?
|
|
|
|
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";
|
|
|
|
|
2017-07-30 16:13:40 -04:00
|
|
|
$passwordhash = md5($password, PASSWORD_DEFAULT);
|
2014-11-18 21:27:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|