Changes for my own site

This commit is contained in:
Michael Erdely 2024-10-08 22:44:19 -04:00
parent 381628e571
commit e601540c38
7 changed files with 33 additions and 21 deletions

View file

@ -41,7 +41,7 @@ if ($action == "approve") {
$stmt->execute(); $stmt->execute();
} }
$stmt = $smarty->dbh()->prepare("UPDATE {$opt["table_prefix"]}users SET approved = 1, password = {$opt["password_hasher"]}(?) WHERE userid = ?"); $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->bindParam(1, $pwd, PDO::PARAM_STR);
$stmt->bindValue(2, (int) $_GET["userid"], PDO::PARAM_INT); $stmt->bindValue(2, (int) $_GET["userid"], PDO::PARAM_INT);
$stmt->execute(); $stmt->execute();
@ -54,7 +54,9 @@ if ($action == "approve") {
$row["email"], $row["email"],
"Gift Registry application approved", "Gift Registry application approved",
"Your Gift Registry application was approved by " . $_SESSION["fullname"] . ".\r\n" . "Your Gift Registry application was approved by " . $_SESSION["fullname"] . ".\r\n" .
"Your username is " . $row["username"] . " and your password is $pwd.", "Your username is " . $row["username"] . " and your password is '$pwd'.\r\n" .
"Log in to https://wishlist.erdelynet.com/ and change your password under\r\n" .
"Update Profile as soon as possible.",
"From: {$opt["email_from"]}\r\nReply-To: {$opt["email_reply_to"]}\r\nX-Mailer: {$opt["email_xmailer"]}\r\n" "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"]); ) or die("Mail not accepted for " . $row["email"]);
} }

View file

