[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&amp;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&amp;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&amp;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">+&lt;?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');
+?&gt;
+
+&lt;form name="account_password" action="&lt;?php echo tep_href_link(FILENAME_ACCOUNT, 'password=save', 'SSL'); ?&gt;" method="post" onSubmit="return check_form(account_password);"&gt;
+
+&lt;div class="pageHeading"&gt;
+  &lt;span class="pageHeadingImage"&gt;&lt;?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE_ACCOUNT_PASSWORD, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?&gt;&lt;/span&gt;
+
+  &lt;h1&gt;&lt;?php echo HEADING_TITLE_ACCOUNT_PASSWORD; ?&gt;&lt;/h1&gt;
+&lt;/div&gt;
+
+&lt;?php
+  if ($messageStack-&gt;size('account_password') &gt; 0) {
+    echo $messageStack-&gt;output('account_password');
+  }
+?&gt;
+
+&lt;div class="moduleBox"&gt;
+  &lt;div class="outsideHeading"&gt;
+    &lt;span class="inputRequirement" style="float: right;"&gt;&lt;?php echo FORM_REQUIRED_INFORMATION; ?&gt;&lt;/span&gt;
+
+    &lt;?php echo MY_PASSWORD_TITLE; ?&gt;
+  &lt;/div&gt;
+
+  &lt;div class="content"&gt;
+    &lt;table border="0" cellspacing="2" cellpadding="2"&gt;
+      &lt;tr&gt;
+        &lt;td&gt;&lt;?php echo ENTRY_PASSWORD_CURRENT; ?&gt;&lt;/td&gt;
+        &lt;td&gt;&lt;?php echo osc_draw_password_field('password_current', '', true); ?&gt;&lt;/td&gt;
+      &lt;/tr&gt;
+      &lt;tr&gt;
+        &lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt;
+      &lt;/tr&gt;
+      &lt;tr&gt;
+        &lt;td&gt;&lt;?php echo ENTRY_PASSWORD_NEW; ?&gt;&lt;/td&gt;
+        &lt;td&gt;&lt;?php echo osc_draw_password_field('password_new', '', true); ?&gt;&lt;/td&gt;
+      &lt;/tr&gt;
+      &lt;tr&gt;
+        &lt;td&gt;&lt;?php echo ENTRY_PASSWORD_CONFIRMATION; ?&gt;&lt;/td&gt;
+        &lt;td&gt;&lt;?php echo osc_draw_password_field('password_confirmation', '', true); ?&gt;&lt;/td&gt;
+      &lt;/tr&gt;
+    &lt;/table&gt;
+  &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class="submitFormButtons"&gt;
+  &lt;span style="float: right;"&gt;&lt;?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?&gt;&lt;/span&gt;
+
+  &lt;?php echo '&lt;a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '"&gt;' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '&lt;/a&gt;'; ?&gt;
+&lt;/div&gt;
+
+&lt;/form&gt;
</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&amp;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">+&lt;?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-&gt;isStarted('breadcrumb')) {
+        $breadcrumb-&gt;add(NAVBAR_TITLE_EDIT_PASSWORD, tep_href_link(FILENAME_ACCOUNT, $this-&gt;_module, 'SSL'));
+      }
+
+      if ($_GET[$this-&gt;_module] == 'save') {
+        $this-&gt;_process();
+      }
+    }
+
+/* Public methods */
+
+    function getPageContentsFile() {
+      return $this-&gt;page_contents;
+    }
+
+/* Private methods */
+
+    function _process() {
+      global $messageStack, $osC_Database, $osC_Customer;
+
+      if (!isset($_POST['password_current']) || (strlen(trim($_POST['password_current'])) &lt; ACCOUNT_PASSWORD)) {
+        $messageStack-&gt;add('account_password', ENTRY_PASSWORD_CURRENT_ERROR);
+      } elseif (!isset($_POST['password_new']) || (strlen(trim($_POST['password_new'])) &lt; ACCOUNT_PASSWORD)) {
+        $messageStack-&gt;add('account_password', ENTRY_PASSWORD_NEW_ERROR);
+      } elseif (!isset($_POST['password_confirmation']) || (trim($_POST['password_new']) != trim($_POST['password_confirmation']))) {
+        $messageStack-&gt;add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
+      }
+
+      if ($messageStack-&gt;size('account_password') === 0) {
+        $Qcheck = $osC_Database-&gt;query('select customers_password from :table_customers where customers_id = :customers_id');
+        $Qcheck-&gt;bindTable(':table_customers', TABLE_CUSTOMERS);
+        $Qcheck-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+        $Qcheck-&gt;execute();
+
+        if (tep_validate_password(trim($_POST['password_current']), $Qcheck-&gt;value('customers_password'))) {
+          $Qupdate = $osC_Database-&gt;query('update :table_customers set customers_password = :customers_password where customers_id = :customers_id');
+          $Qupdate-&gt;bindTable(':table_customers', TABLE_CUSTOMERS);
+          $Qupdate-&gt;bindValue(':customers_password', tep_encrypt_password(trim($_POST['password_new'])));
+          $Qupdate-&gt;bindInt(':customers_id', $osC_Customer-&gt;id);
+          $Qupdate-&gt;execute();
+
+          $Qupdate = $osC_Database-&gt;query('update :table_customers_info set customers_info_date_account_last_modified = now() where customers_info_id = :customers_info_id');
+          $Qupdate-&gt;bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
+          $Qupdate-&gt;bindInt(':customers_info_id', $osC_Customer-&gt;id);
+          $Qupdate-&gt;execute();
+
+          $messageStack-&gt;add_session('account', SUCCESS_PASSWORD_UPDATED, 'success');
+
+          tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+        } else {
+          $messageStack-&gt;add('account_password', ERROR_CURRENT_PASSWORD_NOT_MATCHING);
+        }
+      }
+    }
+  }
+?&gt;
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -&gt; 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