index.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <?php
  2. header('Content-type: text/plain');
  3. require_once('header.php');
  4. if(!isset($_GET['user']) || !isset($_GET['key']) || !isset($_GET['server'])){
  5. $opts = getopt('u:k:s:',Array('user:','key:','server:'));
  6. $_GET['user'] = isset($opts['user'])?$opts['user']:(isset($opts['u'])?$opts['u']:false);
  7. $_GET['key'] = isset($opts['key'])?$opts['key']:(isset($opts['k'])?$opts['k']:false);
  8. $_GET['server'] = isset($opts['server'])?$opts['server']:(isset($opts['s'])?$opts['s']:false);
  9. if(!$_GET['user'] || !$_GET['key'] || !$_GET['server']){
  10. header('Location: site/');
  11. die();
  12. }
  13. }
  14. $user = get_current_user_obj('netadmin') or $user = get_current_user_obj('servermanager') or $user = get_current_user_obj('globaladmin') or die('# Invalid user/key pair.');
  15. $server = get_current_server_obj() or die('# Invalid server name');;
  16. $opers = get_opers_for_server_obj($server['id']);
  17. $pass = mkpasswd(get_conf('server-pass'));
  18. ?>
  19. #################################################
  20. ## Classes ##
  21. #################################################
  22. class clients
  23. {
  24. pingfreq 120;
  25. maxclients 500;
  26. sendq 100000;
  27. recvq 8000;
  28. };
  29. class servers
  30. {
  31. pingfreq 120;
  32. maxclients 11;
  33. sendq 1000000;
  34. connfreq 100;
  35. };
  36. #################################################
  37. ## Me ##
  38. #################################################
  39. me {
  40. name "<?php echo $server['host'];?>";
  41. info "<?php echo $server['description'];?>";
  42. numeric <?php echo $server['id'];?>;
  43. };
  44. #################################################
  45. ## Admin ##
  46. #################################################
  47. admin {
  48. "<?php echo $user['real_name'];?>";
  49. "<?php echo $user['nick'];?>";
  50. "<?php echo $user['email'];?>";
  51. };
  52. #################################################
  53. ## Listeners ##
  54. #################################################
  55. listen *:6697
  56. {
  57. options
  58. {
  59. ssl;
  60. clientsonly;
  61. };
  62. };
  63. listen *:8067;
  64. listen *:6667;
  65. listen *:6666;
  66. listen *:6665;
  67. listen *:7150
  68. {
  69. options
  70. {
  71. serversonly;
  72. };
  73. };
  74. listen *:7100
  75. {
  76. options
  77. {
  78. ssl;
  79. serversonly;
  80. };
  81. };
  82. #################################################
  83. ## Link ##
  84. #################################################
  85. <?php
  86. $ulines = get_ulines_obj();
  87. foreach($ulines as $k => $u){?>
  88. link <?php echo $u['host'];?> {
  89. username *;
  90. hostname *;
  91. bind-ip *;
  92. hub *;
  93. port 7150;
  94. password-receive "<?php echo $pass ?>" { sha1; };
  95. password-connect "<?php echo get_conf('server-pass'); ?>";
  96. class servers;
  97. };
  98. <?php
  99. }
  100. if(!is_null($server['parent'])){?>
  101. link <?php echo $server['parent']['host'];?> {
  102. username *;
  103. hostname <?php echo $server['parent']['ip'];?>;
  104. bind-ip *;
  105. hub *;
  106. port 7100;
  107. password-receive "<?php echo $pass ?>" { sha1; };
  108. password-connect "<?php echo get_conf('server-pass'); ?>";
  109. class servers;
  110. options
  111. {
  112. zip;
  113. ssl;
  114. autoconnect;
  115. nodnscache;
  116. nohostcheck;
  117. };
  118. };
  119. <?php
  120. }
  121. if(isset($server['children'])){
  122. foreach($server['children'] as $k => $c){?>
  123. link <?php echo $c['host'];?> {
  124. username *;
  125. hostname <?php echo $c['ip'];?>;
  126. bind-ip *;
  127. hub *;
  128. port 7100;
  129. password-receive "<?php echo $pass ?>" { sha1; };
  130. password-connect "<?php echo get_conf('server-pass'); ?>";
  131. class servers;
  132. options
  133. {
  134. zip;
  135. ssl;
  136. autoconnect;
  137. nodnscache;
  138. nohostcheck;
  139. };
  140. };
  141. <?php }
  142. }
  143. ?>
  144. ulines {
  145. <?php
  146. $ulines = get_ulines();
  147. foreach($ulines as $k => $uline){
  148. echo $uline.";\n";
  149. if($k < count($ulines)-1){
  150. echo "\t";
  151. }
  152. }
  153. ?>
  154. };
  155. #################################################
  156. ## Log ##
  157. #################################################
  158. log "ircd.log" {
  159. flags {
  160. oper;
  161. kline;
  162. connects;
  163. server-connects;
  164. kills;
  165. errors;
  166. sadmin-commands;
  167. chg-commands;
  168. oper-override;
  169. spamfilter;
  170. };
  171. };
  172. #################################################
  173. ## Alias ##
  174. #################################################
  175. alias "glinebot" {
  176. format ".+" {
  177. command "gline";
  178. type real;
  179. parameters "%1 2d Bots are not allowed on this server, please read the faq at http://www.example.com/faq/123";
  180. };
  181. type command;
  182. };
  183. alias statserv { type stats; };
  184. alias ss { target statserv; type stats; };
  185. #################################################
  186. ## DRPass ##
  187. #################################################
  188. drpass {
  189. restart "<?php echo $pass ?>" { sha1; };
  190. die "<?php echo $pass ?>" { sha1; };
  191. };
  192. #################################################
  193. ## Network Settings ##
  194. #################################################
  195. set {
  196. network-name "omnimaga.org";
  197. default-server "irc.omnimaga.org";
  198. services-server "<?php echo get_conf('services-server','string'); ?>";
  199. stats-server "<?php echo get_conf('stats-server','string'); ?>";
  200. help-channel "#omnimaga";
  201. hiddenhost-prefix "omni";
  202. cloak-keys {
  203. "XFGasdgREWhgreTG43FDSfweqfew";
  204. "FDSAyh5ghREFadhrGHrewGQEg324";
  205. "ASGfdah4431fgdsagdsagASgrw32";
  206. };
  207. hosts {
  208. local "local.users.irc.omnimaga.org";
  209. global "global.users.irc.omnimaga.org";
  210. coadmin "coadmin.users.irc.omnimaga.org";
  211. admin "admin.users.irc.omnimaga.org";
  212. servicesadmin "servicesadmin.users.irc.omnimaga.org";
  213. netadmin "netadmin.users.irc.omnimaga.org";
  214. host-on-oper-up "yes";
  215. };
  216. modes-on-join "+nt";
  217. kline-address "[email protected]";
  218. modes-on-connect "+G";
  219. modes-on-oper "+wgs";
  220. oper-auto-join "<?php echo get_conf('ops-channel','string'); ?>";
  221. options {
  222. hide-ulines;
  223. show-connect-info;
  224. };
  225. maxchannelsperuser 50;
  226. anti-spam-quit-message-time 10s;
  227. oper-only-stats "okfGsMRUEelLCXzdD";
  228. throttle {
  229. connections 3;
  230. period 60s;
  231. };
  232. anti-flood {
  233. nick-flood 3:60;
  234. };
  235. spamfilter {
  236. ban-time 1d;
  237. ban-reason "Spam/Advertising";
  238. virus-help-channel "#help";
  239. };
  240. };
  241. #################################################
  242. ## Enable Mibbit ##
  243. #################################################
  244. // Datacenter one:
  245. cgiirc {
  246. type webirc;
  247. hostname 64.62.228.82;
  248. password <?php echo get_conf('mibbit-password','string'); ?>;
  249. };
  250. // Datacenter two:
  251. cgiirc {
  252. type webirc;
  253. hostname 207.192.75.252;
  254. password <?php echo get_conf('mibbit-password','string'); ?>;
  255. };
  256. // Datacenter three:
  257. cgiirc {
  258. type webirc;
  259. hostname 78.129.202.38;
  260. password <?php echo get_conf('mibbit-password','string'); ?>;
  261. };
  262. // Datacenter four:
  263. cgiirc {
  264. type webirc;
  265. hostname 109.169.29.95;
  266. password <?php echo get_conf('mibbit-password','string'); ?>;
  267. };
  268. #################################################
  269. ## Allow ##
  270. #################################################
  271. allow {
  272. ip *@*;
  273. hostname *@*;
  274. class clients;
  275. maxperip 10;
  276. };
  277. #################################################
  278. ## Deny ##
  279. #################################################
  280. deny dcc {
  281. filename "*sub7*";
  282. reason "Possible Sub7 Virus";
  283. };
  284. #################################################
  285. ## Bans ##
  286. #################################################
  287. ban nick {
  288. mask "*C*h*a*n*S*e*r*v*";
  289. reason "Reserved for Services";
  290. };
  291. #################################################
  292. ## Localization ##
  293. #################################################
  294. files {
  295. motd "motd/en.txt";
  296. rules "rules/en.txt";
  297. };
  298. tld {
  299. mask *@*.ca;
  300. motd "motd/en_CA.txt";
  301. rules "rules/en_CA.txt";
  302. };
  303. tld {
  304. mask *@*.com;
  305. motd "motd/en_US.txt";
  306. rules "rules/en_US.txt";
  307. };
  308. tld {
  309. mask *@*.fr;
  310. motd "motd/fr.txt";
  311. rules "rules/fr.txt";
  312. };
  313. #################################################
  314. ## Opers ##
  315. #################################################
  316. oper RehashServ {
  317. class clients;
  318. from {
  319. userhost RehashServ@localhost;
  320. userhost <?php echo get_conf('services-server'); ?>;
  321. userhost <?php echo get_conf('stats-server'); ?>;
  322. userhost <?php echo get_conf('irc-server'); ?>;
  323. userhost <?php echo get_conf('rehash-host'); ?>;
  324. };
  325. password "<?php echo mkpasswd(get_conf('rehash-pass')); ?>" { sha1; };
  326. flags {
  327. can_rehash;
  328. netadmin;
  329. };
  330. };
  331. <?php foreach($opers as $k => $oper){?>
  332. oper <?php echo $oper['nick'];?> {
  333. class clients;
  334. from {
  335. <?php foreach($oper['hosts'] as $k => $host){?>
  336. userhost <?php echo $host;?>;
  337. <?php } ?>
  338. };
  339. password "<?php echo $oper['password'];?>" { <?php echo $oper['password_type'];?>; };
  340. flags {
  341. <?php echo $oper['flags'];?>
  342. };
  343. swhois "<?php echo $oper['swhois'];?>";
  344. };
  345. <?php }?>