Execute Automatic Auth form

@param  string $table_name テーブル名
@param  array $inquiries 照会するカラム名
@return boolean Success to `true`, Failed, or NOT Login to `false`.
541246
public function auth($table_name, $inquiries){
		$options = $this->get_options();
		$data = $options['post_params'];

		if(@$this->query_options['action'] == 'login'){
			// ログインを試みる
			$result = $this->exdb->user()->login( $table_name, $inquiries, $data );
		}


		$is_login = $this->exdb->user()->is_login($table_name);
		if( $is_login ){
			// ログイン処理済みなら終了
			return true;
		}

		$table_definition = $this->exdb->get_table_definition($table_name);
		// var_dump($table_definition->columns);

		$rtn = '';
		foreach( $inquiries as $column_name ){
			$column_definition = $table_definition->columns->{$column_name};
			$type_info = $this->exdb->form_elements()->get_type_info($column_definition->type);
			$form_elm = $this->render(
				$type_info['templates']['preview'],
				array(
					'value'=>@$list[0][$column_definition->name],
					'name'=>@$column_definition->name,
					'def'=>@$column_definition,
				)
			);
			$rtn .= $this->render(
				'form_elms_unit.html',
				array(
					'label'=>@$column_definition->label,
					'content'=>$form_elm,
					'error'=>null,
				)
			);
		}

		$rtn = $this->render(
			'form_login.html',
			array(
				'is_error'=>(@$this->query_options['action'] == 'login'),
				'content'=>$rtn,
			)
		);
		// var_dump($table_list);
		$rtn = $this->wrap_theme($rtn);
		echo $rtn;
		return false;

	}
1292730
public static function getHlId($table_name)
    {
        if (!isset(static::$hls[$table_name])) {
            $dbRes = Application::getConnection()->query('SELECT `ID`, `NAME`, `TABLE_NAME` FROM b_hlblock_entity');
            while ($block = $dbRes->fetch()) {
                static::$hls[$block['TABLE_NAME']] = $block;
            }
        }

        return static::$hls[$table_name]['ID'];
    }
1037948
public function automatic_signup_form($table_name, $init_cols, $options = array()){
		@header('text/html; charset=UTF-8');

		$param_options = $this->get_options();
		$data = $param_options['post_params'];

		$this->table_definition = $this->exdb->get_table_definition($table_name);

		$is_login = $this->exdb->user()->is_login($table_name);
		if( $is_login ){
			// ログイン処理済みなら終了
			echo '<p>Already Logging in.</p>';
			return true;
		}
		$page_edit = new endpoint_form_signup($this->exdb, $this, $table_name, $init_cols, $options);
		echo $page_edit->execute();

		return true;
	}
314170
function _query($sql,$inputarr=false)
		{
            // <G. Giunta 2003/03/03/> Reset error messages before executing
            $this->_errorMsg = false;
		    $this->_errorCode = false;

			$curs = ora_open($this->_connectionID);

		 	if ($curs === false) return false;
			$this->_curs = $curs;
			if (!ora_parse($curs,$sql)) return false;
			if (ora_exec($curs)) return $curs;
            // <G. Giunta 2004/03/03> before we close the cursor, we have to store the error message
            // that we can obtain ONLY from the cursor (and not from the connection)
            $this->_errorCode = @ora_errorcode($curs);
            $this->_errorMsg = @ora_error($curs);
            // </G. Giunta 2004/03/03>
		 	@ora_close($curs);
			return false;
		}
1269439
public function getPkeys ($table_name, $forced_obtain = false) {
		if (!isset(array_flip($this->getTables($forced_obtain))[$table_name])) {
			throw CoreException::RaiseSystemError('存在しないテーブルを指定されました。table_name:%s', [$table_name]);
		}
		if ($forced_obtain || !Arrays::KeyExists($this->_primaryKeys, $table_name)) {
			$this->_updatePkeys($table_name);
		}
		return $this->_primaryKeys[$table_name];
	}
