<?php
/*
 * system/tools/notify/TemporaryPassword.class.php
 * 
 * CopyRight(C) 2010 Shopformer Development Team. All Right Reserved
 * URL: http://sourceforge.jp/projects/shopformer/
 * 
 * 
 * Mail: m_nakashima@users.sourceforge.jp
 * Auther: Masanori Nakashima
 * Last Update: 2010-06-18
 */
require_once(dirname(dirname(dirname(__FILE__)))
.DIRECTORY_SEPARATOR.'PackageConfig.class.php');
/**
 * spider : 
 * 
 * @package system
 * @subpackage tools
 * @category module
 * @version 1.2.00
 * @copyright Copyright(c)2011, Shopformer Development Team. <shopformer-dev@lists.sourceforge.jp>
 * @author Masanori Nakashima
 * @access public
 */
class system_tools_notify_TemporaryPassword extends spider_ModuleBase {

	function system_tools_notify_TemporaryPassword(){
	}

	function execute( & $request ) {
		$password	= util_CharUtility::createRundomAlphabet(6);
		$request->setSession('util.tempolarypassword.password',$password);
		$is_gd_enable	= false;
		if( function_exists('imagecreate') && function_exists('imagecolorallocate')
			&& function_exists('imagestring') ) {
			// GDがインストールされていてイメージを作成できるなら
			$is_gd_enable	= true;
		}
		$request->setAttribute('system.tools.notify.is_gd_enable', $is_gd_enable );
		$request->setAttribute('system.tools.notify.passowrd', $password );
	}
}
?>