added repository for elastic search and install elastic serach package
added wheezy backports repository added script file to change password of user fixed problems regarding special characters (UTF-8)
This commit is contained in:
		
							
								
								
									
										38
									
								
								change_password
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								change_password
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,38 @@
 | 
			
		||||
#!/usr/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 = password_hash($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();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
?>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user