<?php
/*
Plugin Name: Freeze Users
Version: 0.1
Plugin URI: http://txfx.net/
Description: Prevents defined users from changing their password
Author: Mark Jaquith
Author URI: http://txfx.net/
*/


/* Set $wp_freeze_users in this manor:

$wp_freeze_users = array(
array('id' => '1', 'pw' => 'password1'),
array('id' => '2', 'pw' => 'password2')
)

Note that the last inner array doesn't have a comma after it.

*/

$wp_freeze_users = NULL;



/* Do not edit below here */
function wp_freeze_pw($user_pw_array = FALSE){
global $wpdb;

if ($user_pw_array) {

foreach ($user_pw_array as $user){
$updatepassword = "user_pass=MD5('" . $user['pw'] . "') ";
$query = "UPDATE $wpdb->users SET $updatepassword WHERE ID = '" . $user['id'] . "' LIMIT 1";
$result = $wpdb->query($query);
		} // end foreach()
	} // end if (isSet($user_pw_array))
} // end function

wp_freeze_pw($wp_freeze_users);
?>