<?php
class cls_tab_sys_findpwd extends cls_base_table
{
	private $tab_session;
	private $obj_db;
	//构造函数
	function __construct()
	{
		global $obj_db;
		parent::__construct();
		$this->obj_db=$obj_db;
	}
	function on_save($arr_fields=array())
	{
		$arr_return=array("err"=>"");
		if(!isset($arr_fields["findpwd_user_id"])||!is_numeric($arr_fields["findpwd_user_id"])){
			$arr_return["err"]="用户id不能为空！";
			return $arr_return;
		}
		if(!isset($arr_fields["findpwd_email"])||chk_email($arr_fields["findpwd_email"])!=""){
			$arr_return["err"]="用户邮箱不存在！";
			return $arr_return;
		}

		$arr_fields["findpwd_key"]=md5(TIME.rand(1,10000).$arr_fields["findpwd_email"]);
		$arr_fields["findpwd_addtime"]=TIME;
		$arr_return=parent::on_insert(DB_PRE."sys_findpwd",$arr_fields);
		$arr_return["key"]=$arr_fields["findpwd_key"];
		return $arr_return;
	}

}
?>
