<?php 
/**
*	接口
*/
class indexClassAction extends apiAction
{

	
	/**
	*	修改密码
	*/
	public function editpassAction()
	{
		$passoldPost 	= $this->post('passoldPost');
		$passwordPost 	= $this->post('passwordPost');
		$password1Post 	= $this->post('password1Post');
		
		if(isempt($passwordPost) || isempt($passoldPost))return returnerror('无效输入');
		
		$rand 	= $this->adminrs['rand'];
		if(!isempt($rand))$passoldPost.=$rand;
		if(md5($passoldPost) != $this->adminrs['pass'])return returnerror('旧密码错误');
		
		$rand 	= 'edit'.rand(10000,99999).'';
		m('users')->update(array(
			'rand' => $rand,
			'pass' => md5($passwordPost.$rand)
		),$this->adminid);
		
		
		return returnsuccess('修改成功');
	}
}