1194502
def tableexists(tablename):
    """"""
    result = True
    try:
        t = table(tablename, ack=False)
    except:
        result = False
    return result
615077
protected function queryAddAccessPolicyCondition($access_policy_name, $query)
	{
		// Allow by default
		if (empty($access_policy_name)) {
			return;
		}

		if (!isset($this->access_policies[$access_policy_name])) {
			throw new \InvalidArgumentException('Unknown policy: '.$access_policy_name);
		}
		$access_policy = $this->access_policies[$access_policy_name];

		//debug_dump($access_policy, 'POLICY: '.$access_policy_name.' @ '.get_class($this));

		if ($this->auth->isAllMighty()) {
			// FIXME: Remove hardcoded role name
			return;
		}

		switch ($access_policy['type']) {

			// anyone: Completely open for anyone
			case 'anyone':
				return;

			// anonymous: Only anonymous users allowed (not logged in)
			case 'anonymous':
				$user_id = $this->auth->getUserId();
				$query->where($user_id === null ? 'TRUE' : 'FALSE');
				return;

			// user: All logged-in users allowed
			case 'user':
				$user_id = $this->auth->getUserId();
				$query->where($user_id !== null ? 'TRUE' : 'FALSE');
				return;

			// owner: Owner must match current user
			case 'owner':
				$user_id = $this->auth->getUserId();
				$owner_property = $query->quoteIdent($access_policy['owner_property']);
				$table = $query->quoteIdent($this->table);
				if (isset($access_policy['session_state'])) {
					if ($this->auth->getSessionMachine()->state != $access_policy['session_state']) {
						$query->where('FALSE');
						return;
					}
				}
				if ($user_id === null) {
					$query->where("$table.$owner_property IS NULL");
					return;
				} else {
					$query->where("$table.$owner_property = ?", $user_id);
					return;
				}

			// role: Current user must have specified role ($ref is ignored)
			case 'role':
				$query->where($this->auth->hasUserRoles($access_policy['required_role']) ? 'TRUE' : 'FALSE');
				return;

			// These are done by SQL select.
			case 'condition':
				$this->queryAddSimpleAccessPolicyCondition($access_policy_name, $access_policy, $query, 'where');
				return;

			// These are done by SQL select.
			case 'user_relation':
				$this->queryAddUserRelationAccessPolicyCondition($access_policy_name, $access_policy, $query, 'where');
				return;

			// unknown policies are considered unsafe
			default:
				$query->where('FALSE');
				return;
		}

		// This should not happen.
		throw new \RuntimeException('Policy '.$policy.' did not decide.');
	}
