public function addAction()
	{
		$addForm = new System_Forms_UserSave();
		$users = new System_Models_UserMapper();
		$addForm->submit->setLabel('创建建用户');
		$errorMsg = null;
		$ugs = new System_Models_UsergroupMapper();
		$ugs->populateDd($addForm);
		$addForm = $users->formValidator($addForm,0);
			
		if($this->getRequest()->isPost())
		{
			$formData = $this->getRequest()->getPost();
			if($addForm->isValid($formData))
			{
				$array = $users->dataValidator($formData,0);
				$trigger = $array['trigger'];
				$errorMsg = $array['errorMsg'];
				if($trigger == 0)
				{
					$cTime = date("Y-m-d,H:m");
					$creatorId = $this->getUserId();
					$creatorCid = $users->getContactId($creatorId);
					$user = new System_Models_User();
					$salt = md5(General_Models_GenRandomString::genRandomString(8));
					$password = sha1($formData['password'].$salt);
					$user->setUserName($addForm->getValue('username'));
					$user->setPassword($password);
					$user->setSalt($salt);
					$user->setGroupId($addForm->getValue('groupId'));
					$user->setContactId($addForm->getValue('contactId'));
					$user->setCreatorId($creatorCid);
					$user->setCTime($cTime);
					$users->save($user);
					$this->_helper->flashMessenger->addMessage('添加用户成功。');
					$this->_redirect('/system/user');
					}
					else
					{
						$addForm->populate($formData);
						}
				}
				else
				{
					$addForm->populate($formData);
					}
		}
		$this->view->errorMsg = $errorMsg;
		$this->view->addForm = $addForm;
	}
	public function indexAction()
	{
		$userId = $this->getUserId();
		$editForm = new System_Forms_UserEdit();
		$users = new System_Models_UserMapper();
		$user = new System_Models_User();
		$users->find($userId,$user);
		$editForm->submit->setLabel('修改密码');
		$errorMsg = null;
		$ugs = new System_Models_UsergroupMapper();
		$editForm = $users->formValidatorEdit($editForm);
			
		if($this->getRequest()->isPost())
		{
			$formData = $this->getRequest()->getPost();
			if($editForm->isValid($formData))
			{
				$array = $users->dataValidatorEdit($formData,$userId);
				$trigger = $array['trigger'];
				$errorMsg = $array['errorMsg'];
				if($trigger == 0)
				{
					$salt = md5(General_Models_GenRandomString::genRandomString(8));
					$password = sha1($formData['password'].$salt);
					$user->setPassword($password);
					$user->setSalt($salt);
					$users->save($user);
					$this->_redirect('/admin/login/logout');
					}
					else
					{
						$editForm->populate($formData);
						}
				}
				else
				{
					$editForm->populate($formData);
					}
		}
		$this->view->user = $user;
		$this->view->errorMsg = $errorMsg;
		$this->view->editForm = $editForm;
	}