@ -18,11 +18,11 @@ function getGlobalOptions() {
/* The PDO connection string. /* The PDO connection string.
http://www.php.net/manual/en/pdo.connections.php http://www.php.net/manual/en/pdo.connections.php
*/ */
"pdo_connection_string" => "mysql:host=localhost;dbname=giftreg", "pdo_connection_string" => "mysql:host=127.0.0.1;dbname=phpgiftreg",
/* The database username and password. */ /* The database username and password. */
"pdo_username" => "giftreg", "pdo_username" => "phpgiftreg",
"pdo_password" => "cn3Malk", "pdo_password" => "Disquietingly195.prosubstitution",
/* The maximum number of days before an event which produces a notification. */ /* The maximum number of days before an event which produces a notification. */
"event_threshold" => "60", "event_threshold" => "60",
@ -31,7 +31,7 @@ function getGlobalOptions() {
0 = auto-approve, 0 = auto-approve,
1 = require approval 1 = require approval
*/ */
"shop_requires_approval" => 1, "shop_requires_approval" => 0,
/* Whether or not requesting a new account is immediately approved. /* Whether or not requesting a new account is immediately approved.
0 = auto-approve, 0 = auto-approve,
@ -46,10 +46,10 @@ function getGlobalOptions() {
"items_per_page" => 10, "items_per_page" => 10,
/* The e-mail From: header. */ /* The e-mail From: header. */
"email_from" => "webmaster@" . $_SERVER['SERVER_NAME'], "email_from" => "wishlist@erdelynet.com",
/* The e-mail Reply-To: header. */ /* The e-mail Reply-To: header. */
"email_reply_to" => "rwalberg@mts.net", "email_reply_to" => "mike@erdelynet.com",
/* The e-mail X-Mailer header. */ /* The e-mail X-Mailer header. */
"email_xmailer" => "PHP/" . phpversion(), "email_xmailer" => "PHP/" . phpversion(),
@ -59,14 +59,14 @@ function getGlobalOptions() {
0 = don't help text, 0 = don't help text,
1 = show help text 1 = show help text
*/ */
"show_helptext" => 0, "show_helptext" => 1,
/* Whether or not clicking the Delete Item link requires a JavaScript-based /* Whether or not clicking the Delete Item link requires a JavaScript-based
confirmation. confirmation.
0 = don't show confirmation, 0 = don't show confirmation,
1 = show confirmation 1 = show confirmation
*/ */
"confirm_item_deletes" => 0, "confirm_item_deletes" => 1,
/* Whether or not to allow multiple quantities of an item. */ /* Whether or not to allow multiple quantities of an item. */
"allow_multiples" => 1, "allow_multiples" => 1,
@ -113,7 +113,7 @@ function getGlobalOptions() {
UPDATE users SET password = MD5(password) UPDATE users SET password = MD5(password)
on your database to convert the passwords. This operation is NON-REVERSIBLE! on your database to convert the passwords. This operation is NON-REVERSIBLE!
*/ */
"password_hasher" => "MD5", "password_hasher" => "SHA1",
/* Whether or not to allow image uploads. If on, the next option must point to /* Whether or not to allow image uploads. If on, the next option must point to
a valid subdirectory that is writeable by the web server. The setup.php a valid subdirectory that is writeable by the web server. The setup.php

View file

@ -256,7 +256,7 @@ while ($row = $stmt->fetch()) {
$categories[] = $row; $categories[] = $row;
} }
$stmt = $smarty->dbh()->prepare("SELECT ranking, title FROM {$opt["table_prefix"]}ranks ORDER BY rankorder"); $stmt = $smarty->dbh()->prepare("SELECT ranking, title FROM {$opt["table_prefix"]}ranks ORDER BY rankorder DESC");
$stmt->execute(); $stmt->execute();
$ranks = array(); $ranks = array();
while ($row = $stmt->fetch()) { while ($row = $stmt->fetch()) {

View file

@ -80,7 +80,9 @@ if (isset($_POST["action"]) && $_POST["action"] == "signup") {
$email, $email,
"Gift Registry account created", "Gift Registry account created",
"Your Gift Registry account was created.\r\n" . "Your Gift Registry account was created.\r\n" .
"Your username is $username and your password is $pwd.", "Your username is $username and your password is '$pwd'.\r\n" .
"Log in to https://wishlist.erdelynet.com/ and change your password under\r\n" .
"Update Profile as soon as possible.",
"From: {$opt["email_from"]}\r\nReply-To: {$opt["email_reply_to"]}\r\nX-Mailer: {$opt["email_xmailer"]}\r\n" "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 $email"); ) or die("Mail not accepted for $email");
} }

View file

@ -22,7 +22,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</a> </a>
<a class="brand" href="index.php">Gift Registry</a> <a class="brand" href="index.php">
<img src="images/wishlist.png" height=25px width=25px /> Gift Registry</a>
<div id="main-menu" class="nav-collapse"> <div id="main-menu" class="nav-collapse">
<ul id="main-menu-left" class="nav"> <ul id="main-menu-left" class="nav">
<li><a href="shoplist.php">My Shopping List</a></li> <li><a href="shoplist.php">My Shopping List</a></li>

View file

@ -87,8 +87,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th><a href="shop.php?shopfor={$shopfor}&sort=ranking">Rank</a></th>
<th><a href="shop.php?shopfor={$shopfor}&sort=description">Description</a></th> <th><a href="shop.php?shopfor={$shopfor}&sort=description">Description</a></th>
<th><a href="shop.php?shopfor={$shopfor}&sort=ranking">Rank</a></th>
<th><a href="shop.php?shopfor={$shopfor}&sort=category">Category</a></th> <th><a href="shop.php?shopfor={$shopfor}&sort=category">Category</a></th>
<th><a href="shop.php?shopfor={$shopfor}&sort=price">Price</a></th> <th><a href="shop.php?shopfor={$shopfor}&sort=price">Price</a></th>
<th><a href="shop.php?shopfor={$shopfor}&sort=source">Store/Location</a></th> <th><a href="shop.php?shopfor={$shopfor}&sort=source">Store/Location</a></th>
@ -99,19 +99,22 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
<tbody> <tbody>
{foreach from=$shoprows item=row} {foreach from=$shoprows item=row}
<tr valign="top"> <tr valign="top">
<td nowrap>{$row.rendered}</td>
<td> <td>
{if $row.url != ''}
<a href="{$row.url}" target="_blank">
{/if}
{$row.description|escape:'htmlall'} {$row.description|escape:'htmlall'}
{if $row.url != ''}
</a>
{/if}
{if $row.comment != ''} {if $row.comment != ''}
<a class="btn btn-small" rel="popover" href="#" data-placement="right" data-original-title="Comment" data-content="{$row.comment|escape:'htmlall'}">...</a> <a class="btn btn-small" rel="popover" href="#" data-placement="right" data-original-title="Comment" data-content="{$row.comment|escape:'htmlall'}">...</a>
{/if} {/if}
{if $row.url != ''}
<a href="{$row.url}" target="_blank"><img src="images/link.png" border="0" alt="URL" title="URL"></a>
{/if}
{if $row.image_filename != '' && $opt.allow_images} {if $row.image_filename != '' && $opt.allow_images}
<a rel="lightbox" href="{$opt.image_subdir}/{$row.image_filename}" title="{$row.description|escape:'htmlall'}"><img src="images/image.png" border="0" alt="Image" /></a> <a rel="lightbox" href="{$opt.image_subdir}/{$row.image_filename}" title="{$row.description|escape:'htmlall'}"><img src="images/image.png" border="0" alt="Image" /></a>
{/if} {/if}
</td> </td>
<td nowrap>{$row.rendered}</td>
<td>{$row.category|default:"&nbsp;"}</td> <td>{$row.category|default:"&nbsp;"}</td>
<td align="right">{$row.price}</td> <td align="right">{$row.price}</td>
<td>{$row.source|escape:'htmlall'}</td> <td>{$row.source|escape:'htmlall'}</td>

View file

@ -136,7 +136,9 @@ else if ($action == "insert") {
$email, $email,
"Gift Registry account created", "Gift Registry account created",
"Your Gift Registry account was created.\r\n" . "Your Gift Registry account was created.\r\n" .
"Your username is $username and your password is $pwd.", "Your username is $username and your password is '$pwd'.\r\n" .
"Log in to https://wishlist.erdelynet.com/ and change your password under\r\n" .
"Update Profile as soon as possible.",
"From: {$opt["email_from"]}\r\nReply-To: {$opt["email_reply_to"]}\r\nX-Mailer: {$opt["email_xmailer"]}\r\n" "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 $email"); ) or die("Mail not accepted for $email");
header("Location: " . getFullPath("users.php?message=User+added+and+e-mail+sent.")); header("Location: " . getFullPath("users.php?message=User+added+and+e-mail+sent."));
@ -178,7 +180,9 @@ else if ($action == "reset") {
mail( mail(
$resetemail, $resetemail,
"Gift Registry password reset", "Gift Registry password reset",
"Your Gift Registry password was reset to $pwd.", "Your Gift Registry password was reset to '$pwd'.\r\n" .
"Log in to https://wishlist.erdelynet.com/ and change your password under\r\n" .
"Update Profile as soon as possible.",
"From: {$opt["email_from"]}\r\nReply-To: {$opt["email_reply_to"]}\r\nX-Mailer: {$opt["email_xmailer"]}\r\n" "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 $email"); ) or die("Mail not accepted for $email");
header("Location: " . getFullPath("users.php?message=Password+reset.")); header("Location: " . getFullPath("users.php?message=Password+reset."));