/home/coolpkct/www/websites/cake3.cool.rocks/admin/classes/accountscreen.php
<?php
/**
 * Part of Showkase web site management package
 *
 * @package Showkase
 * @author Jack Hardie {@link http://www.jhardie.com}
 * @copyright Copyright (c) 2013, SimpleViewer Inc.
 */
defined('SK_ACCESS')||die('<h1>403: Forbidden</h1>');
require_once 'classes'.DIRECTORY_SEPARATOR.'screen.php';
require_once 'classes'.DIRECTORY_SEPARATOR.'systembuttonbar.php';
 
/**
 * Account admin screen
 *
 * @package Showkase
 */
class AccountScreen extends Screen
{
   /**
     * Constructor
     *
     * @access public
     * @return void
     * @param string content for html title tag
     * @param string body id
     */
    public function __construct($htmlTitle, $bodyId='', $bodyClass='allpages')
    {
      parent::__construct($htmlTitle, $bodyId, $bodyClass);
      $bb = new SystemButtonbar();
      $this->subNavHtml = $bb->getHtml();
     }
     
    /**
     * Returns screen content
     *
     * @return string
     * @param boolean
     * @param boolean passwords do not match
     * @access public
     */
    function getContentHtml($context)
    {
        $message1 = ($context['okOldPass'])
            ? '&nbsp;'
            : 'Current password is incorrect.';
        $message2 = ($context['match'])
            ? '&nbsp;'
            : 'Passwords do not match.';
        $message2 = ($context['okNewPass'])
            ? $message2
            : 'Password minimum 5 characters';
        $message2 = ($context['okNewUser'])
            ? $message2
            : 'User minimum 1 character';
        $html = <<<EOD
        <form class="form-stacked" action = "index.php?cmd=account" method="post">
          <div class="subhead">
            <div class="hgroup">
              <h2>Change Log-in</h2>
            </div>
            <ul class="buttons">
              <li><button type="button" onclick="window.location='index.php';" class="btn btn-danger">Cancel</button></li>
              <li>
                <input type="hidden" name="token" value="{$context['token']}" >
                <input type="hidden" name="accountsubmitted" value="true" >
                <button type="submit" class="btn btn-success formbutton" >Update</button>
              </li>
            </ul>
          </div>
          <div id="currentpass">
            <p class="error">{$message1}</p>
            <p><label for="password" style="display: block">Confirm current password: </label><input class="text" type="password" name="password" id="password" /></p>
            <div id="instructions" class="prompt">For security, please confirm your current password and enter the new user name and password.</div>
          </div>
          <div id="changepassform">    
            <p class="error">{$message2}</p>
            <p><label for="user" style="display: block">New user name (min 1 character): </label><input class="text" type="text" name="user" id="user" /></p>
            <p><label for="password1" style="display: block">New Password (min 5 characters): </label><input class="text" type="password" name="password1" id="password1" /></p>
            <p><label for="password2" style="display: block">Re-type new Password: </label><input class="text" type="password" name="password2" id="password2" /></p>
          </div>
        </form>
EOD;
        return $html;
    }
}