Compare commits
10 Commits
main
...
hosted_mig
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3148cc17d | ||
|
|
c709f0bbf5 | ||
|
|
8faafe7f4e | ||
|
|
4319847665 | ||
|
|
d22a69b510 | ||
|
|
e9028b7558 | ||
|
|
26559f3c59 | ||
|
|
4d24428a19 | ||
|
|
15fc04e690 | ||
|
|
60254860b4 |
@@ -1,25 +1,20 @@
|
|||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
RewriteRule ^$ webroot/ [L]
|
|
||||||
RewriteRule (.*) webroot/$1 [L]
|
RewriteRule ^$ webroot/ [L]
|
||||||
|
|
||||||
|
# Need this prevent a 400 error without trailing /
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule (.*) webroot/$1 [L]
|
||||||
|
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
# Lets deny everyone -- its a clean slate!
|
# Need to make sure directories can't be listed, since the rewrite
|
||||||
order deny,allow
|
# rule excludes rewriting when an actual directory is requested
|
||||||
deny from all
|
Options -Indexes
|
||||||
|
|
||||||
# Now allow local access
|
|
||||||
# Localhost
|
|
||||||
# allow from 127.0.0
|
|
||||||
# Local subnet
|
|
||||||
# allow from 192.168.7
|
|
||||||
|
|
||||||
# Provide a mechanism for user authentication
|
# Provide a mechanism for user authentication
|
||||||
AuthType Digest
|
AuthType Basic
|
||||||
AuthName "Property Manager"
|
AuthName "Valley Storage"
|
||||||
AuthUserFile "D:/Website/auth/pmgr.htpasswd"
|
AuthUserFile "/home/perki2/valley_storage.pmgr.htpasswd"
|
||||||
Require valid-user
|
Require valid-user
|
||||||
|
|
||||||
# Instead of satisfy all (too restrictive)
|
|
||||||
# This allows EITHER local domain OR authenticated user
|
|
||||||
satisfy any
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
class AppController extends Controller {
|
class AppController extends Controller {
|
||||||
var $uses = array('Option', 'Permission');
|
var $uses = array('Option', 'Permission');
|
||||||
var $helpers = array('Html', 'Form', 'Javascript', 'Format', 'Time', 'Grid');
|
var $helpers = array('Html', 'Form', 'Javascript', 'Format', 'Time', 'Grid');
|
||||||
var $components = array('DebugKit.Toolbar');
|
//var $components = array('DebugKit.Toolbar');
|
||||||
|
|
||||||
var $sidemenu = array('areas' => array('SITE' => false, 'REPORT' => false, 'CONTROLLER' => false, 'ACTION' => false, 'SANDBOX' => false));
|
var $sidemenu = array('areas' => array('SITE' => false, 'REPORT' => false, 'CONTROLLER' => false, 'ACTION' => false, 'SANDBOX' => false));
|
||||||
var $std_area = 10;
|
var $std_area = 10;
|
||||||
@@ -464,7 +464,8 @@ class AppController extends Controller {
|
|||||||
App::import('Helper', 'Html');
|
App::import('Helper', 'Html');
|
||||||
$url = HtmlHelper::url($url, true);
|
$url = HtmlHelper::url($url, true);
|
||||||
|
|
||||||
if (headers_sent()) {
|
if (headers_sent() ||
|
||||||
|
($this->dev() && $this->Option->enabled('dev'))) {
|
||||||
// If we've already sent the headers, it's because
|
// If we've already sent the headers, it's because
|
||||||
// we're debugging, and our debug output has gotten
|
// we're debugging, and our debug output has gotten
|
||||||
// out before the redirect. That's probably a good
|
// out before the redirect. That's probably a good
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
@echo off
|
|
||||||
mysqldump --user=pmgr --password=pmgruser --opt property_manager > H:\pmgr_dev.sql
|
|
||||||
mysql --user=pmgr --password=pmgruser --database=pmgr_dev < H:\pmgr_dev.sql
|
|
||||||
del H:\pmgr_dev.sql
|
|
||||||
echo Build Complete!
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
@echo off
|
|
||||||
mysqldump --user=pmgr --password=pmgruser --opt property_manager > H:\pmgr_sand.sql
|
|
||||||
mysql --user=pmgr --password=pmgruser --database=pmgr_sand < H:\pmgr_sand.sql
|
|
||||||
del H:\pmgr_sand.sql
|
|
||||||
echo Build Complete!
|
|
||||||
@@ -5,17 +5,17 @@ class DATABASE_CONFIG {
|
|||||||
'driver' => 'mysql',
|
'driver' => 'mysql',
|
||||||
'persistent' => false,
|
'persistent' => false,
|
||||||
'host' => 'localhost',
|
'host' => 'localhost',
|
||||||
'login' => 'pmgr',
|
'login' => 'perki2_pmgruser',
|
||||||
'password' => 'pmgruser',
|
'password' => 'pmgrauth',
|
||||||
'database' => 'property_manager',
|
'database' => 'perki2_pmgr',
|
||||||
'prefix' => 'pmgr_',
|
'prefix' => '',
|
||||||
);
|
);
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
if (devbox())
|
if (devbox())
|
||||||
$this->default['database'] = 'pmgr_dev';
|
$this->default['database'] = 'perki2_pmgr_dev';
|
||||||
if (sandbox())
|
if (sandbox())
|
||||||
$this->default['database'] = 'pmgr_sand';
|
$this->default['database'] = 'perki2_pmgr_sand';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -297,7 +297,7 @@ class StatementEntriesController extends AppController {
|
|||||||
'conditions' => array('LedgerEntry.account_id' => $this->StatementEntry->Account->securityDepositAccountID(),
|
'conditions' => array('LedgerEntry.account_id' => $this->StatementEntry->Account->securityDepositAccountID(),
|
||||||
"effective_date >= $datefrom",
|
"effective_date >= $datefrom",
|
||||||
"effective_date <= $dateto",
|
"effective_date <= $dateto",
|
||||||
'StatementEntry.id = (SELECT MIN(id) FROM pmgr_statement_entries WHERE transaction_id = `Transaction`.id)'
|
'StatementEntry.id = (SELECT MIN(id) FROM statement_entries WHERE transaction_id = `Transaction`.id)'
|
||||||
),
|
),
|
||||||
'group' => array('YEAR(effective_date)', 'MONTH(effective_date)', 'Account.id'),
|
'group' => array('YEAR(effective_date)', 'MONTH(effective_date)', 'Account.id'),
|
||||||
'order' => array('YEAR(effective_date) DESC', 'MONTH(effective_date) DESC', 'Account.type', 'Account.name'),
|
'order' => array('YEAR(effective_date) DESC', 'MONTH(effective_date) DESC', 'Account.type', 'Account.name'),
|
||||||
|
|||||||
@@ -503,8 +503,8 @@ class TransactionsController extends AppController {
|
|||||||
foreach ($deposit['types'] AS $type)
|
foreach ($deposit['types'] AS $type)
|
||||||
$deposit_total += $type['total'];
|
$deposit_total += $type['total'];
|
||||||
|
|
||||||
if ($deposit['Transaction']['amount'] != $deposit_total)
|
if (abs($deposit['Transaction']['amount'] - $deposit_total) >= .001)
|
||||||
$this->INTERNAL_ERROR("Deposit items do not add up to deposit slip total");
|
$this->INTERNAL_ERROR("Deposit items ($deposit_total) do not add up to deposit slip total (".$deposit['Transaction']['amount'].")");
|
||||||
|
|
||||||
$this->addSideMenuLink('View',
|
$this->addSideMenuLink('View',
|
||||||
array('action' => 'view', $id), null,
|
array('action' => 'view', $id), null,
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ class UnitSizesController extends AppController {
|
|||||||
$fields[] = 'SUM(IF(' . $this->UnitSize->Unit->conditionUnavailable() . ', 1, 0)) AS unavailable';
|
$fields[] = 'SUM(IF(' . $this->UnitSize->Unit->conditionUnavailable() . ', 1, 0)) AS unavailable';
|
||||||
$fields[] = 'SUM(IF(' . $this->UnitSize->Unit->conditionAvailable() . ', 1, 0)) AS available';
|
$fields[] = 'SUM(IF(' . $this->UnitSize->Unit->conditionAvailable() . ', 1, 0)) AS available';
|
||||||
$fields[] = 'SUM(IF(' . $this->UnitSize->Unit->conditionOccupied() . ', 1, 0)) AS occupied';
|
$fields[] = 'SUM(IF(' . $this->UnitSize->Unit->conditionOccupied() . ', 1, 0)) AS occupied';
|
||||||
$fields[] = 'SUM(IF(' . $this->UnitSize->Unit->conditionOccupied() . ', 0, 1)) / COUNT(unit.id) AS vacancy';
|
$fields[] = 'SUM(IF(' . $this->UnitSize->Unit->conditionOccupied() . ', 0, 1)) / COUNT(Unit.id) AS vacancy';
|
||||||
$fields[] = 'SUM(IF(' . $this->UnitSize->Unit->conditionOccupied() . ', 1, 0)) / COUNT(unit.id) AS occupancy';
|
$fields[] = 'SUM(IF(' . $this->UnitSize->Unit->conditionOccupied() . ', 1, 0)) / COUNT(Unit.id) AS occupancy';
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,31 +4,6 @@ class UtilController extends AppController {
|
|||||||
|
|
||||||
var $uses = array();
|
var $uses = array();
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
**************************************************************************
|
|
||||||
**************************************************************************
|
|
||||||
* function: reset_data
|
|
||||||
* - Development function. TO BE DELETED
|
|
||||||
*/
|
|
||||||
|
|
||||||
function reset_data() {
|
|
||||||
$this->layout = null;
|
|
||||||
$this->autoLayout = false;
|
|
||||||
$this->autoRender = false;
|
|
||||||
Configure::write('debug', '0');
|
|
||||||
$script = $_SERVER['DOCUMENT_ROOT'] . '/pmgr/build.cmd';
|
|
||||||
echo "<P>" . date('r') . "\n";
|
|
||||||
//echo "<P>Script: $script" . "\n";
|
|
||||||
$handle = popen($script . ' 2>&1', 'r');
|
|
||||||
//echo "<P>Handle: $handle; " . gettype($handle) . "\n";
|
|
||||||
echo "<P><PRE>\n";
|
|
||||||
while (($read = fread($handle, 2096))) {
|
|
||||||
echo $read;
|
|
||||||
}
|
|
||||||
echo "</PRE>\n";
|
|
||||||
pclose($handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
@@ -40,21 +15,20 @@ class UtilController extends AppController {
|
|||||||
$this->autoLayout = false;
|
$this->autoLayout = false;
|
||||||
$this->autoRender = false;
|
$this->autoRender = false;
|
||||||
Configure::write('debug', '0');
|
Configure::write('debug', '0');
|
||||||
$script = preg_replace('%/webroot/index.php$%',
|
|
||||||
'/build_'.$type.'box.cmd',
|
|
||||||
$_SERVER['SCRIPT_FILENAME']);
|
|
||||||
|
|
||||||
// REVISIT <AP>: 20090828
|
$usrpass = '--user=perki2_pmgruser --password=pmgrauth';
|
||||||
// Just use system call
|
$boxdb = 'perki2_pmgr_' . $type;
|
||||||
$handle = popen($script . ' 2>&1', 'r');
|
|
||||||
|
$handle = popen("mysqldump $usrpass --opt perki2_pmgr" .
|
||||||
|
" | mysql $usrpass --database=$boxdb", 'r');
|
||||||
while (($read = fread($handle, 2096))) {
|
while (($read = fread($handle, 2096))) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
pclose($handle);
|
pclose($handle);
|
||||||
|
|
||||||
$url = $_SERVER['HTTP_REFERER'];
|
$url = $_SERVER['HTTP_REFERER'];
|
||||||
if (empty($url))
|
if (empty($url) || $url == 'undefined')
|
||||||
$url = "/";
|
$url = "/$type";
|
||||||
|
|
||||||
$this->redirect($url);
|
$this->redirect($url);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class Contact extends AppModel {
|
|||||||
|
|
||||||
// If the user has entered all new data, we need to
|
// If the user has entered all new data, we need to
|
||||||
// save that as a brand new entry.
|
// save that as a brand new entry.
|
||||||
if (!isset($item['id'])) {
|
if (!isset($item['id']) || $item['source'] == 'new') {
|
||||||
$I = new $class();
|
$I = new $class();
|
||||||
$I->create();
|
$I->create();
|
||||||
if (!$I->save($item, false)) {
|
if (!$I->save($item, false)) {
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class ToolbarComponent extends Object {
|
|||||||
trigger_error(sprintf(__('Could not load DebugToolbar panel %s', true), $panel), E_USER_WARNING);
|
trigger_error(sprintf(__('Could not load DebugToolbar panel %s', true), $panel), E_USER_WARNING);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$panelObj =& new $className();
|
$panelObj = new $className();
|
||||||
if (is_subclass_of($panelObj, 'DebugPanel') || is_subclass_of($panelObj, 'debugpanel')) {
|
if (is_subclass_of($panelObj, 'DebugPanel') || is_subclass_of($panelObj, 'debugpanel')) {
|
||||||
$this->panels[$panel] =& $panelObj;
|
$this->panels[$panel] =& $panelObj;
|
||||||
}
|
}
|
||||||
@@ -456,7 +456,7 @@ class LogPanel extends DebugPanel {
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function _parseFile($filename) {
|
function _parseFile($filename) {
|
||||||
$file =& new File($filename);
|
$file = new File($filename);
|
||||||
$contents = $file->read();
|
$contents = $file->read();
|
||||||
$timePattern = '/(\d{4}-\d{2}\-\d{2}\s\d{1,2}\:\d{1,2}\:\d{1,2})/';
|
$timePattern = '/(\d{4}-\d{2}\-\d{2}\s\d{1,2}\:\d{1,2}\:\d{1,2})/';
|
||||||
$chunks = preg_split($timePattern, $contents, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
$chunks = preg_split($timePattern, $contents, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ $timers = DebugKitDebugger::getTimers();
|
|||||||
?>
|
?>
|
||||||
<h2><?php __('Timers'); ?></h2>
|
<h2><?php __('Timers'); ?></h2>
|
||||||
<p class="request-time">
|
<p class="request-time">
|
||||||
<?php $totalTime = sprintf(__('%s (seconds)', true), $number->precision(DebugKitDebugger::requestTime(), 6)); ?>
|
<?php $totalTime = sprintf(__('%.6s (seconds)', true), DebugKitDebugger::requestTime()); ?>
|
||||||
<?php echo $toolbar->message(__('Total Request Time:', true), $totalTime)?>
|
<?php echo $toolbar->message(__('Total Request Time:', true), $totalTime)?>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php foreach ($timers as $timerName => $timeInfo):
|
<?php foreach ($timers as $timerName => $timeInfo):
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
$timeInfo['message'],
|
$timeInfo['message'],
|
||||||
$number->precision($timeInfo['time'], 6)
|
sprintf(__('%.6s', true), $timeInfo['time'])
|
||||||
);
|
);
|
||||||
$headers = array(__('Message', true), __('time in seconds', true));
|
$headers = array(__('Message', true), __('time in seconds', true));
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|||||||
9
site/valley_storage.pmgr.htpasswd
Normal file
9
site/valley_storage.pmgr.htpasswd
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
abijah:Property Manager:a2369e3cc9e231ea6f02ce799a8b9970
|
||||||
|
anja:Property Manager:4539d5a6e58dd5895f2f3891d29705b0
|
||||||
|
kevin:Property Manager:f01accc9f5e5cdfc028dcf0cca837cf1
|
||||||
|
adam:Property Manager:ae6835569bb2fc0a0a4a773580ac8cda
|
||||||
|
shirley:Property Manager:e7e9d674c700796c99cdbf3cf105e739
|
||||||
|
admin:Property Manager:bab2226685d9b4b66220db8df80f1822
|
||||||
|
dev:Property Manager:e5c27b3c025e47239a45daceea2c0a00
|
||||||
|
vasst:Property Manager:523abc6c2b8458b463d5a9baa4f58f2e
|
||||||
|
answerfirst:Property Manager:6ac128447fab8be985c74ba7539c39b3
|
||||||
@@ -68,7 +68,7 @@ function contactMethodDiv($obj, $type, $legend, $values = null) {
|
|||||||
'</DIV>' . "\n" .
|
'</DIV>' . "\n" .
|
||||||
|
|
||||||
// BEGIN method-div
|
// BEGIN method-div
|
||||||
'<div id="'.$type.'-%{id}-method-div"' . "\n" .
|
'<div id="'.$type.'-%{id}-method-div"' . '>' . "\n" .
|
||||||
|
|
||||||
$obj->element
|
$obj->element
|
||||||
('form_table',
|
('form_table',
|
||||||
@@ -131,14 +131,18 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) {
|
|||||||
elseif ($stype === 'new') {
|
elseif ($stype === 'new') {
|
||||||
$fields = array
|
$fields = array
|
||||||
('type' => array('label_attributes' => array('class' => 'required'),
|
('type' => array('label_attributes' => array('class' => 'required'),
|
||||||
'opts' => array('options' => $obj->varstore['phoneTypes']),
|
'opts' => array('autocomplete' => 'off',
|
||||||
|
'options' => $obj->varstore['phoneTypes']),
|
||||||
'after' => "Physical type of the phone."),
|
'after' => "Physical type of the phone."),
|
||||||
'phone' => array('label_attributes' => array('class' => 'required empty'),
|
'phone' => array('label_attributes' => array('class' => 'required empty'),
|
||||||
|
'opts' => array('autocomplete' => 'off'),
|
||||||
'after' => "Required: Phone number."),
|
'after' => "Required: Phone number."),
|
||||||
'ext' => array('name' => "Extension",
|
'ext' => array('name' => "Extension",
|
||||||
'label_attributes' => array('class' => 'optional empty'),
|
'label_attributes' => array('class' => 'optional empty'),
|
||||||
|
'opts' => array('autocomplete' => 'off'),
|
||||||
'after' => "Optional: Extension number."),
|
'after' => "Optional: Extension number."),
|
||||||
'comment' => array('label_attributes' => array('class' => 'optional empty'),
|
'comment' => array('label_attributes' => array('class' => 'optional empty'),
|
||||||
|
'opts' => array('autocomplete' => 'off'),
|
||||||
'after' => "Optional: Comments about this phone number."),
|
'after' => "Optional: Comments about this phone number."),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -167,17 +171,23 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) {
|
|||||||
elseif ($stype === 'new') {
|
elseif ($stype === 'new') {
|
||||||
$fields = array
|
$fields = array
|
||||||
('address' => array('label_attributes' => array('class' => 'required empty'),
|
('address' => array('label_attributes' => array('class' => 'required empty'),
|
||||||
|
'opts' => array('autocomplete' => 'off'),
|
||||||
'after' => "Required: First line of mailing address."),
|
'after' => "Required: First line of mailing address."),
|
||||||
'city' => array('label_attributes' => array('class' => 'required empty'),
|
'city' => array('label_attributes' => array('class' => 'required empty'),
|
||||||
|
'opts' => array('autocomplete' => 'off'),
|
||||||
'after' => "Required."),
|
'after' => "Required."),
|
||||||
'state' => array('label_attributes' => array('class' => 'required empty'),
|
'state' => array('label_attributes' => array('class' => 'required empty'),
|
||||||
|
'opts' => array('autocomplete' => 'off'),
|
||||||
'after' => "Required."),
|
'after' => "Required."),
|
||||||
'postcode' => array('name' => 'Zip Code',
|
'postcode' => array('name' => 'Zip Code',
|
||||||
'label_attributes' => array('class' => 'required empty'),
|
'label_attributes' => array('class' => 'required empty'),
|
||||||
|
'opts' => array('autocomplete' => 'off'),
|
||||||
'after' => "Required."),
|
'after' => "Required."),
|
||||||
'country' => array('label_attributes' => array('class' => 'optional empty'),
|
'country' => array('label_attributes' => array('class' => 'optional empty'),
|
||||||
|
'opts' => array('autocomplete' => 'off'),
|
||||||
'after' => "Optional: USA is presumed."),
|
'after' => "Optional: USA is presumed."),
|
||||||
'comment' => array('label_attributes' => array('class' => 'optional empty'),
|
'comment' => array('label_attributes' => array('class' => 'optional empty'),
|
||||||
|
'opts' => array('autocomplete' => 'off'),
|
||||||
'after' => "Optional: Comments about this mailing address."),
|
'after' => "Optional: Comments about this mailing address."),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -208,8 +218,10 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) {
|
|||||||
elseif ($stype === 'new') {
|
elseif ($stype === 'new') {
|
||||||
$fields = array
|
$fields = array
|
||||||
('email' => array('label_attributes' => array('class' => 'required empty'),
|
('email' => array('label_attributes' => array('class' => 'required empty'),
|
||||||
'after' => "Required: E-mail address."),
|
'opts' => array('autocomplete' => 'off'),
|
||||||
|
'after' => "Required: E-mail address."),
|
||||||
'comment' => array('label_attributes' => array('class' => 'optional empty'),
|
'comment' => array('label_attributes' => array('class' => 'optional empty'),
|
||||||
|
'opts' => array('autocomplete' => 'off'),
|
||||||
'after' => "Optional: Comments about this email address."),
|
'after' => "Optional: Comments about this email address."),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
||||||
define('CAKE_CORE_INCLUDE_PATH', 'D:\Website\localhost\CakePHP');
|
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . APP_DIR . DS . 'CakePHP');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user