[TEP-COMMIT] [CVS catalog] the new account password page based on a CSS layout, and a new account
hpdl-OfajU3CKLf1/[email protected] 29 Mar 2005 23:34:12 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>catalog/catalog/includes</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt>content/pages/<a href="#file1"><span id="added">account_password.php</span></a></tt></td><td align="right" id="added">+64</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages/account_password.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr class="alt"><td><tt>modules/account/<a href="#file2"><span id="added">password.php</span></a></tt></td><td align="right" id="added">+83</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/account/password.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr><td></td><td align="right" id="added">+147</td><td></td><td></td></tr>
</table>
<small id="info">2 added files</small><br />
<pre class="comment">
the new account password page based on a CSS layout, and a new account
password module to handle the related processing logic
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname" id="added"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content">content</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages">pages</a><br /></span>
<div class="fileheader" id="added"><big><b>account_password.php</b></big> <small id="info">added at <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages/account_password.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N account_password.php
--- /dev/null Wed Mar 30 01:33:50 2005
+++ /tmp/cvsAAAnWaqcz Wed Mar 30 01:34:10 2005
@@ -0,0 +1,64 @@
</small></pre><pre class="diff" id="added">+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2005 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ require('includes/form_check.js.php');
+?>
+
+<form name="account_password" action="<?php echo tep_href_link(FILENAME_ACCOUNT, 'password=save', 'SSL'); ?>" method="post" onSubmit="return check_form(account_password);">
+
+<div class="pageHeading">
+ <span class="pageHeadingImage"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE_ACCOUNT_PASSWORD, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></span>
+
+ <h1><?php echo HEADING_TITLE_ACCOUNT_PASSWORD; ?></h1>
+</div>
+
+<?php
+ if ($messageStack->size('account_password') > 0) {
+ echo $messageStack->output('account_password');
+ }
+?>
+
+<div class="moduleBox">
+ <div class="outsideHeading">
+ <span class="inputRequirement" style="float: right;"><?php echo FORM_REQUIRED_INFORMATION; ?></span>
+
+ <?php echo MY_PASSWORD_TITLE; ?>
+ </div>
+
+ <div class="content">
+ <table border="0" cellspacing="2" cellpadding="2">
+ <tr>
+ <td><?php echo ENTRY_PASSWORD_CURRENT; ?></td>
+ <td><?php echo osc_draw_password_field('password_current', '', true); ?></td>
+ </tr>
+ <tr>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td><?php echo ENTRY_PASSWORD_NEW; ?></td>
+ <td><?php echo osc_draw_password_field('password_new', '', true); ?></td>
+ </tr>
+ <tr>
+ <td><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
+ <td><?php echo osc_draw_password_field('password_confirmation', '', true); ?></td>
+ </tr>
+ </table>
+ </div>
+</div>
+
+<div class="submitFormButtons">
+ <span style="float: right;"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></span>
+
+ <?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?>
+</div>
+
+</form>
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname" id="added"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules">modules</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/account">account</a><br /></span>
<div class="fileheader" id="added"><big><b>password.php</b></big> <small id="info">added at <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/account/password.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N password.php
--- /dev/null Wed Mar 30 01:33:50 2005
+++ /tmp/cvsAAAJ4aOdz Wed Mar 30 01:34:11 2005
@@ -0,0 +1,83 @@
</small></pre><pre class="diff" id="added">+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2005 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ class osC_Account_Password {
+
+/* Public variables */
+
+ var $page_contents = 'account_password.php';
+
+/* Private variables */
+
+ var $_module = 'password';
+
+/* Class constructor */
+
+ function osC_Account_Password() {
+ global $osC_Services, $breadcrumb;
+
+ if ($osC_Services->isStarted('breadcrumb')) {
+ $breadcrumb->add(NAVBAR_TITLE_EDIT_PASSWORD, tep_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
+ }
+
+ if ($_GET[$this->_module] == 'save') {
+ $this->_process();
+ }
+ }
+
+/* Public methods */
+
+ function getPageContentsFile() {
+ return $this->page_contents;
+ }
+
+/* Private methods */
+
+ function _process() {
+ global $messageStack, $osC_Database, $osC_Customer;
+
+ if (!isset($_POST['password_current']) || (strlen(trim($_POST['password_current'])) < ACCOUNT_PASSWORD)) {
+ $messageStack->add('account_password', ENTRY_PASSWORD_CURRENT_ERROR);
+ } elseif (!isset($_POST['password_new']) || (strlen(trim($_POST['password_new'])) < ACCOUNT_PASSWORD)) {
+ $messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
+ } elseif (!isset($_POST['password_confirmation']) || (trim($_POST['password_new']) != trim($_POST['password_confirmation']))) {
+ $messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
+ }
+
+ if ($messageStack->size('account_password') === 0) {
+ $Qcheck = $osC_Database->query('select customers_password from :table_customers where customers_id = :customers_id');
+ $Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
+ $Qcheck->bindInt(':customers_id', $osC_Customer->id);
+ $Qcheck->execute();
+
+ if (tep_validate_password(trim($_POST['password_current']), $Qcheck->value('customers_password'))) {
+ $Qupdate = $osC_Database->query('update :table_customers set customers_password = :customers_password where customers_id = :customers_id');
+ $Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS);
+ $Qupdate->bindValue(':customers_password', tep_encrypt_password(trim($_POST['password_new'])));
+ $Qupdate->bindInt(':customers_id', $osC_Customer->id);
+ $Qupdate->execute();
+
+ $Qupdate = $osC_Database->query('update :table_customers_info set customers_info_date_account_last_modified = now() where customers_info_id = :customers_info_id');
+ $Qupdate->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
+ $Qupdate->bindInt(':customers_info_id', $osC_Customer->id);
+ $Qupdate->execute();
+
+ $messageStack->add_session('account', SUCCESS_PASSWORD_UPDATED, 'success');
+
+ tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+ } else {
+ $messageStack->add('account_password', ERROR_CURRENT_PASSWORD_NOT_MATCHING);
+ }
+ }
+ }
+ }
+?>
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.9</small></center>
</body></html>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click