mirror of
https://github.com/gfacciol/zotero_dataserver-docker.git
synced 2021-05-12 18:32:26 +03:00
23 lines
564 B
PHP
Executable File
23 lines
564 B
PHP
Executable File
#!/usr/bin/php
|
|
<?
|
|
set_include_path("../include");
|
|
require("header.inc.php");
|
|
|
|
if (empty($argv[1]) || empty($argv[2]) || empty($argv[3])) {
|
|
die("Usage: $argv[0] " . '$userID $username $password' . "\n");
|
|
}
|
|
|
|
$userID = $argv[1];
|
|
$username = $argv[2];
|
|
$password = $argv[3];
|
|
$salt = Z_CONFIG::$AUTH_SALT;
|
|
|
|
echo "Adding new user $username with ID $userID\n";
|
|
Zotero_Users::add($userID, $username);
|
|
|
|
$hash = SHA1($salt . $password);
|
|
echo "$salt . $password $hash\n";
|
|
$sql = "update users set password=? where userid=?";
|
|
Zotero_DB::query($sql, array($hash, $userID));
|
|
?>
|