-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ef8f5c8
Showing
229 changed files
with
47,098 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
CREDITS | ||
|
||
Building this software would have been impossible without building on the work of others. I would like to thank the following | ||
people and projects (in no particular order) for their work: | ||
|
||
Smarty Template Engine | ||
http://www.smarty.net/ | ||
|
||
Bootstrap | ||
http://twitter.github.com/bootstrap/ | ||
|
||
Bootswatch | ||
http://bootswatch.com/ | ||
|
||
jQuery Validation plugin | ||
Jorn Zaefferer | ||
http://bassistance.de/jquery-plugins/jquery-plugin-validation/ | ||
|
||
Batch. | ||
Adam Whitcroft | ||
http://adamwhitcroft.com/batch/ | ||
|
||
jQuery Validate Bootstrap integration | ||
David Cochran | ||
http://alittlecode.com/files/jQuery-Validate-Demo/ | ||
|
||
Datepicker for Boostrap | ||
http://www.eyecon.ro/bootstrap-datepicker/ | ||
|
||
jQuery lightBox plugin | ||
Leandro Vieira Pinho | ||
http://leandrovieira.com/projects/jquery/lightbox/ | ||
|
||
Lightbox2 | ||
Lokesh Dhakar | ||
http://lokeshdhakar.com/projects/lightbox2/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
Installation Instructions | ||
|
||
NOTE: these instructions are specific to operating with MySQL. | ||
If you're going to use a different database, substitute your database | ||
server's setup procedure where necessary. | ||
|
||
1. Unpack phpgiftreg website | ||
2. Create MySQL database | ||
3. Create MySQL tables | ||
4. Create MySQL user (optional) | ||
5. Configure db.php | ||
6. Configure config.php (optional) | ||
7. Create Apache alias | ||
8. Set up the initial family and user using setup.php | ||
|
||
============================================================================= | ||
|
||
1. Unpack phpgiftreg website | ||
|
||
Change to the directory where you're going to run the website from and | ||
extract the pages. The tarball contains the phpgiftreg/ directory itself. | ||
|
||
user@host $ tar -xvzf phpgiftreg-x.x.x.tar.gz | ||
<output> | ||
|
||
Then give everything the proper permissions (thanks to Paul Hubbard for | ||
pointing this out). An example would be owner-writable, world-readable: | ||
|
||
user@host $ cd phpgiftreg-x.x.x | ||
user@host $ chmod 644 *.php *.css images/* | ||
|
||
As of 1.6.0, there is a subdirectory called item_images/ that must be | ||
writeable by the webserver. The phpgiftreg scripts will be writing files | ||
to this directory. Don't worry, the setup.php script described below | ||
will test if you got this right. | ||
|
||
As of 2.0.0, there are subdirectories called cache/ and templates_c/ | ||
that must also be writeable by the webserver. setup.php will also test | ||
if those have the correct permissions. | ||
|
||
============================================================================= | ||
|
||
2. Create MySQL database | ||
|
||
Login to the MySQL server with a user capable of creating databases. If | ||
you're running a trusted system, simply executing `mysql' should be adequate. | ||
Otherwise, do something like this: | ||
|
||
user@host $ mysql -u username -h host -p | ||
Enter password: <enter password here> | ||
Welcome to the MySQL monitor. Commands end with ; or \g. | ||
Your MySQL connection id is 626 to server version: 3.23.58-log | ||
|
||
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. | ||
|
||
mysql> | ||
|
||
Once inside, create the phpgiftreg database: | ||
|
||
mysql> create database phpgiftreg; | ||
Database phpgiftreg created. | ||
|
||
============================================================================= | ||
|
||
3. Create MySQL tables | ||
|
||
You can examine the area where the `ranks' table is populated and | ||
modify that. There's a column for the rank's description and how it | ||
should look when rendered in HTML. By default, it shows between 1 and 5 | ||
stars, which should be suitable for most installations. | ||
|
||
Change to the phpgiftreg database like this: | ||
|
||
mysql> use phpgiftreg; | ||
Reading table information for completion of table and column names | ||
You can turn off this feature to get a quicker startup with -A | ||
|
||
Database changed | ||
|
||
Run the create-phpgiftregdb.sql script like this: | ||
|
||
mysql> source /path/to/create-phpgiftregdb.sql | ||
<lots of activity> | ||
|
||
mysql> | ||
|
||
============================================================================= | ||
|
||
4. Create MySQL user (optional) | ||
|
||
You should have a separate user for the database. If you choose to, create | ||
the new user like so: | ||
|
||
mysql> GRANT ALL ON phpgiftreg.* TO username@host IDENTIFIED BY 'password'; | ||
mysql> FLUSH PRIVILEGES; | ||
|
||
This creates a user called `username' that can connect from `host'. | ||
|
||
============================================================================= | ||
|
||
5. Configure includes/config.php | ||
|
||
You MUST edit includes/config.php to define your database connection. | ||
It is required to set the `pdo_connection_string', `pdo_username' | ||
and `pdo_password' settings. See | ||
http://www.php.net/manual/en/pdo.construct.php for more information, | ||
especially if you are going to use a database other than MySQL. | ||
|
||
NOTE: phpgiftreg is only tested on MySQL, though other databases should | ||
(in theory) work with little modification. | ||
|
||
There are some options to change in config.php if you wish. Their functions | ||
are described in that file. | ||
|
||
NOTE: older versions of phpgiftreg defined database parameters in a | ||
file called db.php. That file is no longer used, and connection information | ||
belongs in includes/config.php. | ||
|
||
============================================================================= | ||
|
||
6. Create Apache alias | ||
|
||
Edit your httpd.conf and add an Alias like so: | ||
|
||
Alias /phpgiftreg/ "/path/to/phpgiftreg/" | ||
|
||
The trailing slashes are important. Restart the web server and you should | ||
be good to go. | ||
|
||
============================================================================= | ||
|
||
7. Set up the initial family and user using setup.php | ||
|
||
Point your browser to http://yourserver/phpgiftreg/setup.php or wherever you | ||
installed it. It will check your confirmation, and then you'll be prompted | ||
to enter some details for an initial administrator user and the default | ||
family. If everything goes well, you'll be ready to begin! | ||
|
||
============================================================================= | ||
|
||
If you have any problems with these instructions, or if they weren't clear | ||
or just didn't plain work, please let me know at [email protected]. | ||
|
||
Ryan Walberg | ||
[email protected] | ||
@GeneralPF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
PHP Gift Registry (phpgiftreg) | ||
|
||
The PHP Gift Registry is a web-enabled gift registry intended for use among | ||
a circle of family members or friends. | ||
|
||
It is intended to fill the following purposes: | ||
x Permit the long-term storage of a list of items one desires, along with | ||
its price, where it can be bought, and (optionally) a URL where it can be | ||
viewed. | ||
x Enabled items to be "locked" by one shopper so that the same item is not | ||
bought by someone else. | ||
|
||
Its features include: | ||
x A single unifying view of items on your own list and people whose lists you | ||
can view. | ||
x A now-optional request/permit system by which you can control who can see | ||
your list. | ||
x A "checkin/checkout" system which allows you to reserve items on someone's | ||
list. | ||
x An in-system messaging system by which users can be informed of item | ||
deletions or custom announcements. | ||
x New users can request accounts. Optionally, administrators will be | ||
informed about the request, and they can then approve or reject the | ||
request. Either way, the user will be informed by e-mail. | ||
x A site-customizable ranking system for items. | ||
x An events system for users to add significant (read: gift-bearing) events | ||
which will show up on others' displays when the event nears. | ||
|
||
Read INSTALL for installation instructions. | ||
|
||
If you have any questions, comments, feature requests, or patches, feel | ||
free to e-mail me. | ||
|
||
phpgiftreg is licensed by the GPL. For more information on the GPL, visit | ||
http://www.gnu.org | ||
|
||
Copyright 2012 Ryan Walberg <[email protected]> @GeneralPF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation; either version 2 of the License, or | ||
// (at your option) any later version. | ||
|
||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
|
||
require_once(dirname(__FILE__) . "/includes/funcLib.php"); | ||
require_once(dirname(__FILE__) . "/includes/MySmarty.class.php"); | ||
$smarty = new MySmarty(); | ||
$opt = $smarty->opt(); | ||
|
||
session_start(); | ||
if (!isset($_SESSION["userid"])) { | ||
header("Location: " . getFullPath("login.php")); | ||
exit; | ||
} | ||
else if ($_SESSION["admin"] != 1) { | ||
echo "You don't have admin privileges."; | ||
exit; | ||
} | ||
else { | ||
$userid = $_SESSION["userid"]; | ||
} | ||
|
||
$action = $_GET["action"]; | ||
if ($action == "approve") { | ||
$pwd = generatePassword($opt); | ||
if ($_GET["familyid"] != "") { | ||
$stmt = $smarty->dbh()->prepare("INSERT INTO {$opt["table_prefix"]}memberships(userid,familyid) VALUES(?, ?)"); | ||
$stmt->bindValue(1, (int) $_GET["userid"], PDO::PARAM_INT); | ||
$stmt->bindValue(2, (int) $_GET["familyid"], PDO::PARAM_INT); | ||
$stmt->execute(); | ||
} | ||
$stmt = $smarty->dbh()->prepare("UPDATE {$opt["table_prefix"]}users SET approved = 1, password = {$opt["password_hasher"]}(?) WHERE userid = ?"); | ||
$stmt->bindParam(1, $pwd, PDO::PARAM_INT); | ||
$stmt->bindValue(2, (int) $_GET["userid"], PDO::PARAM_INT); | ||
$stmt->execute(); | ||
|
||
// send the e-mails | ||
$stmt = $smarty->dbh()->prepare("SELECT username, email FROM {$opt["table_prefix"]}users WHERE userid = ?"); | ||
$stmt->bindValue(1, (int) $_GET["userid"], PDO::PARAM_INT); | ||
$stmt->execute(); | ||
if ($row = $stmt->fetch()) { | ||
mail( | ||
$row["email"], | ||
"Gift Registry application approved", | ||
"Your Gift Registry application was approved by " . $_SESSION["fullname"] . ".\r\n" . | ||
"Your username is " . $row["username"] . " and your password is $pwd.", | ||
"From: {$opt["email_from"]}\r\nReply-To: {$opt["email_reply_to"]}\r\nX-Mailer: {$opt["email_xmailer"]}\r\n" | ||
) or die("Mail not accepted for " . $row["email"]); | ||
} | ||
header("Location: " . getFullPath("index.php")); | ||
exit; | ||
} | ||
else if ($action == "reject") { | ||
// send the e-mails | ||
$stmt = $smarty->dbh()->prepare("SELECT email FROM {$opt["table_prefix"]}users WHERE userid = ?"); | ||
$stmt->bindValue(1, (int) $_GET["userid"], PDO::PARAM_INT); | ||
$stmt->execute(); | ||
if ($row = $stmt->fetch()) { | ||
mail( | ||
$row["email"], | ||
"Gift Registry application denied", | ||
"Your Gift Registry application was denied by " . $_SESSION["fullname"] . ".", | ||
"From: {$opt["email_from"]}\r\nReply-To: {$opt["email_reply_to"]}\r\nX-Mailer: {$opt["email_xmailer"]}\r\n" | ||
) or die("Mail not accepted for " . $row["email"]); | ||
} | ||
|
||
$stmt = $smarty->dbh()->prepare("DELETE FROM {$opt["table_prefix"]}users WHERE userid = ?"); | ||
$stmt->bindValue(1, (int) $_GET["userid"], PDO::PARAM_INT); | ||
$stmt->execute(); | ||
|
||
header("Location: " . getFullPath("index.php")); | ||
exit; | ||
} | ||
?> |
Oops, something went wrong.