<?php
// +----------------------------------------------------------------------+
// | PHP version 4                                                        |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2005 Snapshot Inc.                                |
// +----------------------------------------------------------------------+
// | License                                                              |
// | GNU General Public License                                           |
// +----------------------------------------------------------------------+
// | Authors: Mai Kawasaki                                                |
// +----------------------------------------------------------------------+
//
// $Id: RegistAction.class.php,v 1.1 2005/06/20 09:31:25 snapshot Exp $
//
// Description:
// 2005/05/18
//


/** 
*	RegistAction.class.php
*	Mai Kawasaki
*	2005/05/18
*/
require_once(OPT_DIR.'u-learning/config.php');
require_once(OPT_DIR.'u-learning/action/SecureStudentAction.class.php');
require_once(OPT_DIR.'u-learning/data/Admin.class.php');
require_once(OPT_DIR.'u-learning/data/Student.class.php');

/** 
*	ConfirmAction
*/
class RegistAction extends SecureStudentAction {
    function execute (&$controller, &$request, &$user) {
	
		// ブラウザの判別
		$type = $this->getUserAgentType();
		$request->setAttribute('type', $type);	
	
		$DB = $request->getAttribute('DB');
		// 教員情報取得
		$request->setAttribute('admin', new Admin($user->getAttribute('aid'), $DB));
		
		// 解除処理
		$student = new Student($user->getAttribute('aid'), $user->getAttribute('uid'), $DB);
		$student->del = '1';
		$student->update(); 
		$user->clearAll();
		
		return VIEW_SUCCESS;
    }
	
}

?>