From 359697a716a42e9ba82b601ec6ae5f5db9dd0a14 Mon Sep 17 00:00:00 2001 From: Dimitry Bradt Date: Wed, 21 Feb 2007 01:26:11 +0000 Subject: adding site-source svn path=/; revision=1 --- site/archive/adopt-a-dev.tar.bz2 | Bin 0 -> 33039 bytes site/data/aad-210207.sql | 281 ++++++++++ site/source/classes/actor.class.php | 49 ++ site/source/classes/cats_smtp.class.php | 183 ++++++ site/source/classes/collection.class.php | 83 +++ site/source/classes/dbresult.class.php | 97 ++++ site/source/classes/return_result.class.php | 51 ++ site/source/functions/bbcode.guidexml.tpl | 50 ++ site/source/functions/bbcode.html.tpl | 50 ++ site/source/functions/bbcode.php | 799 +++++++++++++++++++++++++++ site/source/functions/bbcode.txt.tpl | 50 ++ site/source/functions/cats_mail.php | 82 +++ site/source/functions/databases/mysql.inc | 75 +++ site/source/functions/databases/postgres.inc | 85 +++ site/source/functions/db_access.php | 22 + site/source/globals.php | 51 ++ site/source/htdocs/.htaccess | 3 + site/source/htdocs/index.php | 99 ++++ site/source/htdocs/style.css | 118 ++++ site/source/html/index.html | 8 + site/source/main.php | 90 +++ site/source/modules/auth.php | 238 ++++++++ site/source/modules/default.php | 70 +++ site/source/modules/edit.php | 284 ++++++++++ site/source/modules/email_report.php | 87 +++ site/source/modules/layout.php | 293 ++++++++++ site/source/modules/menu.php | 49 ++ site/source/modules/people.php | 173 ++++++ site/source/modules/project.php | 162 ++++++ site/source/modules/resource.php | 412 ++++++++++++++ site/source/modules/xml.php | 435 +++++++++++++++ 31 files changed, 4529 insertions(+) create mode 100644 site/archive/adopt-a-dev.tar.bz2 create mode 100644 site/data/aad-210207.sql create mode 100644 site/source/classes/actor.class.php create mode 100644 site/source/classes/cats_smtp.class.php create mode 100644 site/source/classes/collection.class.php create mode 100644 site/source/classes/dbresult.class.php create mode 100644 site/source/classes/return_result.class.php create mode 100644 site/source/functions/bbcode.guidexml.tpl create mode 100644 site/source/functions/bbcode.html.tpl create mode 100644 site/source/functions/bbcode.php create mode 100644 site/source/functions/bbcode.txt.tpl create mode 100644 site/source/functions/cats_mail.php create mode 100644 site/source/functions/databases/mysql.inc create mode 100644 site/source/functions/databases/postgres.inc create mode 100644 site/source/functions/db_access.php create mode 100644 site/source/globals.php create mode 100644 site/source/htdocs/.htaccess create mode 100644 site/source/htdocs/index.php create mode 100644 site/source/htdocs/style.css create mode 100644 site/source/html/index.html create mode 100644 site/source/main.php create mode 100644 site/source/modules/auth.php create mode 100644 site/source/modules/default.php create mode 100644 site/source/modules/edit.php create mode 100644 site/source/modules/email_report.php create mode 100644 site/source/modules/layout.php create mode 100644 site/source/modules/menu.php create mode 100644 site/source/modules/people.php create mode 100644 site/source/modules/project.php create mode 100644 site/source/modules/resource.php create mode 100644 site/source/modules/xml.php (limited to 'site') diff --git a/site/archive/adopt-a-dev.tar.bz2 b/site/archive/adopt-a-dev.tar.bz2 new file mode 100644 index 0000000..8528c66 Binary files /dev/null and b/site/archive/adopt-a-dev.tar.bz2 differ diff --git a/site/data/aad-210207.sql b/site/data/aad-210207.sql new file mode 100644 index 0000000..7d4ac21 --- /dev/null +++ b/site/data/aad-210207.sql @@ -0,0 +1,281 @@ +-- MySQL dump 10.9 +-- +-- Host: localhost Database: bagel +-- ------------------------------------------------------ +-- Server version 4.1.20 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `accesslevels` +-- + +DROP TABLE IF EXISTS `accesslevels`; +CREATE TABLE `accesslevels` ( + `levelid` int(10) unsigned NOT NULL auto_increment, + `name` varchar(32) default NULL, + PRIMARY KEY (`levelid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `accesslevels` +-- + + +/*!40000 ALTER TABLE `accesslevels` DISABLE KEYS */; +LOCK TABLES `accesslevels` WRITE; +INSERT INTO `accesslevels` VALUES (2,'admin'),(1,'guest'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `accesslevels` ENABLE KEYS */; + +-- +-- Table structure for table `menu` +-- + +DROP TABLE IF EXISTS `menu`; +CREATE TABLE `menu` ( + `menuid` int(10) unsigned NOT NULL auto_increment, + `action` varchar(64) default NULL, + `text` varchar(255) default NULL, + `priority` int(10) unsigned default NULL, + `accesslevel` int(10) unsigned default NULL, + PRIMARY KEY (`menuid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `menu` +-- + + +/*!40000 ALTER TABLE `menu` DISABLE KEYS */; +LOCK TABLES `menu` WRITE; +INSERT INTO `menu` VALUES (1,'logout','Logout',99,2),(2,'default','Home',1,2),(3,'resource','Resources',25,2),(4,'passwd','Change Password',80,2),(5,'xml','Generate Project Page',65,2),(6,'project','Projects',22,2),(7,'people','People',24,2); +UNLOCK TABLES; +/*!40000 ALTER TABLE `menu` ENABLE KEYS */; + +-- +-- Table structure for table `people` +-- + +DROP TABLE IF EXISTS `people`; +CREATE TABLE `people` ( + `peopleid` int(10) unsigned NOT NULL auto_increment, + `first` varchar(64) default NULL, + `last` varchar(64) default NULL, + `email` varchar(255) default NULL, + `location` varchar(255) default NULL, + PRIMARY KEY (`peopleid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `people` +-- + + +/*!40000 ALTER TABLE `people` DISABLE KEYS */; +LOCK TABLES `people` WRITE; +INSERT INTO `people` VALUES (1,'Thomas','Cort','tcort@gentoo.org','Williamstown, VT, USA'),(5,'Ryan','Gibbons','gibbonsr@routedtechnologies.com','Fort Worth, Texas, USA'),(6,'Gregory','Shikhman','cornmander@cornmander.com','Detroit, MI, USA'),(7,'Christian','Heim','phreak@gentoo.org','Germany'),(8,'Marius','Mauch','genone@gentoo.org','Northern Germany'),(9,'Alexandre','Buisse','nattfodd@gentoo.org','France'),(10,'Stefan','Schweizer','genstef@gentoo.org','Germany'),(11,'Simon','Stelling','blubb@gentoo.org','Switzerland'),(12,'Andrey','Falko','ma3oxuct@gmail.com','New York, NY, USA'),(13,'Thomas','Kear','thomas.kear@gmail.com','New Zealand'),(14,'Chris','White','ChrisWhite@gentoo.org','CA, USA'),(15,'Stephen','Becker','geoman@gentoo.org','Blacksburg, VA, USA'),(16,'Steve','Dibb','beandog@gentoo.org','West Jordan, UT, USA'),(17,'Steven','Oliver','oliver.steven@gmail.com','Bluefield, WV, USA'),(18,'Jann - Ove','Risvik','jann.ove@risvik.ath.cx','Norway'),(19,'Scott','Jubenville','linux.scott@gmail.com','ON, Canada'),(20,'Caleb','Tennis','caleb@gentoo.org','Columbus, IN, USA'),(21,'Steev','Klimaszewski','steev@gentoo.org','Tulsa, OK, USA'),(22,'Richard','Fish','bigfish@asmallpond.org','Phoenix, AZ, USA'),(23,'Tom','Wesley','tom@tomaw.net','UK'),(24,'Thomas','Heinrichsdobler','dertyp@gmail.com','Germany'),(25,'Luis Francisco','Araujo','araujo@gentoo.org','Maracaibo, Zulia state, Venezuela'),(26,'Patrick','Lauer','patrick@gentoo.org','Aachen, Germany'),(27,'Joshua','Jackson','tsunam@gentoo.org','Reno, NV, USA'),(28,'Carl','Fongheiser','carlfongheiser@gmail.com','Iowa City, IA, USA'),(29,'Joshua','Nichols','nichoj@gentoo.org','Boston, MA, USA'),(30,'Ioannis','Aslanidis','deathwing00@gentoo.org','Tarragona, Spain'),(31,'Kurt','Hindenburg','kurt.hindenburg@gmail.com','Indianapolis, IN, USA'),(32,'Andrew','Gaffney','agaffney@gentoo.org','St. Louis, MO, USA'),(33,'Robin','Johnson','robbat2@gentoo.org','Burnaby, BC, Canada'),(34,'Ildar','Sagdejev','specious@gmail.com','Durham, NC, USA'),(35,'Mr.','Anonymous','Anonymous','Paris, France'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `people` ENABLE KEYS */; + +-- +-- Table structure for table `project_members` +-- + +DROP TABLE IF EXISTS `project_members`; +CREATE TABLE `project_members` ( + `userid` int(10) unsigned default NULL, + `roleid` int(10) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `project_members` +-- + + +/*!40000 ALTER TABLE `project_members` DISABLE KEYS */; +LOCK TABLES `project_members` WRITE; +INSERT INTO `project_members` VALUES (1,1),(2,2),(3,2),(4,2); +UNLOCK TABLES; +/*!40000 ALTER TABLE `project_members` ENABLE KEYS */; + +-- +-- Table structure for table `project_specific_resources` +-- + +DROP TABLE IF EXISTS `project_specific_resources`; +CREATE TABLE `project_specific_resources` ( + `resourceid` int(10) unsigned default NULL, + `projectid` int(10) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `project_specific_resources` +-- + + +/*!40000 ALTER TABLE `project_specific_resources` DISABLE KEYS */; +LOCK TABLES `project_specific_resources` WRITE; +INSERT INTO `project_specific_resources` VALUES (15,NULL),(16,NULL),(17,4),(18,4),(17,5),(18,5),(17,6),(18,6),(19,NULL),(20,7),(19,7),(21,NULL),(22,8),(23,9),(24,10),(25,11),(26,12),(27,4),(28,12),(29,12),(15,13),(30,NULL),(31,NULL),(32,NULL),(33,NULL),(34,NULL),(35,NULL),(36,NULL),(37,NULL),(38,NULL),(39,NULL),(40,NULL),(41,NULL),(42,NULL),(43,NULL),(44,7),(44,14),(45,NULL),(46,NULL),(47,NULL),(48,NULL),(49,NULL),(50,15),(51,17),(52,11),(53,17),(54,NULL),(55,NULL),(56,18),(57,19),(57,20),(57,21),(58,7),(58,12),(59,7),(59,12),(60,22),(60,23),(61,NULL),(62,12),(63,1),(63,24),(64,25),(64,12),(65,NULL),(66,NULL),(67,NULL),(68,NULL),(69,NULL),(70,NULL),(71,NULL),(72,NULL); +UNLOCK TABLES; +/*!40000 ALTER TABLE `project_specific_resources` ENABLE KEYS */; + +-- +-- Table structure for table `projects` +-- + +DROP TABLE IF EXISTS `projects`; +CREATE TABLE `projects` ( + `projectid` int(10) unsigned NOT NULL auto_increment, + `name` varchar(255) default NULL, + `url` text, + PRIMARY KEY (`projectid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `projects` +-- + + +/*!40000 ALTER TABLE `projects` DISABLE KEYS */; +LOCK TABLES `projects` WRITE; +INSERT INTO `projects` VALUES (1,'alpha','http://alpha.gentoo.org'),(2,'amd64','http://amd64.gentoo.org'),(3,'user-relations','http://www.gentoo.org/proj/en/devrel/user-relations/'),(4,'portage','http://gentoo.org/proj/en/portage'),(5,'gentoolkit','http://www.gentoo.org/doc/en/gentoolkit.xml'),(6,'gentoo-stats','http://sources.gentoo.org/viewcvs.py/portage/gentoo-stats/'),(7,'mobile','http://www.gentoo.org/proj/en/metastructure/herds/herds.xml#doc_chap68'),(8,'kernel','http://www.gentoo.org/proj/en/kernel/index.xml'),(9,'mips','http://www.gentoo.org/proj/en/base/mips/'),(10,'perl','http://www.gentoo.org/proj/en/perl/'),(11,'common-lisp','http://www.gentoo.org/proj/en/metastructure/herds/herds.xml#doc_chap20'),(12,'misc','http://gentoo.org'),(13,'java','http://www.gentoo.org/proj/en/java/'),(14,'gentopia','https://gentopia.gentooexperimental.org/'),(15,'haskell','http://www.gentoo.org/proj/en/metastructure/herds/herds.xml#doc_chap49'),(16,'scheme','http://www.gentoo.org/proj/en/metastructure/herds/herds.xml#doc_chap100'),(17,'lang-misc','http://www.gentoo.org/proj/en/metastructure/herds/herds.xml#doc_chap58'),(18,'x86','http://www.gentoo.org/proj/en/base/x86/'),(19,'ppc','http://ppc.gentoo.org'),(20,'macos','http://www.gentoo.org/proj/en/gentoo-alt/macos/'),(21,'ppc64','http://ppc64.gentoo.org'),(22,'kde','http://www.gentoo.org/proj/en/desktop/kde/index.xml'),(23,'gdp','http://www.gentoo.org/proj/en/gdp/'),(24,'installer','http://www.gentoo.org/proj/en/releng/installer/'),(25,'app-backup','http://www.gentoo.org/proj/en/metastructure/herds/herds.xml#doc_chap10'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `projects` ENABLE KEYS */; + +-- +-- Table structure for table `resources` +-- + +DROP TABLE IF EXISTS `resources`; +CREATE TABLE `resources` ( + `resourceid` int(10) unsigned NOT NULL auto_increment, + `donorid` int(10) unsigned default NULL, + `devid` int(10) unsigned default NULL, + `quantity` int(10) unsigned default NULL, + `resource` text, + `purpose` text, + `status` int(10) unsigned default NULL, + `date_created` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `date_modified` timestamp NOT NULL default '0000-00-00 00:00:00', + `comment` text, + PRIMARY KEY (`resourceid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `resources` +-- + + +/*!40000 ALTER TABLE `resources` DISABLE KEYS */; +LOCK TABLES `resources` WRITE; +INSERT INTO `resources` VALUES (2,1,NULL,1,'D-Link DFE-670TXD 10/100Mbps PCMCIA Fast Ethernet Adapter','null',2,'2006-07-03 14:49:14','2006-07-03 14:49:14',NULL),(3,1,NULL,1,'CentreCOM 210TS AUI to 10baseT Transceiver',NULL,2,'2006-07-03 14:46:48','2006-07-03 14:46:48',NULL),(17,13,8,1,'PCI parallel-ATA controller card with 2+ channels (no RAID\r\nfunctionality needed)','Replacing existing components that are suspected to overheat/fail from time to time causing my home server to go offline for hours or days, resulting in disrupted workflows and corrupted data == lost time.',4,'2006-08-08 10:39:51','2006-08-09 20:12:31',NULL),(15,5,14,1,'Hosting / Shell Accounts (6mbit, unlimited throughput)','apache tomcat work',3,'2006-08-04 10:58:15','2006-08-11 10:02:48',NULL),(16,6,NULL,1,'Hosting / Shell Accounts on Gentoo/x86 (100mbit, 1000GB/mo transfer)','null',2,'2006-08-05 05:15:03','2006-08-05 05:15:03',NULL),(18,NULL,8,1,'AGP (or PCI) low-end, passively cooled graphics card (must work in a\r\nsocket-A mainboard)','Replacing existing components that are suspected to overheat/fail from time to time causing my home server to go offline for hours or days, resulting in disrupted workflows and corrupted data == lost time.',4,'2006-08-08 10:40:28','2006-08-16 07:13:41',NULL),(19,NULL,9,1,'GPS receiver usable without a PDA (laptop or standalone units are fine). It must be in the list of the gpsd supported devices.','The purpose is to join the mobile herd and help with testing/maintenance of GPS related software. According to steev, nobody in this herd is currently owning a GPS device, which makes it pretty much impossible to maintain those applications.',1,'2006-08-08 10:59:30','2006-08-08 11:32:38',NULL),(20,NULL,10,1,'GPS receiver usable without a PDA (laptop or standalone units are fine). It must be in the list of the gpsd supported devices.','The purpose is to join the mobile herd and help with testing/maintenance of GPS related software. According to steev, nobody in this herd is currently owning a GPS device, which makes it pretty much impossible to maintain those applications.',1,'2006-08-08 11:29:17','2006-08-08 11:32:48',NULL),(21,11,NULL,1,'1x Firewire/IEEE-1394 PCI-card with a VIA VT6306 chipset and 3 plugs','null',2,'2006-08-08 12:17:23','2006-08-08 12:17:23',NULL),(22,12,7,1,'A shell account on a single box with root access and permission to reboot when needed.','Kernel development, testing, and rollout along with other day to day remote development.',3,'2006-08-08 13:20:28','2006-08-12 06:03:15',NULL),(23,NULL,15,1,'SGI Octane system board with support for R12000 and R14000 CPU modules. SGI Part No: 030-1467-001','Keeping X-related packages up to date on Gentoo/MIPS.',1,'2006-08-09 21:18:00','2006-08-09 21:18:00',NULL),(24,19,14,1,'Book: Programming perl By Larry Wall, Tom Christiansen, Jon Orwant ISBN: 0-596-00027-8','improve perl knowledge to help with perl packages',3,'2006-08-09 21:49:09','2006-08-11 10:03:12',NULL),(25,NULL,14,1,'Book: ANSI Common LISP ; ISBN 0133708756','improve lisp knowledge to help with lisp packages',1,'2006-08-09 21:52:16','2006-08-19 08:02:15',NULL),(26,NULL,14,1,'Book: GNU Autoconf, Automake, and Libtool ; ISBN 1578701902','improve auto-tool knowledge to help with the maintenance of many packages',4,'2006-08-09 21:54:51','2006-08-31 06:27:25',NULL),(51,NULL,25,1,'Book: Smalltalk, Objects, and Design ; ISBN 1583484906','I maintain all of our existing Smalltalk implementations packages (around 5 at the moment). I would like to improve our support for them and extend it including new packages (and maybe even creating a herd if possible). This book will be ideal to help me doing this.',1,'2006-08-19 08:09:45','2006-08-19 08:18:40',NULL),(27,NULL,14,1,'Book: Dive Into Python ; ISBN 1590593561','improve python skills to help understand portage code',1,'2006-08-09 21:56:13','2006-08-19 08:02:59',NULL),(28,28,14,1,'Dell Inspiron 4000 256MB memory stick','general development work, improve productivity',4,'2006-08-09 21:57:56','2006-08-23 14:35:01',NULL),(29,22,14,2,'PC2700 333mhz 512MB RAM','general development work, improve productivity',3,'2006-08-09 21:58:30','2006-08-23 16:16:11',NULL),(30,16,NULL,1,'SIIG USB 2.0 Dual-Port PCI Host Adapter','null',2,'2006-08-10 05:33:19','2006-08-10 05:33:19',NULL),(31,16,NULL,1,'ATI USB RF Remote','null',2,'2006-08-10 05:33:37','2006-08-10 05:33:37',NULL),(32,17,NULL,1,'Conexant F1156I/R2F PCI Modem (RS56-PCI Chipset)','null',2,'2006-08-10 09:59:26','2006-08-10 09:59:26',NULL),(33,17,NULL,1,'Linksys LNE100TX ver. 5.1 PCI EtherFast 10/100 LAN Card','null',2,'2006-08-10 09:59:54','2006-08-10 09:59:54',NULL),(34,17,NULL,1,'Single stick of 512M 133Mhz RAM (possibly made by Memorex)','null',2,'2006-08-10 10:00:49','2006-08-10 10:00:49',NULL),(35,17,NULL,1,'Black 3 1/2 inch floppy drive from a Dell. No faceplate.','null',2,'2006-08-10 10:01:59','2006-08-10 10:02:53',NULL),(36,17,NULL,1,'White 3 1/2 inch floppy drive.','null',2,'2006-08-10 10:03:29','2006-08-10 10:03:29',NULL),(37,5,NULL,1,'Xen Virtual Server, Unlimited storage within reason, 100MB+ Ram, 100Mbit Burstable, 5Mbit dedicated, unlimited throughput. Backup and Restore points can be created by request.','null',2,'2006-08-10 10:13:03','2006-08-16 13:15:05',NULL),(38,18,NULL,1,'Shell accounts on a 6/6mbit line with unlimited transfer.','null',2,'2006-08-10 14:12:26','2006-08-10 14:12:26',NULL),(39,20,NULL,1,'Book: OReilly MySQL reference manual ; ISBN 636920002659','null',4,'2006-08-11 10:04:42','2006-10-23 20:05:24',NULL),(40,20,NULL,1,'Book: Serial Communications in C++ ; ISBN 1558281983','null',2,'2006-08-11 10:05:04','2006-08-19 08:04:10',NULL),(41,20,NULL,1,'Book: Effective C++, 2nd Ed ; ISBN 0201924889','null',4,'2006-08-11 10:05:38','2006-10-23 20:05:27',NULL),(42,20,NULL,1,'Book: Programming Embedded Systems in C/C++ ; ISBN 1565923545','null',4,'2006-08-11 10:05:56','2006-09-06 06:21:35',NULL),(43,20,NULL,1,'Book: Programming Perl ; ISBN 0596000278','null',2,'2006-08-11 10:06:32','2006-08-19 08:04:31',NULL),(44,22,21,1,'Seagate 5400 100GB 2.5\" PATA HD','Upgrade a desktop machine which currently has a 20GB HD or a laptop which currently has a 10GB HD.',3,'2006-08-13 18:22:51','2006-08-19 13:41:27',NULL),(45,22,NULL,1,'Hitachi HTS721010G9SA00 100GB, 7200rpm, 2.5\" SATA HD.','null',2,'2006-08-13 18:25:04','2006-08-13 18:25:04',NULL),(46,22,NULL,1,'Hitachi HTS541080G9SA00, 80GB, 5400rpm, 2.5\" SATA HD.','null',2,'2006-08-13 18:25:15','2006-08-13 18:25:15',NULL),(47,16,NULL,1,'TDK 4800B IDE 52x CD-RW internal drive (beige)','null',2,'2006-08-14 05:35:12','2006-08-14 05:35:12',NULL),(48,23,NULL,1,'Sharp Zaurus SL-5500, dock and charger.','null',2,'2006-08-15 11:11:20','2006-08-15 11:11:20',NULL),(49,24,NULL,1,'Belkin Nostromo n50 Speedpad. For supporting [url=http://sf.net/projects/nostromodriver]nostromo driver[/url] ([url=http://bugs.gentoo.org/show_bug.cgi?id=80623]Bug #80623[/url]).','null',2,'2006-08-18 19:56:32','2006-08-19 10:57:10',NULL),(50,NULL,25,1,'Book: Types and Programming Languages ; ISBN 0262162091','This book will help me understand better the design of type systems in different programming languages. I am mainly requesting this book because i maintain Haskell (and belong to that herd too) packages which highly would benefit from the knowledge i can gain from it.',1,'2006-08-19 07:59:29','2006-08-19 08:03:28',NULL),(52,NULL,25,1,'Book: ANSI Common Lisp ; ISBN 0133708756','We got a bunch of Common Lisp packages in our tree. Nevertheless, the Lisp herd is very understaffed. I would like to give some help with them. This book will give me the necessary background to improve my Lisp knowledge so i can cooperate in a more accurate manner.',1,'2006-08-19 08:11:39','2006-08-19 08:11:39',NULL),(53,NULL,25,1,'Book: Dylan Programming: An Object Oriented and Dynamic Language ; ISBN 0201479761','Dylan is a very powerful object oriented language. I included support for this language inside Gentoo, adding one of its most famous compilers available inside the tree. This book would give me the necessary knowledge to continue enhancing and extending such a support.',1,'2006-08-19 08:13:50','2006-08-19 08:13:50',NULL),(54,26,NULL,1,'Access to gentooexperimental.org AMD64 server, useable for webhosting and other services','null',2,'2006-08-19 13:15:14','2006-08-19 13:16:22',NULL),(55,26,NULL,1,'Access to dev.gentooexperimental.org AMD64 server, uncapped 100Mbit connection, 250G diskspace, compile machine','null',2,'2006-08-19 13:15:51','2006-08-19 13:15:51',NULL),(56,NULL,27,1,'A scanner that is supported by the sane backend. [url=http://www.sane-project.org/sane-supported-devices.html]SANE - Supported Devices List[/url].','As no member of the x86 team has a scanner, it makes it hard to test the packages for stabilization. The maintainer of packages that require a scanner might not have a x86 box that is stable.',1,'2006-08-20 05:57:04','2006-08-20 05:59:04',NULL),(57,NULL,29,1,'Any ethernet card that is known to work in Linux and Mac OS X on a PowerMac G5.','To do testing of Java and other packages on ppc, ppc64, and maybe even ppc-macos.',4,'2006-08-31 14:46:51','2006-09-04 20:19:10',NULL),(58,NULL,21,1,'orinoco gold usb wireless device','To help with the drivers.',1,'2006-08-31 16:05:21','2006-08-31 16:05:37',NULL),(59,NULL,21,1,'Battery for a Japanese Sharp Mebius PC-CB1-CD to replace a dead battery (model number CE-BN12).','So that Steev isn\'t stuck to a power outlet.',1,'2006-08-31 16:07:56','2006-08-31 16:08:12',NULL),(60,NULL,30,1,'A bluetooth USB dongle from this [url=http://www.holtmann.org/linux/bluetooth/features.html]list[/url]','Replacement of a usb dongle, required to perform development and tests on kdebluetooth and other bluetooth-related applications running on Gentoo. Also required to keep an up-to-date bluetooth guide.',4,'2006-09-02 14:41:14','2006-09-08 07:46:03',NULL),(61,31,NULL,1,'Book: GNU Autoconf, Automake, and Libtool ; ISBN 1578701902','null',4,'2006-09-02 14:46:44','2006-10-23 20:05:21',NULL),(62,NULL,14,1,'[url=http://www.pricegrabber.com/search_getprod.php/masterid=535580/search=intel+pentium+4+2.0+ghz/]Intel Pentium 4 Northwood - 2.0A GHz Processor[/url] (2.0GHz, 512KB, 400 MHz, Socket 478 - MPN: BX80532PC2000D)','general development work, improve productivity',1,'2006-09-02 17:33:26','2006-09-02 17:33:26',NULL),(63,NULL,32,1,'Any linux-supported DEC Alpha workstation with at least a 400MHz processor, >=128MB of memory, a supported PCI video card, and a CD-ROM (bonus if it can read CD-RW without a problem).','Support for the alpha architecture in the Gentoo Installer.',1,'2006-09-04 15:28:45','2006-09-04 15:29:05',NULL),(64,NULL,33,1,'A PCI-E SCSI controller (needs to be U160 or better and and not wider than PCI-E x4; must have an external connector to use with tape drives) or a SCSI->iSCSI converter','To maintain iSCSI packages and to maintain a lot of the backup packages dealing with tape drives.',1,'2006-09-08 08:06:11','2006-09-08 08:06:50',NULL),(65,34,NULL,1,'External 8X DVD-ROM / 32X CD-ROM drive, connects via PCMCIA card (included)','null',2,'2006-09-19 16:43:51','2006-09-19 16:43:51',NULL),(66,34,NULL,1,'SpeedStream DSL/Cable router (one LAN port only)','null',2,'2006-09-19 16:44:16','2006-09-19 16:44:16',NULL),(67,35,NULL,3,'Pentium III 800/256/133/1.7V - Slot 1 CPU','null',2,'2006-10-17 03:48:33','2006-10-17 03:52:51',NULL),(68,35,NULL,1,'Pentium III 866/256/133/1.7V - Slot 1 CPU','null',2,'2006-10-17 03:49:04','2006-10-17 03:53:12',NULL),(69,35,NULL,1,'Pentium III 800/256/133/1.7V - Socket 370 CPU','null',2,'2006-10-17 03:49:41','2006-10-17 03:49:41',NULL),(70,35,NULL,2,'Pentium III 733/256/133/1.7V - Socket 370 CPU','null',2,'2006-10-17 03:50:18','2006-10-17 03:50:18',NULL),(71,35,NULL,10,'128MB Memory DIMM SDRAM *ECC* (Various brands)','null',2,'2006-10-17 03:50:34','2006-10-17 03:50:34',NULL),(72,NULL,14,1,'10GB+ SCSI Disk','I\'d currently like to use the alpha workstation I have for desktop related testing for the alpha herd, however I have a small drive (about 3 gigs) which could work for the basics, but I\'d like to do a bit more testing than that.',1,'2006-10-17 03:51:35','2006-10-17 03:51:35',NULL); +UNLOCK TABLES; +/*!40000 ALTER TABLE `resources` ENABLE KEYS */; + +-- +-- Table structure for table `roles` +-- + +DROP TABLE IF EXISTS `roles`; +CREATE TABLE `roles` ( + `roleid` int(10) unsigned NOT NULL auto_increment, + `role` varchar(64) default NULL, + PRIMARY KEY (`roleid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `roles` +-- + + +/*!40000 ALTER TABLE `roles` DISABLE KEYS */; +LOCK TABLES `roles` WRITE; +INSERT INTO `roles` VALUES (1,'Lead'),(2,'Member'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `roles` ENABLE KEYS */; + +-- +-- Table structure for table `sessions` +-- + +DROP TABLE IF EXISTS `sessions`; +CREATE TABLE `sessions` ( + `sessionid` varchar(32) default NULL, + `userid` int(10) unsigned NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `sessions` +-- + + +/*!40000 ALTER TABLE `sessions` DISABLE KEYS */; +LOCK TABLES `sessions` WRITE; +INSERT INTO `sessions` VALUES ('2792b9b2ed7f3bb339c7bfb6010bda54',5),('l3ogg0m6b3eppb8o1atv5qi740',2),('5kmueilnr17d796mdgq23vjtn0',1); +UNLOCK TABLES; +/*!40000 ALTER TABLE `sessions` ENABLE KEYS */; + +-- +-- Table structure for table `status` +-- + +DROP TABLE IF EXISTS `status`; +CREATE TABLE `status` ( + `statusid` int(10) unsigned NOT NULL auto_increment, + `status` varchar(255) default NULL, + PRIMARY KEY (`statusid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `status` +-- + + +/*!40000 ALTER TABLE `status` DISABLE KEYS */; +LOCK TABLES `status` WRITE; +INSERT INTO `status` VALUES (1,'seeking'),(2,'offering'),(4,'hidden'),(3,'thanks'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `status` ENABLE KEYS */; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +CREATE TABLE `users` ( + `userid` int(10) unsigned NOT NULL auto_increment, + `first` varchar(64) default NULL, + `last` varchar(64) default NULL, + `username` varchar(64) default NULL, + `passwd` varchar(32) default NULL, + `accesslevel` int(10) unsigned default NULL, + PRIMARY KEY (`userid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `users` +-- + + +/*!40000 ALTER TABLE `users` DISABLE KEYS */; +LOCK TABLES `users` WRITE; +INSERT INTO `users` VALUES (1,'Thomas','Cort','tcort','449884d825dc41836cbdf026892220c6',2),(2,'Christel','Dahlskjær','christel','d6d38c300f94b81760281c2f6a370ffa',2),(4,'Joshua','Jackson','tsunam','159e683b42c950c710c74844a719f474',2); +UNLOCK TABLES; +/*!40000 ALTER TABLE `users` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + diff --git a/site/source/classes/actor.class.php b/site/source/classes/actor.class.php new file mode 100644 index 0000000..8489af8 --- /dev/null +++ b/site/source/classes/actor.class.php @@ -0,0 +1,49 @@ +name = $name; + $this->priority = $priority; + } + + function set_priority($priority) { + $this->priority = $priority; + } + + function get_priority() { + return $this->priority; + } + + function execute() { + return; + } + + function set_name($name) { + $this->name = $name; + } + + function get_name() { + return $this->name; + } +} + +?> diff --git a/site/source/classes/cats_smtp.class.php b/site/source/classes/cats_smtp.class.php new file mode 100644 index 0000000..444bec7 --- /dev/null +++ b/site/source/classes/cats_smtp.class.php @@ -0,0 +1,183 @@ +host = "localhost"; # try the localhost + } else { + $this->host = $smtp_host; + } + + if (!isset($smtp_port)) { + $this->port = 25; # use default smtp port + } else { + $this->port = $smtp_port; + } + + $this->connection = 0; + } + + function connect() { + $this->connection = fsockopen($this->host,$this->port); + + if (!$this->connection) { + $r = new return_result(false); + $r->add_message("No Connection\n"); + return $r; + } + + $result = $this->get_sock_data(); + + if (strncmp($result,"220",3) != 0) { + $r = new return_result(false); + $r->add_message("Error connecting\n$result\n"); + return $r; + } + + return new return_result(true); + } + + function disconnect() { + fclose($this->connection); + $this->connection = 0; + } + + # read as much data from the socket as possible + function get_sock_data() { + $data = ""; + + while($str = fgets($this->connection,515)) { + $data .= $str; + if(substr($str,3,1) == " ") { + break; + } + } + return $data; + } + + # write data to a socket and append "\r\n" + function put_sock_data($data) { + fwrite($this->connection,$data . "\r\n"); + } + + # SMTP Commands + function cmd_helo() { + $this->put_sock_data("ehlo " . $this->host); + $result = $this->get_sock_data(); + + if (strncmp($result,"250",3) != 0) { + $r = new return_result(false); + $r->add_message("Error with HELO command\n$result\n"); + return $r; + } + + return new return_result(true); + } + + function cmd_auth() { + global $smtp_user, $smtp_pass; + $coded_pass = base64_encode("$smtp_user\0$smtp_user\0$smtp_pass"); + + $this->put_sock_data("AUTH PLAIN " . $coded_pass); + $result = $this->get_sock_data(); + + if (strncmp($result,"235",3) != 0) { + $r = new return_result(false); + $r->add_message("Error with AUTH command\n$result\n"); + return $r; + } + + return new return_result(true); + } + + function cmd_quit() { + $this->put_sock_data("quit"); + $result = $this->get_sock_data(); + + if (strncmp($result,"221",3) != 0) { + $r = new return_result(false); + $r->add_message("Error with QUIT command\n$result\n"); + return $r; + } + + return new return_result(true); + } + + function cmd_mail_from($addr) { + $this->put_sock_data("mail from: $addr"); + $result = $this->get_sock_data(); + + if (strncmp($result,"250",3) != 0) { + $r = new return_result(false); + $r->add_message("Error with MAIL FROM: $addr command\n$result\n"); + return $r; + } + + return new return_result(true); + } + + function cmd_rcpt_to($addr) { + $this->put_sock_data("rcpt to: $addr"); + $result = $this->get_sock_data(); + + if (strncmp($result,"250",3) != 0) { + $r = new return_result(false); + $r->add_message("Error with RCPT TO: $addr command\n$result\n"); + return $r; + } + + return new return_result(true); + } + + function cmd_data($from,$to,$subject,$data) { + $this->put_sock_data("DATA"); + $result = $this->get_sock_data(); + + if (strncmp($result,"354",3) != 0) { + $r = new return_result(false); + $r->add_message("Error with DATA command\n$result\n"); + return $r; + } + + $this->put_sock_data("From: $from"); + $this->put_sock_data("To: $to"); + $this->put_sock_data("Subject: $subject"); + $this->put_sock_data($data); + $this->put_sock_data("."); + $result = $this->get_sock_data(); + + if (strncmp($result,"250",3) != 0) { + $r = new return_result(false); + $r->add_message("Error with DATA command\n$result\n"); + return $r; + } + + return new return_result(true); + } +} +?> diff --git a/site/source/classes/collection.class.php b/site/source/classes/collection.class.php new file mode 100644 index 0000000..9b406cb --- /dev/null +++ b/site/source/classes/collection.class.php @@ -0,0 +1,83 @@ +get_priority() == $b->get_priority()) { + return 0; + } + return ($a->get_priority() < $b->get_priority()) ? -1 : 1; +} + +# General Collection Class +class collection { + var $items; + + # $key should be a string + # $value should be an actor + function put($key,$value) { + if (isset($this->items[$key])) { + $this->items[$key][count($this->items[$key])] = $value; + uasort($this->items[$key],"priority_sort"); + } else { + $this->items[$key] = array($value); + } + } + + # get will return an array of actors or false + # You _MUST_ use php's iterator each() to access to elements in order + # indexing them 0,1,...,n-1 will not work because sorting != re-indexing + # There is a working example of this class at the bottom of this file... + function get($key) { + if (isset($this->items[$key])) { + return $this->items[$key]; + } else { + return false; + } + } +} + +# Example Code using class collection. +# +# $col = new collection(); +# include("event_handler.class.php"); +# +# $one = new event_handler(); +# $two = new event_handler(); +# $thr = new event_handler(); +# +# $one->set_priority(1); +# $two->set_priority(2); +# $thr->set_priority(3); +# +# $one->set_name("one"); +# $two->set_name("two"); +# $thr->set_name("thr"); +# +# $col->put("event_name",$thr); # 3 +# $col->put("event_name",$one); # 1 +# $col->put("event_name",$two); # 2 +# +# $x = $col->get("event_name"); +# while (list($key, $value) = each($x)) { +# echo $x[$key]->get_priority(); +# echo " "; +# } +# echo "\n"; +?> diff --git a/site/source/classes/dbresult.class.php b/site/source/classes/dbresult.class.php new file mode 100644 index 0000000..7952bd7 --- /dev/null +++ b/site/source/classes/dbresult.class.php @@ -0,0 +1,97 @@ +query = $q; + if ($rs == FALSE) + { + $this->maxrows = 0; + print "

SQL FAILURE (Query follows...)

".$this->query."

"; + } + else + { + $this->maxrows = db_get_max_rows($rs); + } + $this->resultset = $rs; + $this->arr = NULL; + $this->rownum = 0; + } + + function set_index($pos) + { + db_data_seek($this->resultset,$pos); + } + + function get_maxrows() + { + return $this->maxrows; + } + + function has_next() + { + return $this->rownum < $this->maxrows; + } + + function get_row() + { + if ($this->has_next()) + { + $this->arr = db_fetch_array($this->resultset); + $this->rownum++; + } + return $this->arr; + } + + # resets the internal counters to 0 so that get_row() will return row 0 + function reset() { + db_data_seek($this->resultset,0); + $this->rownum = 0; + } + + function print_all() + { + print "

"; + while ($this->has_next()) + { + $row = $this->get_row(); + print_r($row); + print "

"; + } + print "

"; + $this->reset(); + } + + function has_more($num) + { + if ($this->maxrows > $num) + return true; + else + return false; + } +} +?> diff --git a/site/source/classes/return_result.class.php b/site/source/classes/return_result.class.php new file mode 100644 index 0000000..d237ee1 --- /dev/null +++ b/site/source/classes/return_result.class.php @@ -0,0 +1,51 @@ +success = $suc; + $this->messages = array(); + } + + # true if OK : false if failure + function success() { + return $this->success; + } + + function set_result($result) { + $this->success = $result; + } + + function add_message($mes) { + array_push($this->messages,$mes); + } + + function get_messages() { + if (count($this->messages) > 0) { + return $this->messages; + } else { + $temp = array(); + array_push($temp,""); + return $temp; + } + } +} +?> diff --git a/site/source/functions/bbcode.guidexml.tpl b/site/source/functions/bbcode.guidexml.tpl new file mode 100644 index 0000000..fbac3f3 --- /dev/null +++ b/site/source/functions/bbcode.guidexml.tpl @@ -0,0 +1,50 @@ +

+ +
    +
+ +
  • + + + +
    + + + + + + + + +
    {L_QUOTE}:
    +
    + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + +{DESCRIPTION} + +{EMAIL} diff --git a/site/source/functions/bbcode.html.tpl b/site/source/functions/bbcode.html.tpl new file mode 100644 index 0000000..f9a6962 --- /dev/null +++ b/site/source/functions/bbcode.html.tpl @@ -0,0 +1,50 @@ +
      +
    + +
      +
    + +
  • + + + +
    + + + + + + + + +
    {L_QUOTE}:
    +
    + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + +{DESCRIPTION} + +{EMAIL} diff --git a/site/source/functions/bbcode.php b/site/source/functions/bbcode.php new file mode 100644 index 0000000..f9757a5 --- /dev/null +++ b/site/source/functions/bbcode.php @@ -0,0 +1,799 @@ +(.*?)#', "\n" . '$bbcode_tpls[\'\\1\'] = \'\\2\';', $tpl); + + $bbcode_tpls = array(); + + eval($tpl); + + return $bbcode_tpls; +} + + +/** + * Prepares the loaded bbcode templates for insertion into preg_replace() + * or str_replace() calls in the bbencode_second_pass functions. This + * means replacing template placeholders with the appropriate preg backrefs + * or with language vars. NOTE: If you change how the regexps work in + * bbencode_second_pass(), you MUST change this function. + * + * Nathan Codding, Sept 26 2001 + * + */ +function prepare_bbcode_template($bbcode_tpl) +{ + global $lang; + + $bbcode_tpl['olist_open'] = str_replace('{LIST_TYPE}', '\\1', $bbcode_tpl['olist_open']); + + $bbcode_tpl['color_open'] = str_replace('{COLOR}', '\\1', $bbcode_tpl['color_open']); + + $bbcode_tpl['size_open'] = str_replace('{SIZE}', '\\1', $bbcode_tpl['size_open']); + + $bbcode_tpl['quote_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_open']); + + $bbcode_tpl['quote_username_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_username_open']); + $bbcode_tpl['quote_username_open'] = str_replace('{L_WROTE}', $lang['wrote'], $bbcode_tpl['quote_username_open']); + $bbcode_tpl['quote_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['quote_username_open']); + + $bbcode_tpl['code_open'] = str_replace('{L_CODE}', $lang['Code'], $bbcode_tpl['code_open']); + + $bbcode_tpl['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']); + + // We do URLs in several different ways.. + $bbcode_tpl['url1'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']); + $bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url1']); + + $bbcode_tpl['url2'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']); + $bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']); + + $bbcode_tpl['url3'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']); + $bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url3']); + + $bbcode_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']); + $bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']); + + $bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']); + + define("BBCODE_TPL_READY", true); + + return $bbcode_tpl; +} + + +/** + * Does second-pass bbencoding. This should be used before displaying the message in + * a thread. Assumes the message is already first-pass encoded, and we are given the + * correct UID as used in first-pass encoding. + */ +function bbencode_second_pass($text, $uid) +{ + global $lang, $bbcode_tpl; + + // pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0). + // This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it. + $text = " " . $text; + + // First: If there isn't a "[" and a "]" in the message, don't bother. + if (! (strpos($text, "[") && strpos($text, "]")) ) + { + // Remove padding, return. + $text = substr($text, 1); + return $text; + } + + // Only load the templates ONCE.. + if (!defined("BBCODE_TPL_READY")) + { + // load templates from file into array. + $bbcode_tpl = load_bbcode_template(); + + // prepare array for use in regexps. + $bbcode_tpl = prepare_bbcode_template($bbcode_tpl); + } + + // [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts. + $text = bbencode_second_pass_code($text, $uid, $bbcode_tpl); + + // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. + $text = str_replace("[quote:$uid]", $bbcode_tpl['quote_open'], $text); + $text = str_replace("[/quote:$uid]", $bbcode_tpl['quote_close'], $text); + + // New one liner to deal with opening quotes with usernames... + // replaces the two line version that I had here before.. + $text = preg_replace("/\[quote:$uid=\"(.*?)\"\]/si", $bbcode_tpl['quote_username_open'], $text); + + // [list] and [list=x] for (un)ordered lists. + // unordered lists + $text = str_replace("[list:$uid]", $bbcode_tpl['ulist_open'], $text); + // li tags + $text = str_replace("[*:$uid]", $bbcode_tpl['listitem'], $text); + // ending tags + $text = str_replace("[/list:u:$uid]", $bbcode_tpl['ulist_close'], $text); + $text = str_replace("[/list:o:$uid]", $bbcode_tpl['olist_close'], $text); + // Ordered lists + $text = preg_replace("/\[list=([a1]):$uid\]/si", $bbcode_tpl['olist_open'], $text); + + // colours + $text = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+):$uid\]/si", $bbcode_tpl['color_open'], $text); + $text = str_replace("[/color:$uid]", $bbcode_tpl['color_close'], $text); + + // size + $text = preg_replace("/\[size=([1-2]?[0-9]):$uid\]/si", $bbcode_tpl['size_open'], $text); + $text = str_replace("[/size:$uid]", $bbcode_tpl['size_close'], $text); + + // [b] and [/b] for bolding text. + $text = str_replace("[b:$uid]", $bbcode_tpl['b_open'], $text); + $text = str_replace("[/b:$uid]", $bbcode_tpl['b_close'], $text); + + // [u] and [/u] for underlining text. + $text = str_replace("[u:$uid]", $bbcode_tpl['u_open'], $text); + $text = str_replace("[/u:$uid]", $bbcode_tpl['u_close'], $text); + + // [i] and [/i] for italicizing text. + $text = str_replace("[i:$uid]", $bbcode_tpl['i_open'], $text); + $text = str_replace("[/i:$uid]", $bbcode_tpl['i_close'], $text); + + // Patterns and replacements for URL and email tags.. + $patterns = array(); + $replacements = array(); + + // [img]image_url_here[/img] code.. + // This one gets first-passed.. + $patterns[] = "#\[img:$uid\](.*?)\[/img:$uid\]#si"; + $replacements[] = $bbcode_tpl['img']; + + // matches a [url]xxxx://www.phpbb.com[/url] code.. + $patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is"; + $replacements[] = $bbcode_tpl['url1']; + + // [url]www.phpbb.com[/url] code.. (no xxxx:// prefix). + $patterns[] = "#\[url\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/url\]#is"; + $replacements[] = $bbcode_tpl['url2']; + + // [url=xxxx://www.phpbb.com]phpBB[/url] code.. + $patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is"; + $replacements[] = $bbcode_tpl['url3']; + + // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix). + $patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is"; + $replacements[] = $bbcode_tpl['url4']; + + // [email]user@domain.tld[/email] code.. + $patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si"; + $replacements[] = $bbcode_tpl['email']; + + $text = preg_replace($patterns, $replacements, $text); + + // Remove our padding from the string.. + $text = substr($text, 1); + + return $text; + +} // bbencode_second_pass() + +// Need to initialize the random numbers only ONCE +mt_srand( (double) microtime() * 1000000); + +function make_bbcode_uid() +{ + // Unique ID for this message.. + + $uid = md5(mt_rand()); + $uid = substr($uid, 0, BBCODE_UID_LEN); + + return $uid; +} + +function bbencode_first_pass($text, $uid) +{ + // pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0). + // This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it. + $text = " " . $text; + + // [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts. + $text = bbencode_first_pass_pda($text, $uid, '[code]', '[/code]', '', true, ''); + + // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. + $text = bbencode_first_pass_pda($text, $uid, '[quote]', '[/quote]', '', false, ''); + $text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\".*?\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]"); + + // [list] and [list=x] for (un)ordered lists. + $open_tag = array(); + $open_tag[0] = "[list]"; + + // unordered.. + $text = bbencode_first_pass_pda($text, $uid, $open_tag, "[/list]", "[/list:u]", false, 'replace_listitems'); + + $open_tag[0] = "[list=1]"; + $open_tag[1] = "[list=a]"; + + // ordered. + $text = bbencode_first_pass_pda($text, $uid, $open_tag, "[/list]", "[/list:o]", false, 'replace_listitems'); + + // [color] and [/color] for setting text color + $text = preg_replace("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "[color=\\1:$uid]\\2[/color:$uid]", $text); + + // [size] and [/size] for setting text size + $text = preg_replace("#\[size=([1-2]?[0-9])\](.*?)\[/size\]#si", "[size=\\1:$uid]\\2[/size:$uid]", $text); + + // [b] and [/b] for bolding text. + $text = preg_replace("#\[b\](.*?)\[/b\]#si", "[b:$uid]\\1[/b:$uid]", $text); + + // [u] and [/u] for underlining text. + $text = preg_replace("#\[u\](.*?)\[/u\]#si", "[u:$uid]\\1[/u:$uid]", $text); + + // [i] and [/i] for italicizing text. + $text = preg_replace("#\[i\](.*?)\[/i\]#si", "[i:$uid]\\1[/i:$uid]", $text); + + // [img]image_url_here[/img] code.. + $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); + + // Remove our padding from the string.. + return substr($text, 1);; + +} // bbencode_first_pass() + +/** + * $text - The text to operate on. + * $uid - The UID to add to matching tags. + * $open_tag - The opening tag to match. Can be an array of opening tags. + * $close_tag - The closing tag to match. + * $close_tag_new - The closing tag to replace with. + * $mark_lowest_level - boolean - should we specially mark the tags that occur + * at the lowest level of nesting? (useful for [code], because + * we need to match these tags first and transform HTML tags + * in their contents.. + * $func - This variable should contain a string that is the name of a function. + * That function will be called when a match is found, and passed 2 + * parameters: ($text, $uid). The function should return a string. + * This is used when some transformation needs to be applied to the + * text INSIDE a pair of matching tags. If this variable is FALSE or the + * empty string, it will not be executed. + * If open_tag is an array, then the pda will try to match pairs consisting of + * any element of open_tag followed by close_tag. This allows us to match things + * like [list=A]...[/list] and [list=1]...[/list] in one pass of the PDA. + * + * NOTES: - this function assumes the first character of $text is a space. + * - every opening tag and closing tag must be of the [...] format. + */ +function bbencode_first_pass_pda($text, $uid, $open_tag, $close_tag, $close_tag_new, $mark_lowest_level, $func, $open_regexp_replace = false) +{ + $open_tag_count = 0; + + if (!$close_tag_new || ($close_tag_new == '')) + { + $close_tag_new = $close_tag; + } + + $close_tag_length = strlen($close_tag); + $close_tag_new_length = strlen($close_tag_new); + $uid_length = strlen($uid); + + $use_function_pointer = ($func && ($func != '')); + + $stack = array(); + + if (is_array($open_tag)) + { + if (0 == count($open_tag)) + { + // No opening tags to match, so return. + return $text; + } + $open_tag_count = count($open_tag); + } + else + { + // only one opening tag. make it into a 1-element array. + $open_tag_temp = $open_tag; + $open_tag = array(); + $open_tag[0] = $open_tag_temp; + $open_tag_count = 1; + } + + $open_is_regexp = false; + + if ($open_regexp_replace) + { + $open_is_regexp = true; + if (!is_array($open_regexp_replace)) + { + $open_regexp_temp = $open_regexp_replace; + $open_regexp_replace = array(); + $open_regexp_replace[0] = $open_regexp_temp; + } + } + + if ($mark_lowest_level && $open_is_regexp) + { + message_die(GENERAL_ERROR, "Unsupported operation for bbcode_first_pass_pda()."); + } + + // Start at the 2nd char of the string, looking for opening tags. + $curr_pos = 1; + while ($curr_pos && ($curr_pos < strlen($text))) + { + $curr_pos = strpos($text, "[", $curr_pos); + + // If not found, $curr_pos will be 0, and the loop will end. + if ($curr_pos) + { + // We found a [. It starts at $curr_pos. + // check if it's a starting or ending tag. + $found_start = false; + $which_start_tag = ""; + $start_tag_index = -1; + + for ($i = 0; $i < $open_tag_count; $i++) + { + // Grab everything until the first "]"... + $possible_start = substr($text, $curr_pos, strpos($text, ']', $curr_pos + 1) - $curr_pos + 1); + + // + // We're going to try and catch usernames with "[' characters. + // + if( preg_match('#\[quote=\\\"#si', $possible_start, $match) && !preg_match('#\[quote=\\\"(.*?)\\\"\]#si', $possible_start) ) + { + // OK we are in a quote tag that probably contains a ] bracket. + // Grab a bit more of the string to hopefully get all of it.. + if ($close_pos = strpos($text, '"]', $curr_pos + 9)) + { + if (strpos(substr($text, $curr_pos + 9, $close_pos - ($curr_pos + 9)), '[quote') === false) + { + $possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 2); + } + } + } + + // Now compare, either using regexp or not. + if ($open_is_regexp) + { + $match_result = array(); + if (preg_match($open_tag[$i], $possible_start, $match_result)) + { + $found_start = true; + $which_start_tag = $match_result[0]; + $start_tag_index = $i; + break; + } + } + else + { + // straightforward string comparison. + if (0 == strcasecmp($open_tag[$i], $possible_start)) + { + $found_start = true; + $which_start_tag = $open_tag[$i]; + $start_tag_index = $i; + break; + } + } + } + + if ($found_start) + { + // We have an opening tag. + // Push its position, the text we matched, and its index in the open_tag array on to the stack, and then keep going to the right. + $match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index); + bbcode_array_push($stack, $match); + // + // Rather than just increment $curr_pos + // Set it to the ending of the tag we just found + // Keeps error in nested tag from breaking out + // of table structure.. + // + $curr_pos += strlen($possible_start); + } + else + { + // check for a closing tag.. + $possible_end = substr($text, $curr_pos, $close_tag_length); + if (0 == strcasecmp($close_tag, $possible_end)) + { + // We have an ending tag. + // Check if we've already found a matching starting tag. + if (sizeof($stack) > 0) + { + // There exists a starting tag. + $curr_nesting_depth = sizeof($stack); + // We need to do 2 replacements now. + $match = bbcode_array_pop($stack); + $start_index = $match['pos']; + $start_tag = $match['tag']; + $start_length = strlen($start_tag); + $start_tag_index = $match['index']; + + if ($open_is_regexp) + { + $start_tag = preg_replace($open_tag[$start_tag_index], $open_regexp_replace[$start_tag_index], $start_tag); + } + + // everything before the opening tag. + $before_start_tag = substr($text, 0, $start_index); + + // everything after the opening tag, but before the closing tag. + $between_tags = substr($text, $start_index + $start_length, $curr_pos - $start_index - $start_length); + + // Run the given function on the text between the tags.. + if ($use_function_pointer) + { + $between_tags = $func($between_tags, $uid); + } + + // everything after the closing tag. + $after_end_tag = substr($text, $curr_pos + $close_tag_length); + + // Mark the lowest nesting level if needed. + if ($mark_lowest_level && ($curr_nesting_depth == 1)) + { + if ($open_tag[0] == '[code]') + { + $code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#\[#', '#\]#', '#\(#', '#\)#', '#\{#', '#\}#'); + $code_entities_replace = array('<', '>', '"', ':', '[', ']', '(', ')', '{', '}'); + $between_tags = preg_replace($code_entities_match, $code_entities_replace, $between_tags); + } + $text = $before_start_tag . substr($start_tag, 0, $start_length - 1) . ":$curr_nesting_depth:$uid]"; + $text .= $between_tags . substr($close_tag_new, 0, $close_tag_new_length - 1) . ":$curr_nesting_depth:$uid]"; + } + else + { + if ($open_tag[0] == '[code]') + { + $text = $before_start_tag . '[code]'; + $text .= $between_tags . '[/code]'; + } + else + { + if ($open_is_regexp) + { + $text = $before_start_tag . $start_tag; + } + else + { + $text = $before_start_tag . substr($start_tag, 0, $start_length - 1) . ":$uid]"; + } + $text .= $between_tags . substr($close_tag_new, 0, $close_tag_new_length - 1) . ":$uid]"; + } + } + + $text .= $after_end_tag; + + // Now.. we've screwed up the indices by changing the length of the string. + // So, if there's anything in the stack, we want to resume searching just after it. + // otherwise, we go back to the start. + if (sizeof($stack) > 0) + { + $match = bbcode_array_pop($stack); + $curr_pos = $match['pos']; +// bbcode_array_push($stack, $match); +// ++$curr_pos; + } + else + { + $curr_pos = 1; + } + } + else + { + // No matching start tag found. Increment pos, keep going. + ++$curr_pos; + } + } + else + { + // No starting tag or ending tag.. Increment pos, keep looping., + ++$curr_pos; + } + } + } + } // while + + return $text; + +} // bbencode_first_pass_pda() + +/** + * Does second-pass bbencoding of the [code] tags. This includes + * running htmlspecialchars() over the text contained between + * any pair of [code] tags that are at the first level of + * nesting. Tags at the first level of nesting are indicated + * by this format: [code:1:$uid] ... [/code:1:$uid] + * Other tags are in this format: [code:$uid] ... [/code:$uid] + */ +function bbencode_second_pass_code($text, $uid, $bbcode_tpl) +{ + global $lang; + + $code_start_html = $bbcode_tpl['code_open']; + $code_end_html = $bbcode_tpl['code_close']; + + // First, do all the 1st-level matches. These need an htmlspecialchars() run, + // so they have to be handled differently. + $match_count = preg_match_all("#\[code:1:$uid\](.*?)\[/code:1:$uid\]#si", $text, $matches); + + for ($i = 0; $i < $match_count; $i++) + { + $before_replace = $matches[1][$i]; + $after_replace = $matches[1][$i]; + + // Replace 2 spaces with "  " so non-tabbed code indents without making huge long lines. + $after_replace = str_replace(" ", "  ", $after_replace); + // now Replace 2 spaces with "  " to catch odd #s of spaces. + $after_replace = str_replace(" ", "  ", $after_replace); + + // Replace tabs with "   " so tabbed code indents sorta right without making huge long lines. + $after_replace = str_replace("\t", "   ", $after_replace); + + // now Replace space occurring at the beginning of a line + $after_replace = preg_replace("/^ {1}/m", ' ', $after_replace); + + $str_to_match = "[code:1:$uid]" . $before_replace . "[/code:1:$uid]"; + + $replacement = $code_start_html; + $replacement .= $after_replace; + $replacement .= $code_end_html; + + $text = str_replace($str_to_match, $replacement, $text); + } + + // Now, do all the non-first-level matches. These are simple. + $text = str_replace("[code:$uid]", $code_start_html, $text); + $text = str_replace("[/code:$uid]", $code_end_html, $text); + + return $text; + +} // bbencode_second_pass_code() + +/** + * Rewritten by Nathan Codding - Feb 6, 2001. + * - Goes through the given string, and replaces xxxx://yyyy with an HTML tag linking + * to that URL + * - Goes through the given string, and replaces www.xxxx.yyyy[zzzz] with an HTML tag linking + * to http://www.xxxx.yyyy[/zzzz] + * - Goes through the given string, and replaces xxxx@yyyy with an HTML mailto: tag linking + * to that email address + * - Only matches these 2 patterns either after a space, or at the beginning of a line + * + * Notes: the email one might get annoying - it's easy to make it more restrictive, though.. maybe + * have it require something like xxxx@yyyy.zzzz or such. We'll see. + */ +function make_clickable($text) +{ + + // pad it with a space so we can match things at the start of the 1st line. + $ret = ' ' . $text; + + // matches an "xxxx://yyyy" URL at the start of a line, or after a space. + // xxxx can only be alpha characters. + // yyyy is anything up to the first space, newline, comma, double quote or < + $ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1\\2", $ret); + + // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing + // Must contain at least 2 dots. xxxx contains either alphanum, or "-" + // zzzz is optional.. will contain everything up to the first space, newline, + // comma, double quote or <. + $ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1\\2", $ret); + + // matches an email@domain type address at the start of a line, or after a space. + // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". + $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1\\2@\\3", $ret); + + // Remove our padding.. + $ret = substr($ret, 1); + + return($ret); +} + +/** + * Nathan Codding - Feb 6, 2001 + * Reverses the effects of make_clickable(), for use in editpost. + * - Does not distinguish between "www.xxxx.yyyy" and "http://aaaa.bbbb" type URLs. + * + */ +function undo_make_clickable($text) +{ + $text = preg_replace("#.*?#i", "\\1", $text); + $text = preg_replace("#.*?#i", "\\1", $text); + + return $text; + +} + +/** + * Nathan Codding - August 24, 2000. + * Takes a string, and does the reverse of the PHP standard function + * htmlspecialchars(). + */ +function undo_htmlspecialchars($input) +{ + $input = preg_replace("/>/i", ">", $input); + $input = preg_replace("/</i", "<", $input); + $input = preg_replace("/"/i", "\"", $input); + $input = preg_replace("/&/i", "&", $input); + + return $input; +} + +/** + * This is used to change a [*] tag into a [*:$uid] tag as part + * of the first-pass bbencoding of [list] tags. It fits the + * standard required in order to be passed as a variable + * function into bbencode_first_pass_pda(). + */ +function replace_listitems($text, $uid) +{ + $text = str_replace("[*]", "[*:$uid]", $text); + + return $text; +} + +/** + * Escapes the "/" character with "\/". This is useful when you need + * to stick a runtime string into a PREG regexp that is being delimited + * with slashes. + */ +function escape_slashes($input) +{ + $output = str_replace('/', '\/', $input); + return $output; +} + +/** + * This function does exactly what the PHP4 function array_push() does + * however, to keep phpBB compatable with PHP 3 we had to come up with our own + * method of doing it. + */ +function bbcode_array_push(&$stack, $value) +{ + $stack[] = $value; + return(sizeof($stack)); +} + +/** + * This function does exactly what the PHP4 function array_pop() does + * however, to keep phpBB compatable with PHP 3 we had to come up with our own + * method of doing it. + */ +function bbcode_array_pop(&$stack) +{ + $arrSize = count($stack); + $x = 1; + + while(list($key, $val) = each($stack)) + { + if($x < count($stack)) + { + $tmpArr[] = $val; + } + else + { + $return_val = $val; + } + $x++; + } + $stack = $tmpArr; + + return($return_val); +} + +// +// Smilies code ... would this be better tagged on to the end of bbcode.php? +// Probably so and I'll move it before B2 +// +function smilies_pass($message) +{ + static $orig, $repl; + + if (!isset($orig)) + { + global $db, $board_config; + $orig = $repl = array(); + + $sql = 'SELECT * FROM ' . SMILIES_TABLE; + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't obtain smilies data", "", __LINE__, __FILE__, $sql); + } + $smilies = $db->sql_fetchrowset($result); + + if (count($smilies)) + { + usort($smilies, 'smiley_sort'); + } + + for ($i = 0; $i < count($smilies); $i++) + { + $orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/"; + $repl[] = '' . $smilies[$i]['emoticon'] . ''; + } + } + + if (count($orig)) + { + $message = preg_replace($orig, $repl, ' ' . $message . ' '); + $message = substr($message, 1, -1); + } + + return $message; +} + +function smiley_sort($a, $b) +{ + if ( strlen($a['code']) == strlen($b['code']) ) + { + return 0; + } + + return ( strlen($a['code']) > strlen($b['code']) ) ? -1 : 1; +} + +load_bbcode_template(); +/* +$m = "[url]http://tomcort.com[/url]"; +$uid = make_bbcode_uid(); +$m = bbencode_first_pass($m, $uid); +$m = bbencode_second_pass($m,$uid); +echo "$m"; +*/ +?> diff --git a/site/source/functions/bbcode.txt.tpl b/site/source/functions/bbcode.txt.tpl new file mode 100644 index 0000000..a0ee500 --- /dev/null +++ b/site/source/functions/bbcode.txt.tpl @@ -0,0 +1,50 @@ +
      +
    + +
      +
    + +
  • + + + +
    + + + + + + + + +
    {L_QUOTE}:
    +
    + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + +{DESCRIPTION} ( {URL} ) + +{EMAIL} diff --git a/site/source/functions/cats_mail.php b/site/source/functions/cats_mail.php new file mode 100644 index 0000000..38c0aa9 --- /dev/null +++ b/site/source/functions/cats_mail.php @@ -0,0 +1,82 @@ +connect(); + + if (!$result->success()) { + return $result; + } + + $result = $mailer->cmd_helo(); + + if (!$result->success()) { + echo "HELO FAILED!"; + return $result; + } + + $result = $mailer->cmd_auth(); + + if (!$result->success()) { + echo "AUTH FAILED!"; + return $result; + } + + $result = $mailer->cmd_mail_from($from); + + if (!$result->success()) { + echo "MAIL FROM FAILED"; + return $result; + } + + $result = $mailer->cmd_rcpt_to($to); + + if (!$result->success()) { + echo "RCPT TO FAILED"; + return $result; + } + + $result = $mailer->cmd_data($from,$to,$subject,$body); + + if (!$result->success()) { + echo "DATA FAILED"; + return $result; + } + + $result = $mailer->cmd_quit(); + + if (!$result->success()) { + echo "QUIT FAILED"; + return $result; + } + + $mailer->disconnect(); + return new return_result(true); +} + +# test code +#$smtp_host = "cs.ubishops.ca"; +#$r = cats_mail("tcort@cs.ubishops.ca","tcort@cs.ubishops.ca","Final Last Tests","Hey Tom, +#Dag, yo. This email api is r0x0r. U r a 1337 h4x0r. w00t! +#Mr Deeds"); + +?> diff --git a/site/source/functions/databases/mysql.inc b/site/source/functions/databases/mysql.inc new file mode 100644 index 0000000..e9a57e2 --- /dev/null +++ b/site/source/functions/databases/mysql.inc @@ -0,0 +1,75 @@ + 0) + { + return TRUE; + } + else + { + return FALSE; + } +} + +function db_connect() +{ + global $db_conn, $db_name, $db_user, $db_pass, $db_host; + if ($db_conn == NULL || $db_conn == FALSE) + { + $db_conn = mysql_connect($db_host, $db_user, $db_pass); + mysql_select_db($db_name); + } +} + +function db_data_seek($rs, $pos) +{ + mysql_data_seek($rs, $pos); +} + + +function db_close() +{ + global $db_conn; + mysql_close($db_conn); +} + +?> diff --git a/site/source/functions/databases/postgres.inc b/site/source/functions/databases/postgres.inc new file mode 100644 index 0000000..f50fdca --- /dev/null +++ b/site/source/functions/databases/postgres.inc @@ -0,0 +1,85 @@ +$query

    "; + $result = pg_query($db_conn, $query); + #print "

    $query

    "; + #print "----------OUT---------"; + return new DBResult($result,$query); +} + +function db_exec($query) +{ + global $db_conn; + db_connect(); + #print "*********IN**********"; + #print "

    $query

    "; + $result = pg_query($db_conn, $query); + #print "*********OUT*********"; + if ($result == FALSE) + print "

    db_exec() failed, query: $query

    "; + if (pg_affected_rows($result) > 0) + { + return TRUE; + } + else + { + return FALSE; + } +} + +function db_connect() +{ + global $db_conn, $db_name, $db_user, $db_pass; + if ($db_conn == NULL || $db_conn == FALSE) + { + $db_conn = pg_connect("dbname=$db_name user=$db_user"); + + # For debugging purposes only + #print "

    Formed a new connection

    "; + } +} + +function db_data_seek($rs, $pos) +{ + @pg_fetch_row($rs, $pos); +} + +function db_close() +{ + global $db_conn; + pg_close($db_conn); +} + +?> diff --git a/site/source/functions/db_access.php b/site/source/functions/db_access.php new file mode 100644 index 0000000..3da2568 --- /dev/null +++ b/site/source/functions/db_access.php @@ -0,0 +1,22 @@ + diff --git a/site/source/globals.php b/site/source/globals.php new file mode 100644 index 0000000..e91bfb9 --- /dev/null +++ b/site/source/globals.php @@ -0,0 +1,51 @@ + array(actor); +$event_table = new collection(); + +# maps String -> array(actor); +$action_table = new collection(); + +# SMTP Address +$smtp_host = "cs.ubishops.ca"; +$smtp_port = 25; +$smtp_user = "tcort"; +$smtp_pass = "cuntassbitch"; + +?> diff --git a/site/source/htdocs/.htaccess b/site/source/htdocs/.htaccess new file mode 100644 index 0000000..75c389b --- /dev/null +++ b/site/source/htdocs/.htaccess @@ -0,0 +1,3 @@ +RewriteEngine on + +RewriteRule ^post_(.*).php /index.php?a=default&postid=$1 diff --git a/site/source/htdocs/index.php b/site/source/htdocs/index.php new file mode 100644 index 0000000..905be73 --- /dev/null +++ b/site/source/htdocs/index.php @@ -0,0 +1,99 @@ +has_next()) { + $row = $result->get_row(); + $username = $row[0]; + $accesslevel = $row[1]; +} + +$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : "default"; + +# load_modules +foreach (glob("../modules/*.php") as $filename) { + include_once($filename); +} + +# Run the action +$actions = $action_table->get($action); + +if ($actions == false) { + # someone entered an action that doesn't have any registered actions + # ex someone did something like index.php?a=0u9gfqej09fqnoi + + $action = "default"; + foreach (glob("../modules/*.php") as $filename) { + include_once($filename); + } + + $actions = $action_table->get($action); + + if ($actions == false) { + # If we get here then we are total screwed. No default action or + # requested action. This should only happen if the modules are deleted + echo "Fatal Error!"; + echo "

    Fatal System Error


    No module to available to complete the requested action. The default module was missing too! Contact an administrator immediately."; + echo ""; + } else { + while (list($key, $value) = each($actions)) { + $action_result = $actions[$key]->execute(); + + # on failure get messages + if (!$action_result->success()) { + $msg = $handler_result->get_messages(); + + for ($i = 0; $i < count($msg); $i++) { + $result->add_message($msg[$i]); + } + + if ($result->success()) { + $result->set_result(false); + } + } + } + } + return true; +} else { + while (list($key, $value) = each($actions)) { + $action_result = $actions[$key]->execute(); + + # on failure get messages + if (!$action_result->success()) { + $msg = $action_result->get_messages(); + + if (isset($result) && is_object($result)) { + for ($i = 0; $i < count($msg); $i++) { + $result->add_message($msg[$i]); + } + + if ($result->success()) { + $result->set_result(false); + } + } + } + } +} +?> diff --git a/site/source/htdocs/style.css b/site/source/htdocs/style.css new file mode 100644 index 0000000..96f730c --- /dev/null +++ b/site/source/htdocs/style.css @@ -0,0 +1,118 @@ +body { + background-color: #eeeeee; +} + + +p,ul,ol { + color: black; + font-size: 80%; + font-family: Verdana, "Lucida Sans", Arial, Geneva, Helvetica, Helv, "Myriad Web", Syntax, sans-serif; + text-align: justify; +} + +h1, h2, h3, h4, h5, h6 +{ + font-family: "Trebuchet MS", Verdana, "Lucida Sans", Arial, Geneva, Helvetica, Helv, "Myriad Web", Syntax, sans-serif; +} + +th +{ + font-weight: bold; + background-color: #cccccc; + font-family: "Trebuchet MS", Verdana, "Lucida Sans", Arial, Geneva, Helvetica, Helv, "Myriad Web", Syntax, sans-serif; +} + + +h1 +{ + color: #454545; + font-size: 175%; + font-weight: bold; +} + +h2 +{ + color: #707070; + font-size: 130%; + font-weight: normal; + border: 1px solid #cccccc; + border-width: 0px 0px 1px 0px; + padding-bottom: 0px; +} + +h3 +{ + color: #707070; + font-size: 100%; + font-weight: bold; + border: 1px solid #cccccc; + border-width: 0px 0px 1px 0px; + padding-bottom: 0px; + text-align: center; +} + +.right { + text-align: right; +} + +.left { + text-align: left; +} + +.center { + text-align: center; +} + +.nav { + color: #000000; + font-weight: bold; + text-decoration: none; + font-size: 80%; + font-family: Verdana, "Lucida Sans", Arial, Geneva, Helvetica, Helv, "Myriad Web", Syntax, sans-serif; +} + +.title { + color: #000000; + font-weight: bold; + text-decoration: none; + font-size: 80%; + font-family: Verdana, "Lucida Sans", Arial, Geneva, Helvetica, Helv, "Myriad Web", Syntax, sans-serif; +} + +.small { + color: #000000; + font-size: 60%; + font-family: Verdana, "Lucida Sans", Arial, Geneva, Helvetica, Helv, "Myriad Web", Syntax, sans-serif; +} + + +.footer { + color: #555555; + font-size: 60%; + font-family: Verdana, "Lucida Sans", Arial, Geneva, Helvetica, Helv, "Myriad Web", Syntax, sans-serif; + text-align: center; +} + +a { + color: black; + font-weight: bold; + text-decoration: none; +} + +a:link { + text-decoration: none; +} + +a:visited { + text-decoration: none; +} + +a:active { + text-decoration: none; +} + +a:hover { + color: #ff0033; + text-decoration: underline; +} + diff --git a/site/source/html/index.html b/site/source/html/index.html new file mode 100644 index 0000000..cacf1dc --- /dev/null +++ b/site/source/html/index.html @@ -0,0 +1,8 @@ + + +Moved + + +Moved to https://larrythecow.com. + + diff --git a/site/source/main.php b/site/source/main.php new file mode 100644 index 0000000..4506c98 --- /dev/null +++ b/site/source/main.php @@ -0,0 +1,90 @@ +get($event_name); + if ($event_handlers == false) { + $result = new return_result(false); + $result->add_message("No Event Handlers for $event_name event"); + return $result; + } else { + $result = new return_result(true); + + while (list($key, $value) = each($event_handlers)) { + $handler_result = $event_handlers[$key]->execute(); + + # on failure get messages + if (!$handler_result->success()) { + $msg = $handler_result->get_messages(); + + for ($i = 0; $i < count($msg); $i++) { + $result->add_message($msg[$i]); + } + + if ($result->success()) { + $result->set_result(false); + } + } + } + return $result; + } +} + +function register_action($action) { + global $action_table; + $action_table->put($action->get_name(),$action); +} + +function register_handler($event_handler) { + global $event_table; + $event_table->put($event_handler->get_name(),$event_handler); +} + +# little function that escapes variables, if necessary +function doslashes($str) { + if (!get_magic_quotes_gpc()) { + return addslashes($str); + } + + return $str; +} + +?> diff --git a/site/source/modules/auth.php b/site/source/modules/auth.php new file mode 100644 index 0000000..91adcfb --- /dev/null +++ b/site/source/modules/auth.php @@ -0,0 +1,238 @@ +
    "; + echo ""; + echo "
    Username: "; + echo "
    Password: "; + echo "
    "; + echo ""; + echo ""; + echo ""; + echo "
    "; + echo "
    "; + + } else { + + echo "

    Already Logged In

    "; + echo "

    Thank You! Come again!

    "; + + } + + return new return_result(true); + } +} + +class login_event extends actor { + function execute() { + global $username, $accesslevel; + + $_username = isset($_REQUEST['username']) ? doslashes($_REQUEST['username']) : ""; + $password = isset($_REQUEST['passwd']) ? md5($_REQUEST['passwd']): ""; + $sessionid = session_id(); + + if ($_username != "" and $password !="") { + $result = db_query("SELECT users.userid,users.accesslevel FROM users WHERE username='$_username' and passwd='$password';"); + if ($result->has_next()) { + $row = $result->get_row(); + $userid = $row[0]; + $_accesslevel = $row[1]; + $result = db_query("SELECT * FROM sessions WHERE userid = '$userid';"); + + if ($result->has_next() && !db_exec("DELETE FROM sessions WHERE userid = '$userid';")) { + trigger("begin_story"); + echo "

    Database Error

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + + if (db_exec("INSERT INTO sessions (sessionid,userid) VALUES ('$sessionid','$userid');")) { + $username = $_username; + $accesslevel = $_accesslevel; + trigger("default"); + } else { + trigger("begin_story"); + echo "

    Database Error

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    Authentication Error

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    Authentication Error

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + return new return_result(true); + } +} + +class logout_action extends actor { + function execute() { + global $accesslevel, $username; + trigger("html_headers"); + + $sessionid = session_id(); + if (db_exec("DELETE FROM sessions WHERE sessionid = '$sessionid';")) { + session_unset(); + session_destroy(); + $accesslevel = 1; + $username = "guest"; + trigger("begin_story"); + echo "

    Logged Out!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + echo "
    "; + trigger("default"); + } else { + trigger("begin_story"); + echo "

    Database Error!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + trigger("html_footers"); + return new return_result(true); + } +} + +class passwd_action extends actor { + function execute() { + global $accesslevel, $username; + trigger("html_headers"); + if (isset($_REQUEST['passwd'])) { + trigger("passwd"); + } else { + trigger("display_passwd"); + } + trigger("html_footers"); + return new return_result(true); + } +} + +class display_passwd_event extends actor { + function execute() { + global $username; + + trigger("begin_story"); + + if ($username != "guest") { + echo "

    Change Password

    "; + echo "
    "; + echo ""; + echo "
    Old Password: "; + echo "
    "; + echo "
    New Password: "; + echo "
    "; + echo "
    Again: "; + echo "
    "; + echo ""; + echo ""; + echo " "; + echo "
    "; + } else { + + echo "

    You aren't Logged In!

    "; + echo "

    Thank You! Come again!

    "; + + } + + trigger("end_story"); + return new return_result(true); + } +} + +class passwd_event extends actor { + function execute() { + global $username; + + $old_passwd = isset($_REQUEST['old_passwd']) ? md5($_REQUEST['old_passwd']) : ""; + $again_passwd = isset($_REQUEST['again_passwd']) ? md5($_REQUEST['again_passwd']) : ""; + $new_passwd = isset($_REQUEST['new_passwd']) ? md5($_REQUEST['new_passwd']) : ""; + + if ($old_passwd != "" && $again_passwd != "" && $new_passwd != "") { + if ($new_passwd == $again_passwd) { + $result = db_query("SELECT * from users WHERE username = '$username' AND passwd = '$old_passwd';"); + if ($result->has_next()) { + if (db_exec("UPDATE users SET passwd = '$new_passwd' WHERE username = '$username';")) { + trigger("begin_story"); + echo "

    Password Updated!

    "; + trigger("end_story"); + echo "
    "; + trigger("default"); + } else { + trigger("begin_story"); + echo "

    Database Error!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    Wrong Old Password!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    New and Again Passwords Don't Match!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    Incomplete Form Data!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + + return new return_result(true); + } +} + +register_handler(new login_event("login",50)); +register_handler(new display_login_event("display_login",50)); +register_action(new login_action("login",50)); +register_action(new logout_action("logout",50)); +register_handler(new passwd_event("passwd",50)); +register_handler(new display_passwd_event("display_passwd",50)); +register_action(new passwd_action("passwd",50)); +?> diff --git a/site/source/modules/default.php b/site/source/modules/default.php new file mode 100644 index 0000000..bbb3107 --- /dev/null +++ b/site/source/modules/default.php @@ -0,0 +1,70 @@ + +

    +This web application is used by the Adopt a Developer team to manage project related information +such as resources requested by developers, resources offered by community members, previous +donations, thanks yous, and contact information. Unless you are an authorized member of the +Adopt a Developer project and have a valid login, this page will not very useful to you. +

    +

    +If you would like infomation about the Adopt a Developer project, please +visit our project page at the folling URL: http://www.gentoo.org/proj/en/userrel/adopt-a-dev +

    + +

    Welcome, !

    +

    +Please choose from one of the following tasks: +

    +

    + diff --git a/site/source/modules/edit.php b/site/source/modules/edit.php new file mode 100644 index 0000000..7bf5b71 --- /dev/null +++ b/site/source/modules/edit.php @@ -0,0 +1,284 @@ +'; + while ($result->has_next()) { + $row = $result->get_row(); + echo "\n"; + } + echo ""; + } + + function people_select_list($select,$name) { + $result = db_query("SELECT peopleid, last, first from people order by last"); + echo ""; + } + + function project_resource_select_list($resourceid) { + $result = db_query("SELECT projects.projectid, name from projects, project_specific_resources where projects.projectid = project_specific_resources.projectid and project_specific_resources.resourceid = '$resourceid'"); + echo ""; + } + + function project_select_list() { + $result = db_query("SELECT projectid, name from projects order by name"); + echo ""; + } + + function project_exists($projectid) { + $result = db_query("select count(*) from projects where projectid = '$projectid'"); + $temp = $result->get_row(); + return $temp[0]; + } + + function execute() { + global $username, $accesslevel; + + if ($username == "guest") { + trigger("begin_story"); +?> +

    Permission Denied

    + trigger("end_story"); + Invalid Resource"; + } else { + + $result = db_query("select donorid, devid, quantity, resource, purpose, status from resources where resourceid = '$resourceid'"); + + if (!$result->has_next()) { + echo "

    Invalid Resource

    "; + } else { + $row = $result->get_row(); + + if (isset($_REQUEST['commit']) && $_REQUEST['commit'] = "yes") { + $fail_msg = ""; + $qnty = (isset($_REQUEST['qnty']) && is_numeric($_REQUEST['qnty']) && $_REQUEST['qnty'] > 0) ? $_REQUEST['qnty'] : "null"; + + if ($qnty == "null") { + $fail_msg .= "Quantity must be > 0
    "; + } + + $resource = (isset($_REQUEST['resource']) && $_REQUEST['resource'] != "") ? $_REQUEST['resource'] : "null"; + if ($resource == "null") { + $fail_msg .= "Resource must not be empty
    "; + } + $resource = doslashes($resource); + + $statusid = (isset($_REQUEST['status']) && is_numeric($_REQUEST['status'])) ? $_REQUEST['status'] : "null"; + if ($statusid != "null") { + $result = db_query("select status from status where statusid = '$statusid'"); + if (!$result->has_next()) { + $fail_msg .= "Status not found
    "; + } else { + $myrow = $result->get_row(); + $status = $myrow[0]; + } + } else { + $fail_msg .= "Status ID must be numeric
    "; + } + + $purpose = (isset($_REQUEST['purpose']) && $_REQUEST['purpose'] != "") ? $_REQUEST['purpose'] : "null"; + if ($purpose == "null" && $status != "offering" && $status != "hidden") { + $fail_msg .= "Purpose must not be empty
    "; + } + $purpose = doslashes($purpose); + + $devid = (isset($_REQUEST['dev']) && is_numeric($_REQUEST['dev'])) ? $_REQUEST['dev'] : "null"; + if ($status != "offering" && $status != "hidden") { + if ($devid == "null") { + $fail_msg .= "Dev ID must be numeric
    "; + } else { + $result = db_query("select * from people where peopleid = '$devid'"); + if (!$result->has_next()) { + $fail_msg .= "Developer not found
    "; + } + } + } + + $donorid = (isset($_REQUEST['donor']) && is_numeric($_REQUEST['donor'])) ? $_REQUEST['donor'] : "null"; + if ($status != "seeking" && $status != "hidden") { + if ($donorid == "null") { + $fail_msg .= "Donor ID must be numeric
    "; + } else { + $result = db_query("select * from people where peopleid = '$donorid'"); + if (!$result->has_next()) { + $fail_msg .= "Donor not found
    "; + } + } + } + + $result = db_query("select count(*) from project_specific_resources where resourceid = '$resourceid'"); + $temp = $result->get_row(); + $num_projects = $temp[0]; + + $add_project = (isset($_REQUEST['add_project']) && (is_numeric($_REQUEST['add_project']) || $_REQUEST['add_project'] == "NULL")) ? $_REQUEST['add_project'] : "null"; + $del_project = (isset($_REQUEST['del_project']) && (is_numeric($_REQUEST['del_project']) || $_REQUEST['del_project'] == "NULL")) ? $_REQUEST['del_project'] : "null"; + + if ($add_project == "null") { + $fail_msg .= "Add project must give a numeric id or NULL"; + } + + if ($del_project == "null") { + $fail_msg .= "Del project must give a numeric id or NULL"; + } + + if (is_numeric($add_project) && $this->project_exists($add_project) == 0) { + $fail_msg .= "Add project: invalid project id"; + } + + if (is_numeric($del_project) && $this->project_exists($del_project) == 0) { + $fail_msg .= "Del project: invalid project id"; + } + + if (is_numeric($add_project)) { + $result = db_query("select count(*) from project_specific_resources where resourceid = '$resourceid' and projectid = '$add_project'"); + $temp = $result->get_row(); + if ($temp[0] > 0) { + $fail_msg .= "The project you are trying to add is already associated with this resource"; + } + } + + if ($num_projects == 1 && !is_numeric($add_project) && is_numeric($del_project)) { + $fail_msg .= "A resource must have at least 1 project associated with it"; + } + + if ($fail_msg == "") { + $sql = "update resources set "; + $sql .= "quantity = '$qnty', status = '$statusid', "; + if (is_numeric($donorid)) { + $sql .= "donorid = '$donorid', "; + } else { + $sql .= "donorid = NULL, "; + } + if (is_numeric($devid)) { + $sql .= "devid = '$devid', "; + } else { + $sql .= "devid = NULL, "; + } + $sql .= "resource = '" . doslashes($resource) . "', purpose = '" . doslashes($purpose) ."', "; + $sql .= "date_created = date_created, "; + $sql .= "date_modified = NOW() "; + $sql .= "where resourceid = $resourceid"; + if (db_exec($sql)) { + if (is_numeric($add_project)) { + db_exec("insert into project_specific_resources (resourceid,projectid) values ($resourceid,$add_project)"); + } + if (is_numeric($del_project)) { + db_exec("delete from project_specific_resources where resourceid = $resourceid and projectid = $del_project"); + } + echo "Done"; + } else { + echo "sql failure: $sql"; + } + } else { + echo $fail_msg; + } + trigger("end_story"); + echo "
    "; + trigger("begin_story"); + } + + $result = db_query("select donorid, devid, quantity, resource, purpose, status from resources where resourceid = '$resourceid'"); + $row = $result->get_row(); +?> +

    Edit a Resource

    +
    + + + + + + + +
    IDQntyStatusstatus_select_list($row[5]); ?>
    Donorpeople_select_list($row[0],"donor"); ?>Resource
    Devpeople_select_list($row[1],"dev"); ?>Purpose
    Projectshas_next()) { + $row = $result->get_row(); + echo "$row[0] "; + } + ?> +
    Add Projectproject_select_list(); ?>Del Projectproject_resource_select_list($resourceid); ?>
    Submit + + + Clear
    +
    + diff --git a/site/source/modules/email_report.php b/site/source/modules/email_report.php new file mode 100644 index 0000000..6f11c75 --- /dev/null +++ b/site/source/modules/email_report.php @@ -0,0 +1,87 @@ +has_next()) { + $row = $result->get_row(); + $username = $row[0]; + $accesslevel = $row[1]; +} + +if ($accesslevel != 1) { + +$guidexml = -1; +include_once("../functions/bbcode.php"); + + +echo "\n\n"; + +echo "Community Member Offers\n"; +echo "=======================\n\n"; + +$result = db_query("SELECT first, last, location, quantity, resource, date_modified from people, resources, status where status.statusid = resources.status and status.status = 'offering' and people.peopleid = donorid and UNIX_TIMESTAMP(date_modified) > UNIX_TIMESTAMP(now()) - 604800;"); +while ($result->has_next()) { + $row = $result->get_row(); + + for ($i = 0; $i <= 5; $i++) { + $uid = make_bbcode_uid(); + $row[$i] = bbencode_first_pass($row[$i],$uid); + $row[$i] = bbencode_second_pass($row[$i],$uid); + } + + + echo "Offered Resource: $row[4]\n"; + echo "Name: $row[0] $row[1]\n"; + echo "Location: $row[2]\n"; + echo "Last Modified: $row[5]\n\n"; +} + +echo "\n\n"; +echo "New Developer Requests\n"; +echo "======================\n\n"; + + +$result = db_query("SELECT first, last, location, quantity, resource, purpose, resourceid, date_modified from people, resources, status where status.statusid = resources.status and status.status = 'seeking' and people.peopleid = devid and UNIX_TIMESTAMP(date_modified) > UNIX_TIMESTAMP(now()) - 604800;"); +while ($result->has_next()) { + $row = $result->get_row(); + + for ($i = 0; $i <= 5; $i++) { + $uid = make_bbcode_uid(); + $row[$i] = bbencode_first_pass($row[$i],$uid); + $row[$i] = bbencode_second_pass($row[$i],$uid); + } + + echo "Resource: $row[4]\n"; + echo "Purpose: $row[5]\n"; + echo "Name: $row[0] $row[1] // Location: $row[2] // Last Modified: $row[7]\n\n"; +} + +} +return new return_result(true); +}} +register_action(new email_report_action("email_report",1)); +?> diff --git a/site/source/modules/layout.php b/site/source/modules/layout.php new file mode 100644 index 0000000..f04046f --- /dev/null +++ b/site/source/modules/layout.php @@ -0,0 +1,293 @@ + + + + + + <?php echo "$site_title"; ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    + + + + +
    + +
    +
    + +
    + + + + +
    + + © 2004 Thomas Cort, Patrick McLean, Scott Stoddard, Adam Beaumont."; + + # make html_footers a singleton + if (!$called_footers) { + $called_footers = 1; + echo "
    "; + +?> +
    +
    + + + + + + + + + +
    + + + + + + + +
    +  Login +
    + +
    +
    + + +
    + + + + + + + +
    + + + + + + + +
    +  Menu +
    + +
    +
    + + + +
    + + + + + +
    + + + + + + + + + + +
    + + + + +
    + + + + +
    + +
    +
    +
    + + + "; + + # print them all out + while ($db_result->has_next()) { + $row = $db_result->get_row(); + echo "
  • $row[3]
  • "; + } + + echo ""; + + return new return_result(true); + } +} + +class search_action extends actor { + function execute() { + global $accesslevel, $username; + trigger("html_headers"); + trigger("display_search"); + trigger("html_footers"); + return new return_result(true); + } +} + +class display_search_event extends actor { + function execute() { + + echo "
    "; + echo ""; + echo "
    "; + echo "
    "; + echo ""; + echo ""; + echo " "; + echo "
    "; + echo "
    "; + + return new return_result(true); + } +} + +class blogroll_event extends actor { + function execute() { + $result = db_query("SELECT url,name FROM links WHERE UPPER(name) LIKE '%BLOG%' ORDER BY name"); + + echo "
      "; + + while($result->has_next()) { + $row = $result->get_row(); + $row[1] = preg_split("/\'/",$row[1]); + echo "
    • ".$row[1][0]."
    • "; + } + + echo "
    "; + return new return_result(true); + } +} + +register_handler(new blogroll_event("blogroll",50)); +register_handler(new begin_story("begin_story",50)); +register_handler(new end_story("end_story",50)); +register_handler(new html_headers("html_headers",50)); +register_handler(new html_footers("html_footers",50)); +register_handler(new display_search_event("display_search",50)); +register_action(new search_action("search",50)); +register_handler(new menu_event("menu",50)); + +?> diff --git a/site/source/modules/menu.php b/site/source/modules/menu.php new file mode 100644 index 0000000..ccc0ae4 --- /dev/null +++ b/site/source/modules/menu.php @@ -0,0 +1,49 @@ +
      "; + + # Print them all out + while ($db_result->has_next()) { + $row = $db_result->get_row(); + echo "
    • $row[2]
    • "; + } + + echo "

    "; + + return new return_result(true); + } +} + +register_handler(new display_menu_event("display_menu",50)); +?> diff --git a/site/source/modules/people.php b/site/source/modules/people.php new file mode 100644 index 0000000..84e5dbf --- /dev/null +++ b/site/source/modules/people.php @@ -0,0 +1,173 @@ +People (in order by last name)"; + $result = db_query("select peopleid, first, last, email, location from people order by last"); + while ($result->has_next()) { + $row = $result->get_row(); + echo "
    "; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
    First Name: "; + echo "Last Name: "; + echo "
    e-mail: "; + echo "Location: "; + echo "
    "; + echo ""; + echo ""; + echo ""; + echo " "; + echo "  

    "; + } + echo "

    Add a Person

    "; + echo "
    "; + echo ""; + echo "
    First Name: "; + echo "
    "; + echo "
    Last Name: "; + echo "
    "; + echo "
    e-mail: "; + echo "
    "; + echo "
    Location: "; + echo "
    "; + echo ""; + echo ""; + echo " "; + echo "
    "; + + } else { + + echo "

    You aren't Logged In!

    "; + echo "

    Thank You! Come again!

    "; + + } + + trigger("end_story"); + return new return_result(true); + } +} + +class people_event extends actor { + function execute() { + + $peopleid = isset($_REQUEST['peopleid']) && is_numeric($_REQUEST['peopleid']) ? $_REQUEST['peopleid'] : ""; + $first = isset($_REQUEST['first']) ? $_REQUEST['first'] : ""; + $last = isset($_REQUEST['last']) ? $_REQUEST['last'] : ""; + $email = isset($_REQUEST['email']) ? $_REQUEST['email'] : ""; + $location = isset($_REQUEST['location']) ? $_REQUEST['location'] : ""; + + if (is_numeric($peopleid) && $first != "" && $last != "" && $email != "" && location != "") { + $result = db_query("SELECT * from people where first = '".doslashes($first)."' and last = '".doslashes($last)."' and email = '".doslashes($email)."' and location = '".doslashes($location)."'"); + if (!$result->has_next()) { + $result = db_query("SELECT * from people where peopleid = $peopleid"); + if ($result->has_next()) { + if (db_exec("update people set first = '".doslashes($first)."', last = '".doslashes($last)."', email = '".doslashes($email)."', location = '".doslashes($location)."' where peopleid = $peopleid")) { + trigger("begin_story"); + echo "

    Done!

    "; + trigger("end_story"); + } else { + trigger("begin_story"); + echo "

    DB Error!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    people ID does not exist!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    Nothing Has Changed!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    Incomplete Form Data!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + + echo "
    "; + return new return_result(true); + } +} + +class people_add_event extends actor { + function execute() { + + $first = isset($_REQUEST['first']) ? $_REQUEST['first'] : ""; + $last = isset($_REQUEST['last']) ? $_REQUEST['last'] : ""; + $email = isset($_REQUEST['email']) ? $_REQUEST['email'] : ""; + $location = isset($_REQUEST['location']) ? $_REQUEST['location'] : ""; + + if ($first != "" && $last != "" && $email != "" && $location != "") { + if (db_exec("insert into people (first,last,email,location) values ('".doslashes($first)."', '".doslashes($last)."', '".doslashes($email)."', '".doslashes($location)."')")) { + trigger("begin_story"); + echo "

    Done!

    "; + trigger("end_story"); + } else { + trigger("begin_story"); + echo "

    DB Error!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    Incomplete Form Data!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + + echo "
    "; + return new return_result(true); + } +} + +register_handler(new people_event("people",50)); +register_handler(new people_add_event("people_add",50)); +register_handler(new display_people_event("display_people",50)); +register_action(new people_action("people",50)); +?> diff --git a/site/source/modules/project.php b/site/source/modules/project.php new file mode 100644 index 0000000..251655e --- /dev/null +++ b/site/source/modules/project.php @@ -0,0 +1,162 @@ +Projects (ordered by name)"; + $result = db_query("select projectid, name, url from projects order by name"); + while ($result->has_next()) { + $row = $result->get_row(); + echo "
    "; + echo ""; + echo ""; + echo "
    Name: "; + echo "URL: "; + echo ""; + echo ""; + echo ""; + echo ""; + echo " "; + echo "

    "; + } + + echo "

    Add a Project

    "; + echo "
    "; + echo ""; + echo "
    Project Name: "; + echo "
    "; + echo "
    URL: "; + echo "
    "; + echo ""; + echo ""; + echo " "; + echo "
    "; + + } else { + + echo "

    You aren't Logged In!

    "; + echo "

    Thank You! Come again!

    "; + + } + + trigger("end_story"); + return new return_result(true); + } +} + +class project_event extends actor { + function execute() { + + $projectid = isset($_REQUEST['projectid']) && is_numeric($_REQUEST['projectid']) ? $_REQUEST['projectid'] : ""; + $project_name = isset($_REQUEST['project_name']) ? $_REQUEST['project_name'] : ""; + $project_url = isset($_REQUEST['project_url']) ? $_REQUEST['project_url'] : ""; + + if (is_numeric($projectid) && $project_url != "" && $project_name != "") { + $result = db_query("SELECT * from projects where url = '".doslashes($project_url)."' and name = '".doslashes($project_name)."';"); + if (!$result->has_next()) { + $result = db_query("SELECT * from projects where projectid = $projectid"); + if ($result->has_next()) { + if (db_exec("update projects set url = '".doslashes($project_url)."', name = '".doslashes($project_name)."' where projectid = $projectid")) { + trigger("begin_story"); + echo "

    Done!

    "; + trigger("end_story"); + } else { + trigger("begin_story"); + echo "

    DB Error!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    Project ID does not exist!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    Nothing Has Changed!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    Incomplete Form Data!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + + echo "
    "; + return new return_result(true); + } +} + +class project_add_event extends actor { + function execute() { + + $project_name = isset($_REQUEST['project_name']) ? $_REQUEST['project_name'] : ""; + $project_url = isset($_REQUEST['project_url']) ? $_REQUEST['project_url'] : ""; + + if ($project_url != "" && $project_name != "") { + if (db_exec("insert into projects (name,url) values ('".doslashes($project_name)."','".doslashes($project_url)."')")) { + trigger("begin_story"); + echo "

    Done!

    "; + trigger("end_story"); + } else { + trigger("begin_story"); + echo "

    DB Error

    "; + trigger("end_story"); + } + } else { + trigger("begin_story"); + echo "

    Incomplete Form Data!

    "; + echo "

    Thank You! Come again!

    "; + trigger("end_story"); + } + + echo "
    "; + return new return_result(true); + } +} + +register_handler(new project_event("project",50)); +register_handler(new project_add_event("project_add",50)); +register_handler(new display_project_event("display_project",50)); +register_action(new project_action("project",50)); +?> diff --git a/site/source/modules/resource.php b/site/source/modules/resource.php new file mode 100644 index 0000000..670997a --- /dev/null +++ b/site/source/modules/resource.php @@ -0,0 +1,412 @@ +'; + while ($result->has_next()) { + $row = $result->get_row(); + echo "\n"; + } + echo ""; + } + function people_select_list($select,$name) { + $result = db_query("SELECT peopleid, last, first from people order by last"); + echo ""; + } + + function project_resource_select_list($resourceid) { + $result = db_query("SELECT projects.projectid, name from projects, project_specific_resources where projects.projectid = project_specific_resources.projectid and project_specific_resources.resourceid = '$resourceid'"); + echo ""; + } + + function project_select_list() { + $result = db_query("SELECT projectid, name from projects order by name"); + echo ""; + } + + function project_exists($projectid) { + $result = db_query("select count(*) from projects where projectid = '$projectid'"); + $temp = $result->get_row(); + return $temp[0]; + } + function execute() { + global $username, $accesslevel; + + if ($username == "guest") { + trigger("begin_story"); +?> +

    Permission Denied

    + Developers Seeking Resources"; + $result = db_query("SELECT resourceid, first, last, location, quantity, resource, purpose, status.status, date_created, date_modified, email from people, resources, status where status.statusid = resources.status and status.status = 'seeking' and people.peopleid = devid"); + while ($result->has_next()) { + $row = $result->get_row(); + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + if ($result->has_next()) { + echo ""; + } + } + echo "
    ID$row[0]Qnty$row[4]Status$row[7]
    DonorN/AResource$row[5]
    Dev$row[1] $row[2]Purpose$row[6]
    Dev e-mail$row[10]Donor e-mailN/AEditClick Here
    Project"; + $subresult = db_query("SELECT name,url from projects, project_specific_resources where projects.projectid = project_specific_resources.projectid and project_specific_resources.resourceid = '$row[0]'"); + while ($subresult->has_next()) { + $subrow = $subresult->get_row(); + echo "$subrow[0] "; + } + echo "Created$row[8]Modified$row[9]
      
    "; + + echo "

    Community Members Offering Resources

    "; + $result = db_query("SELECT resourceid, first, last, location, quantity, resource, status.status, date_created, date_modified, email from people, resources, status where status.statusid = resources.status and status.status = 'offering' and people.peopleid = donorid"); + while ($result->has_next()) { + $row = $result->get_row(); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + if ($result->has_next()) { + echo ""; + } + } + echo "
    ID$row[0]Qnty$row[4]Status$row[6]
    Donor$row[1] $row[2]Resource$row[5]
    DevN/APurposeN/A
    Dev e-mailN/ADonor e-mail$row[9]EditClick Here
    ProjectN/ACreated$row[7]Modified$row[8]
      
    "; + + echo "

    Completed Donations

    "; + + $result = db_query("SELECT resourceid, donor.first, donor.last, dev.first, dev.last, quantity, resource, purpose, status.status as status, date_created, date_modified, donor.email, dev.email from people as donor, people as dev, resources, status where dev.peopleid = devid and donor.peopleid = donorid and status.status = 'thanks' and status.statusid = resources.status order by resourceid"); + while ($result->has_next()) { + $row = $result->get_row(); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + if ($result->has_next()) { + echo ""; + } + } + + echo "
    ID$row[0]Qnty$row[5]Status$row[8]
    Donor$row[1] $row[2]Resource$row[6]
    Dev$row[3] $row[4]Purpose$row[7]
    Dev e-mail$row[11]Donor e-mail$row[12]EditClick Here
    Project"; + + $subresult = db_query("SELECT name,url from projects, project_specific_resources where projects.projectid = project_specific_resources.projectid and project_specific_resources.resourceid = '$row[0]'"); + while ($subresult->has_next()) { + $subrow = $subresult->get_row(); + echo "$subrow[0] "; + } + echo "Created$row[9]Modified$row[10]
      
    "; + echo "

    Hidden Resources

    "; + $result = db_query("SELECT resourceid, quantity, purpose, resource, date_created, date_modified from resources, status where status.statusid = resources.status and status.status = 'hidden'"); + while ($result->has_next()) { + $row = $result->get_row(); + $subresult = db_query("select donorid, devid from resources where resourceid = '$row[0]'"); + $subrow = $subresult->get_row(); + echo ""; + + if ($subrow[0]) { + $subresult = db_query("select first, last, email from people where peopleid = '$subrow[0]'"); + $don = $subresult->get_row(); + $donor = "$don[0] $don[1]"; + $donor_email = "$don[2]"; + } else { + $donor = "NULL"; + $donor_email = "NULL"; + } + + if ($subrow[1]) { + $subresult = db_query("select first, last, email from people where peopleid = '$subrow[1]'"); + $don = $subresult->get_row(); + $dev = "$don[0] $don[1]"; + $dev_email = "$don[2]"; + } else { + $dev = "NULL"; + $dev_email = "NULL"; + } + + echo ""; + echo ""; + echo ""; + echo ""; + + if ($result->has_next()) { + echo ""; + } + } + echo "
    ID$row[0]Qnty$row[1]Statushidden
    Donor$donorResource$row[3]
    Dev$devPurpose$row[2]
    Dev e-mail$dev_emailDonor e-mail$donor_emailEditClick Here
    Project"; + + $subresult = db_query("SELECT name,url from projects, project_specific_resources where projects.projectid = project_specific_resources.projectid and project_specific_resources.resourceid = '$row[0]'"); + while ($subresult->has_next()) { + $subrow = $subresult->get_row(); + echo "$subrow[0] "; + } + echo "Created$row[4]Modified$row[5]
      
    "; +?>

    Add a Resource

    +
    + + + + + + +
    IDN/AQntyStatusstatus_select_list(1); ?>
    Donorpeople_select_list(0,"donor"); ?>Resource
    Devpeople_select_list(0,"dev"); ?>Purpose
    Add Projectproject_select_list(); ?>Submit + + + Clear
    +
    +'; + while ($result->has_next()) { + $row = $result->get_row(); + echo "\n"; + } + echo ""; + } + + function people_select_list($select,$name) { + $result = db_query("SELECT peopleid, last, first from people order by last"); + echo ""; + } + + function project_resource_select_list($resourceid) { + $result = db_query("SELECT projects.projectid, name from projects, project_specific_resources where projects.projectid = project_specific_resources.projectid and project_specific_resources.resourceid = '$resourceid'"); + echo ""; + } + + function project_select_list() { + $result = db_query("SELECT projectid, name from projects order by name"); + echo ""; + } + + function project_exists($projectid) { + $result = db_query("select count(*) from projects where projectid = '$projectid'"); + $temp = $result->get_row(); + return $temp[0]; + } + + + + function execute() { + trigger("begin_story"); + $fail_msg = ""; + $qnty = (isset($_REQUEST['qnty']) && is_numeric($_REQUEST['qnty']) && $_REQUEST['qnty'] > 0) ? $_REQUEST['qnty'] : "null"; + + if ($qnty == "null") { + $fail_msg .= "Quantity must be > 0
    "; + } + + $resource = (isset($_REQUEST['resource']) && $_REQUEST['resource'] != "") ? $_REQUEST['resource'] : "null"; + if ($resource == "null") { + $fail_msg .= "Resource must not be empty
    "; + } + + $statusid = (isset($_REQUEST['status']) && is_numeric($_REQUEST['status'])) ? $_REQUEST['status'] : "null"; + if ($statusid != "null") { + $result = db_query("select status from status where statusid = '$statusid'"); + if (!$result->has_next()) { + $fail_msg .= "Status not found
    "; + } else { + $myrow = $result->get_row(); + $status = $myrow[0]; + } + } else { + $fail_msg .= "Status ID must be numeric
    "; + } + + $purpose = (isset($_REQUEST['purpose']) && $_REQUEST['purpose'] != "") ? $_REQUEST['purpose'] : "null"; + if ($purpose == "null" && $status != "offering" && $status != "hidden") { + $fail_msg .= "Purpose must not be empty
    "; + } + + $devid = (isset($_REQUEST['dev']) && is_numeric($_REQUEST['dev'])) ? $_REQUEST['dev'] : "null"; + if ($status != "offering" && $status != "hidden") { + if ($devid == "null") { + $fail_msg .= "Dev ID must be numeric
    "; + } else { + $result = db_query("select * from people where peopleid = '$devid'"); + if (!$result->has_next()) { + $fail_msg .= "Developer not found
    "; + } + } + } + + $donorid = (isset($_REQUEST['donor']) && is_numeric($_REQUEST['donor'])) ? $_REQUEST['donor'] : "null"; + if ($status != "seeking" && $status != "hidden") { + if ($donorid == "null") { + $fail_msg .= "Donor ID must be numeric
    "; + } else { + $result = db_query("select * from people where peopleid = '$donorid'"); + if (!$result->has_next()) { + $fail_msg .= "Donor not found
    "; + } + } + } + + $add_project = (isset($_REQUEST['add_project']) && (is_numeric($_REQUEST['add_project']) || $_REQUEST['add_project'] == "NULL")) ? $_REQUEST['add_project'] : "null"; + + if ($add_project == "null") { + $fail_msg .= "Add project must give a numeric id or NULL"; + } + + if (is_numeric($add_project) && $this->project_exists($add_project) == 0) { + $fail_msg .= "Add project: invalid project id"; + } + + if ($fail_msg == "") { + $sql = "insert into resources "; + $sql .= "(quantity,status,"; + if (is_numeric($donorid)) { + $sql .= "donorid,"; + } + if (is_numeric($devid)) { + $sql .= "devid,"; + } + $sql .= "resource,purpose,date_created,date_modified) values ("; + $sql .= "$qnty,$statusid,"; + if (is_numeric($donorid)) { + $sql .= "$donorid,"; + } + if (is_numeric($devid)) { + $sql .= "$devid,"; + } + $sql .= "'".doslashes($resource) . "','" . doslashes($purpose) ."',NOW(),NOW())"; + if (db_exec($sql)) { + $result = db_query("select resourceid from resources where resource = '".doslashes($resource)."' and purpose = '".doslashes($purpose)."' and status = $statusid"); + $row = $result->get_row(); + $resourceid = $row[0]; + db_exec("insert into project_specific_resources (resourceid,projectid) values ($resourceid,$add_project)"); + echo "Done"; + } else { + echo "sql failure: $sql"; + } + } else { + echo $fail_msg; + } + trigger("end_story"); + echo "
    "; + return new return_result(true); + } +} + +register_handler(new resource_event("resource",50)); +register_handler(new resource_add_event("resource_add",50)); +register_action(new resource_action("resource",50)); + +?> diff --git a/site/source/modules/xml.php b/site/source/modules/xml.php new file mode 100644 index 0000000..666c80a --- /dev/null +++ b/site/source/modules/xml.php @@ -0,0 +1,435 @@ +has_next()) { + $row = $result->get_row(); + $username = $row[0]; + $accesslevel = $row[1]; +} + +if ($accesslevel != 1) { + +$guidexml = 1; +include_once("../functions/bbcode.php"); + + +echo "\n"; +echo "\n"; +echo "\n"; + +?> + + + + + + +adopt-a-dev + +Adopt a Developer (beta) + + + + + Thomas Cort + + + + This project aims to connect developers who need resources + (ie hardware, technical books, shell accounts, etc) with people + and companies from the community who want to donate resources. + + + + This project aims to connect developers who need resources with people + and companies from the community who want to donate resources. Useful + resources include computer hardware, books, shell accounts, and + anything else that enhances the development process. This project is + not involved with monetary donations; if you wish to donate money, + you may do so through paypal. + If you are a developer looking for monetary resources, then you + may be interested in the + Gentoo Foundation Funding and Expenditures page. + This project does not collect any resources itself, it only acts + a central point of contact for potential donors and individual + developers. + + +has_next()) { + $row = $db_result->get_row(); + echo "$row[0]\n"; + } +?> + + + Project Status +
    + + +

    + This project is still in its infancy. It is in beta + since we are still getting feedback and working out all of the + details. If you'd like to share your ideas about the project with us, + we may be contacted at + adopt-a-dev@gentoo.org. + While the project is in beta, we will only deal with items that can + be obtained for less than $250 USD. +

    + + +
    +
    + + + The Need for Resources +
    + + +

    + A lot of the packages in the tree require specific hardware to test. + For example, cdrtools requires a CD burner, qc-usb requires a QuickCam, + wireless-tools requires a wireless network card, etc. Donating items + like those allows us to ensure they work on the many architectures we + support. Hardware donations can also be used to replace broken parts; + we all know what it's like to lose a hard drive or some other crucial + component. It is especially hard on developers who are students on a + budget. We are always looking to support new architectures or + architectures that have little developer help. Donating rare and exotic + hardware can improve such situations. +

    + +

    + Computer hardware isn't the only thing that a developer might find + useful. Gentoo developers can also benefit greatly from technical + books. Books can enhance a developer's ability to solve bugs and + maintain ebuilds. Books can also aid in the development of Gentoo + related software projects like portage. + Passes to technical conferences can help in these areas too. + Shell accounts on remote computers can be used for compiling and + testing packages. +

    + +

    + When a developer makes a request, he or she must state the purpose and + what project(s) benefit from it. So, a "needed resource" is anything that + helps accomplish a project related task for a developer. A full system + may be needed in some cases (example, for building releases and testing + live CDs). Some architecture teams are seriously lacking the CPU power to + build GRP releases in a reasonable amount of time. +

    + + +
    +
    + + + Community: How to offer Resources +
    + + +

    + If you wish to donate any of the resources listed in the Developers Seeking Resources section or if you + want to purchase 1 or more of those items and have them shipped to a + developer, then you should submit a completed offer form to get put in touch with the + developer. Do not contact the developer directly, use + adopt-a-dev@gentoo.org. We + like to keep track of things to ensure that our lists are as accurate + and as up to date as humanly possible. +

    + +

    + You can also offer up any existing resources you have that are + in working good condition and would enhance the development process. + To be listed in the Community Members + Offering Resources section, submit a completed offer form to + adopt-a-dev@gentoo.org. If + you wish to remain anonymous, please let us know. More details on + privacy in the Privacy Policy. +

    + + +
    +
    + + + Developers: How to request Resources +
    + + +

    + Submit a completed request form to + adopt-a-dev@gentoo.org, a + team member will review the request and post it to the site. The + review process is only meant to ensure that the item can be used for a + Gentoo project and to ensure that the request is clearly written. In + general, we will post all requests. If we find that your request needs + elucidation, then we will contact you. Your request must be sent from + your @gentoo.org e-mail address. +

    + +

    + You must be an official Gentoo developer for at least 6 months + before requesting or receiving resources through adopt a developer. + You are limited to 4 open requests at any given time. You may ask for any + of your open requests to be changed or removed to make room for a new + request. There is no hard limit on the amount of resources you receive. + However, please use common sense. Only ask for + things you need and will use to improve Gentoo. Additionally, if you + have gotten hardware through adopt-a-dev and you no longer use the + hardware or have a need for it, please consider offering it to + other developers. +

    + +

    + The adopt a developer project strongly encourages developers who get + resources through adopt a developer to write publicly (planet, forums, mailing lists, + etc) about any progress they have made with the help of the donated + resources, what goals they have accomplished, and how the resources + have helped them. +

    + +

    + In the event that a user offers a resource and 2 or more developers + want the resource, then the adopt-a-dev team will work with the + developers involved to see if the resource can be shared. If its + something like a complete system, then maybe a shell account could be + setup for the other dev(s) involved. If it is a resource that can't easily be + shared, then maybe the developers could swap the item after a certain + amount of time. If those methods fail, then the resource will go to the + developer who requested it first. The one who requested it first is the + developer whose completed request form arrived first. +

    + + +
    +
    + + + Developers Seeking Resources +
    + + + + + + + + + + + +has_next()) { + $row = $result->get_row(); + + for ($i = 0; $i <= 5; $i++) { + $uid = make_bbcode_uid(); + $row[$i] = bbencode_first_pass($row[$i],$uid); + $row[$i] = bbencode_second_pass($row[$i],$uid); + } + + echo "\n"; + echo " $row[0] $row[1]\n"; + echo " $row[2]\n"; + echo " $row[3]\n"; + echo " $row[4]\n"; + echo " $row[5]\n"; + echo " "; + $subresult = db_query("SELECT name,url from projects, project_specific_resources where projects.projectid = project_specific_resources.projectid and project_specific_resources.resourceid = '$row[6]'"); + while ($subresult->has_next()) { + $subrow = $subresult->get_row(); + echo "$subrow[0] "; + } + echo "\n"; + echo "\n"; +} +?> +
    DeveloperLocationQntyResourcePurposeProject
    + + +
    +
    + + + Community Members Offering Resources +
    + + + + + + + + + +has_next()) { + $row = $result->get_row(); + + for ($i = 0; $i <= 4; $i++) { + $uid = make_bbcode_uid(); + $row[$i] = bbencode_first_pass($row[$i],$uid); + $row[$i] = bbencode_second_pass($row[$i],$uid); + } + + + echo "\n"; + echo " $row[0] $row[1]\n"; + echo " $row[2]\n"; + echo " $row[3]\n"; + echo " $row[4]\n"; + echo "\n"; +} +?> +
    NameLocationQntyResource
    + + +
    +
    + + + Thank You +
    + + +

    + The Gentoo project would very much like to thank the following people + for their generosity. +

    + + + + + + + + + + +has_next()) { + $row = $result->get_row(); + + + for ($i = 0; $i <= 6; $i++) { + $uid = make_bbcode_uid(); + $row[$i] = bbencode_first_pass($row[$i],$uid); + $row[$i] = bbencode_second_pass($row[$i],$uid); + } + + + echo "\n"; + echo " $row[0] $row[1]\n"; + echo " $row[2] $row[3]\n"; + echo " $row[4]\n"; + echo " $row[5]\n"; + echo " $row[6]\n"; + echo " "; + $subresult = db_query("SELECT name,url from projects, project_specific_resources where projects.projectid = project_specific_resources.projectid and project_specific_resources.resourceid = '$row[7]'"); + while ($subresult->has_next()) { + $subrow = $subresult->get_row(); + echo "$subrow[0] "; + } + echo "\n"; + echo "\n"; +} +?> +
    DonorDeveloperQntyResourcePurposeProject
    + + +
    +
    + + + Privacy Policy +
    + + +

    + We aim to balance the respect for the personal privacy of every donor + and potential donor while recognizing their contribution. Donor and + potential donor e-mail addresses will never be posted on the project + page. By default, names will be posted on the project page in the + Community Members Offering Resources + and Thank You sections. If you wish to + remain anonymous, please let us know in your correspondence with us. +

    + + +
    +
    + + + + Disclaimer +
    + + +

    + This project is only responsible for connecting donors with individual + developers. Our responsibilities stop there. We hope all + items donated to Gentoo developers are put to good use improving + Gentoo. We cannot guarantee that a developer will accomplish all of + the goals related to the resource(s) he or she receives. + The project does not deal with organizing shipping, nor do we + deal with disputes between developers and donors. + Gentoo is not a 501(c)(3) organization but is applying for 501(c)(6) + status instead. Therefore, donations are not and will not be + tax-deductible in the U.S. In other countries, the laws will differ -- + please check with your lawyer. +

    + + +
    +
    + +
    + + -- cgit v1.2.3-65-gdbad