1126644
public function autoIncrement($table, $column, $triggerName, $sequenceName)
    {
        if (! $table || ! $column || ! $triggerName || ! $sequenceName) {
            return false;
        }

        if ($this->connection->getConfig('prefix_schema')) {
            $table        = $this->connection->getConfig('prefix_schema') . '.' . $table;
            $triggerName  = $this->connection->getConfig('prefix_schema') . '.' . $triggerName;
            $sequenceName = $this->connection->getConfig('prefix_schema') . '.' . $sequenceName;
        }

        $table  = $this->wrapValue($table);
        $column = $this->wrapValue($column);

        return $this->connection->statement("
            create trigger $triggerName
            before insert on {$table}
            for each row
                begin
            if :new.{$column} is null then
                select {$sequenceName}.nextval into :new.{$column} from dual;
            end if;
            end;");
    }
224965
public function setLookupDisplay($query_name, $abbrev_name = false)
    {

        if (!$query_name) {
            return;
        }

        if (!$this->checkColumnNameR("setLookupDisplay", $query_name)) {
            ReporticoApp::handleError("Failure in Lookup Display: Unknown Column Name $query_name");
            return;
        }

        if ($cl = ReporticoUtility::getQueryColumn($query_name, $this->columns)) {
            foreach ($this->columns as $k => $v) {
                $this->columns[$k]->lookup_display_flag = false;
                $this->columns[$k]->lookup_abbrev_flag = false;
            }

            $cl->lookup_display_flag = true;

            if ($abbrev_name) {
                $col2 = ReporticoUtility::getQueryColumn($abbrev_name, $this->columns);
                $col2->lookup_abbrev_flag = true;
            } else {
                $cl->lookup_abbrev_flag = true;
            }

        }
    }
122177
public function scan_table($table_name = '')
    {

        if (empty($table_name)) return false;

        $this->_l_table_name                  = strtolower($table_name);
        $this->table_name                     = $table_name;
        $this->tpl_replacements['table_name'] = $table_name;
        // get a more detailed description of the table
        $sql = "SHOW FULL COLUMNS FROM `$table_name`";

        $res               = $this->db->query($sql);
        $this->table_model = $this->db->fetch_object_list($res);

        return true;
    }
1317155
public function get_login_user_info( $table_name ){
		$user_info = $this->exdb->session()->get('user_info');
		if( is_array( @$user_info[$table_name] ) ){
			return $user_info[$table_name];
		}
		return false;
	}
493389
def delete(self, table_name, where=None):
        

        self.validate_access_permission(["w", "a"])
        self.verify_table_existence(table_name)

        query = "DELETE FROM {:s}".format(table_name)
        if where:
            query += " WHERE {:s}".format(where)

        return self.execute_query(query, logging.getLogger().findCaller())
1026087
public function use_database($db_name)
    {
        if (!$this->mysqli) {
            $this->last_error_id = "db_server_conn_error";
            return false;
        }
        
        $this->db_name = $db_name;
        
        if (!@$this->mysqli->select_db($this->db_name)) {
            $this->last_error = $this->mysqli->error;
            $this->last_error_id = "db_not_exists_error";
            trigger_error($this->last_error, E_USER_ERROR);
            return false;
        }
        
        return true;
    }
1041594
public function tableExists($tableName, $connectionName = 'default')
    {
        try {
            $db = ConnectionManager::get($connectionName);
            $collection = $db->schemaCollection();
            $tables = $collection->listTables();
            if (in_array($tableName, $tables)) {
                return true;
            }
        } catch (PDOException $connectionError) {
            return false;
        }
        return false;
    }
632418
public function create ($table_name, array $values = [], array $options = []) {
		if (isset($options['create_filter']) && is_callable($options['create_filter'])) {
			$values = $options['create_filter']($values);
		}

		$column_name_list = array_keys($values[0]);
		$query = sprintf(
 			'INSERT INTO %s (%s%s%s) VALUES (%s)',
 			$table_name,
			static::IDENTIFIER,
 			implode(static::IDENTIFIER.', '.static::IDENTIFIER, $column_name_list),
			static::IDENTIFIER,
 			implode(', ', array_fill(0, count($column_name_list), '?'))
 		);

 		$ret = [];
 		try {
			$stmt = $this->prepare($query);
			foreach ($values as $value) {
				$i = 1;
				foreach ($value as $column_name => $column_value) {
					$stmt->bindValue($i++, $column_value);
				}
				if (!$stmt->execute()) {
					//
				}
				$ret[] = $this->lastInsertId();
			}
		} catch (\PDOException $pdo_e) {
			StaticLog::WriteLog('sql_error', implode(', ', $this->errorInfo()));

			StaticLog::WriteLog('sql_error', serialize($values));

			throw $pdo_e;
		}

		return $ret;
	}
744636
public static function for_table($table_name, $connection_name = parent::DEFAULT_CONNECTION)
        {
            self::_setupDb($connection_name);

            return new self($table_name, [], $connection_name);
        }
774481
public function isDbTableExists($tableName)
    {
        $status = false;
        $resultSet = array();

        $query = $this->executeRawQuery("SHOW TABLES LIKE '".trim($tableName)."';");
        if($resultSet)
            $resultSet = $query->toArray();



        if(!empty($resultSet)) {
            $status = true;

        }

        return $status;
    }