Example #1
0
	function beforeRender() {
		$this->layout='base';
		$this->user=$this->Auth->user();

		//usersテーブル検索
		$this->loadModel('Users');
		$username=$this->user['User']['username'];
		$users=$this->Users->find('all', array('conditions' => "username='******'"));
		if ( count($users) > 0 ){
			$this->user['User']['authority']=$users[0]['Users']['authority'];
		}

		//権限情報が未設定の場合(LDAP認証やWebHiveリポジトリでauthorityが未設定の場合)
		if ( empty($this->user['User']['authority']) ){
			$this->user['User']['authority']=LDAP_AUTH;

			//初回ログイン時はDB登録
			$reg=array();
			$reg['Users']['username']=$this->user['User']['username'];
			$reg['Users']['authority']=$this->user['User']['authority'];
			$this->Users->create();
			$this->Users->save($reg, array('username','authority'));
		}

		$this->set('user', $this->user);
		$this->set('app_title_msg', CommonComponent::GetSubTitle());
	}
	function beforeFilter() {
		$this->set('app_title_msg', CommonComponent::GetSubTitle());

                //admin権限以外はHiveQL画面表示不可
		$ck=0;
                $user=$this->Auth->user();
                if ( !empty($user) ){
                	if ( $user['User']['authority'] == 1 ){ $ck=1; }
		}
		if ( $ck == 0 ){ $this->redirect('/errors'); }
        }
Example #3
0
	function index() {
		$tips="";
		if ( ($fp=fopen(TIPS_FILE,"r")) ){
			while(!feof($fp)){
				$data = fgets($fp, 512);
				$tips .= $data;
			}
			fclose($fp);
		}

		$this->set('app_title_msg', CommonComponent::GetSubTitle());
		$this->set("tips" , array("tips" => "$tips"));
	}
Example #4
0
	function index() {
		//インフォメーションファイル
		$info="";
		if ( ($fp=fopen(INFORMATION_FILE,"r")) ){
			while(!feof($fp)){
				$data = fgets($fp, 512);
				$info .= $data;
			}
			fclose($fp);
		}

		$this->set('app_title_msg', CommonComponent::GetSubTitle());
		$this->set("info" , array("info" => "$info"));
	}
	function beforeRender() {
		$this->set('app_title_msg', CommonComponent::GetSubTitle());
	}
	function beforeRender() {
		$this->user=$this->Auth->user();
		$this->set('user', $this->user);
		$this->set('app_title_msg', CommonComponent::GetSubTitle());
	}
	function index() {
		$this->set('app_title_msg', CommonComponent::GetSubTitle());
	}