La Paste
Create new paste
Pastes Archive
2024-03-06 17:12:41
copy
raw
download
CREATE OR REPLACE VIEW `mlg_clients` ( `nasname`, `shortname`, `type`, `ports`, `secret`, `server` ) AS SELECT DISTINCT COALESCE( mlg_nascustom.ip, nas.`nasip`, NULL ) AS `nasname`, COALESCE( mlg_nascustom.name, nas.`nasname`, NULL ) AS `shortname`, 'other' AS `type`, NULL AS `ports`, COALESCE( mlg_nascustom.secret, left( md5( inet_aton(nas.`nasip`) ), 12 ), NULL ) AS `secret`, NULL AS `server` from `nas` left join mlg_nascustom on (nas.nasip = mlg_nascustom.ip) GROUP BY nasname UNION SELECT DISTINCT `ip` AS `nasname`, `name` AS `shortname`, 'other' AS `type`, NULL AS `ports`, `secret` as `secret`, NULL as `server` from `mlg_nascustom` LEFT JOIN nas ON (mlg_nascustom.ip = nas.nasip) where nasname is null GROUP BY `ip`; CREATE TABLE IF NOT EXISTS `mlg_check` ( id int(11) unsigned NOT NULL auto_increment, username varchar(64) NOT NULL default '', attribute varchar(64) NOT NULL default '', op char(2) NOT NULL DEFAULT '==', value varchar(253) NOT NULL default '', PRIMARY KEY (id), KEY username ( username(32) ) ) ENGINE = MyISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT = 1;
↑