I think the person who wrote this messed with the sample code... I was able to get a fresh install of qcodo to work - the problem I'm now running into is still baffling me - and I think it may be connected to the whole transition from IIS to linux...
I have a form and template that gets stuck on an Ajax issue the generated code that gets to the browser is:
<html>
2<head>
3<title>Government Pricing Client Selection</title>
4<link rel=“stylesheet” type=“text/css” href=“css/styles.css” />
5</head>
6<body>
7<div class=“ContentPanel”>
8<div class=“CenteredPanel”>
9<table width=“100%” height=“96%” cellspacing=“0” cellpadding=“0”
10 border=“0”>
11 <tr valign=“middle”>
12 <td width=“100%” height=“100%” align=“center”>
13
14 <div id=“clientselbox” class=“centered”>
15 <table width=“100%” border=“0” cellspacing=“0” cellpadding=“0”>
16 <tr>
17 <td style=“background-color: #c41130”><form method=“post” id=“ClientSelection” action=“/client_sel.php”>
18<script type=“text/javascript” src=“/assets/js/_core/qcodo.js”></script>
19<script type=“text/javascript” src=“/assets/js/_core/logger.js”></script>
20<script type=“text/javascript” src=“/assets/js/_core/event.js”></script>
21<script type=“text/javascript” src=“/assets/js/_core/post.js”></script>
22<script type=“text/javascript” src=“/assets/js/_core/control.js”></script>
23<script type=“text/javascript” src=“/assets/js/_core/listbox.js”></script>
24<script type=“text/javascript”>document.getElementById('c3').focus(); </script>
The template just stops getting spit out at this point (above). The form code that seems to be getting stuck is as follows:
<?php
require_once('includes/prepend.inc.php');
require('includes/nocache.inc.php');
class LoginForm extends QForm {
protected $txtUsername;
protected $txtPassword;
protected $lblMessage;
protected $btnLogin;
protected function Form_Create() {
$this->txtUsername = new QTextBox($this);
$this->txtUsername->Name = 'username';
$this->txtUsername->CausesValidation = true;
$this->txtUsername->Required = true;
$this->txtUsername->Columns = 37;
$this->txtPassword = new QTextBox($this);
$this->txtPassword->CausesValidation = true;
$this->txtPassword->Required = true;
$this->txtPassword->Name = 'password';
$this->txtPassword->TextMode = QTextMode::Password;
$this->txtPassword->Columns = 37;
$this->lblMessage = new QLabel($this);
$this->lblMessage->Text = ““;
$this->lblMessage->CausesValidation = true;
$this->lblMessage->HtmlEntities = false;
$this->btnLogin = new QButton($this);
$this->btnLogin->CausesValidation = true;
$this->btnLogin->Text = QApplication::Translate('Login');
$this->btnLogin->AddAction(new QClickEvent(), new QAjaxAction('btnLogin_Click'));
$this->btnLogin->PrimaryButton = true;
QApplication::ExecuteJavaScript(sprintf(“document.getElementById('%s').focus()”,
$this->txtUsername->ControlId) );
if (isset($_SESSION['User'])) {
$this->lblMessage->Text = “You have been logged out successfully.”;
}
unset($_SESSION['SelectedClient']);
unset($_SESSION['User']);
}
protected function Form_Load() {
$this->lblMessage->Text = ““;
}
protected function btnLogin_Click($strFormId, $strControlId, $strParameter) {
$this->lblMessage->Text = ““;
$objUser = User::LoadByUserName($this->txtUsername->Text);
if ($objUser && $objUser->IsLocked) {
$this->lblMessage->HtmlEntities = false;
$this->lblMessage->Text = “Your account has been locked.<br>Please contact the system administrator for assistance.”;
return;
}
if (!$objUser || $objUser->Password != sha1($this->txtPassword->Text)) {
$this->txtPassword->Text = ““;
try{
if ($objUser) {
$objUser->FailedAttempts += 1;
if ($objUser->FailedAttempts < 3) {
try{
$objUser->Save();
}
catch (QCallerException $objExc) {
$objExc->IncrementOffset();
QApplication::DisplayAlert($objExc->getMessage());
}
$this->lblMessage->Text = “Unknown user or password”;
}
else {
if (!$objUser->IsLocked) {
$objUser->IsLocked = true;
try{
$objUser->Save();
}
catch (QCallerException $objExc) {
$objExc->IncrementOffset();
QApplication::DisplayAlert($objExc->getMessage());
}
$this->lblMessage->Text = “Your account has been locked. Please contact the system administrator for assistance.”;
}
}
}
else {
$this->lblMessage->Text = 'Unknown user or password';
}
}
catch (QCallerException $objExc) {
$objExc->IncrementOffset();
QApplication::DisplayAlert($objExc->getMessage());
}
return;
}
$objUser->FailedAttempts = 0;
try{
$objUser->Save();
}
catch (QCallerException $objExc) {
$objExc->IncrementOffset();
QApplication::DisplayAlert($objExc->getMessage());
}
$_SESSION['User'] = serialize($objUser);
if ($objUser->IsAdmin) {
QApplication::Redirect(_VIRTUAL_DIRECTORY_ . '/client_list.php');
}
else {
QApplication::Redirect(_VIRTUAL_DIRECTORY_ . '/client_sel.php');
}
}
}
LoginForm::Run('LoginForm', 'login.tpl.php');
?>
Sorry to post so much code - but I figured it might help...
Please advise...
-DM
Thanks