<?php
/**
 *  User/Update.php
 *
 *  @author     {$author}
 *  @package    Secioss
 *  @version    $Id: skel.view.php,v 1.8 2006/11/06 14:31:24 cocoitiban Exp $
 */

/**
 *  user_updateビューの実装
 *
 *  @author     {$author}
 *  @access     public
 *  @package    Secioss
 */
class Secioss_View_UserUpdate extends Secioss_ViewClass
{
    /**
     *  遷移前処理
     *
     *  @access public
     */
    function preforward()
    {
        $auth =& $this->backend->getManager('Auth');
        $logger =& $this->backend->getLogger();
        $conf = $this->config->get('secioss');

        if (isset($conf['sync'])) {
            $this->af->sync_select = $conf['sync'];
        }

        $conf = $this->config->get('ldap');
        if (isset($conf['type'])) {
            $type = $this->session->get('ldaptype');
            if (!$type) {
                if ($conf['type'] != 'LISM') {
                    $type = $conf['type'];
                } else {
                    $values = $auth->readCluster('master');
                    if(Ethna::isError($values)) {
                        $logger->log(LOG_ERR, $values->getMessage());
                        return;
                    }

                    if ($values) {
                        $type = $values[0];
                    }
                }
                $this->session->set('ldaptype', $type);
            }
        }
    }
}
?>
