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>
|
||||
RewriteEngine on
|
||||
|
||||
RewriteRule ^$ webroot/ [L]
|
||||
|
||||
# Need this prevent a 400 error without trailing /
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule (.*) webroot/$1 [L]
|
||||
|
||||
</IfModule>
|
||||
|
||||
# Lets deny everyone -- its a clean slate!
|
||||
order deny,allow
|
||||
deny from all
|
||||
|
||||
# Now allow local access
|
||||
# Localhost
|
||||
# allow from 127.0.0
|
||||
# Local subnet
|
||||
# allow from 192.168.7
|
||||
# Need to make sure directories can't be listed, since the rewrite
|
||||
# rule excludes rewriting when an actual directory is requested
|
||||
Options -Indexes
|
||||
|
||||
# Provide a mechanism for user authentication
|
||||
AuthType Digest
|
||||
AuthName "Property Manager"
|
||||
AuthUserFile "D:/Website/auth/pmgr.htpasswd"
|
||||
AuthType Basic
|
||||
AuthName "Valley Storage"
|
||||
AuthUserFile "/home/perki2/valley_storage.pmgr.htpasswd"
|
||||
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 {
|
||||
var $uses = array('Option', 'Permission');
|
||||
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 $std_area = 10;
|
||||
@@ -464,7 +464,8 @@ class AppController extends Controller {
|
||||
App::import('Helper', 'Html');
|
||||
$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
|
||||
// we're debugging, and our debug output has gotten
|
||||
// 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',
|
||||
'persistent' => false,
|
||||
'host' => 'localhost',
|
||||
'login' => 'pmgr',
|
||||
'password' => 'pmgruser',
|
||||
'database' => 'property_manager',
|
||||
'prefix' => 'pmgr_',
|
||||
'login' => 'perki2_pmgruser',
|
||||
'password' => 'pmgrauth',
|
||||
'database' => 'perki2_pmgr',
|
||||
'prefix' => '',
|
||||
);
|
||||
|
||||
function __construct() {
|
||||
if (devbox())
|
||||
$this->default['database'] = 'pmgr_dev';
|
||||
$this->default['database'] = 'perki2_pmgr_dev';
|
||||
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(),
|
||||
"effective_date >= $datefrom",
|
||||
"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'),
|
||||
'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)
|
||||
$deposit_total += $type['total'];
|
||||
|
||||
if ($deposit['Transaction']['amount'] != $deposit_total)
|
||||
$this->INTERNAL_ERROR("Deposit items do not add up to deposit slip total");
|
||||
if (abs($deposit['Transaction']['amount'] - $deposit_total) >= .001)
|
||||
$this->INTERNAL_ERROR("Deposit items ($deposit_total) do not add up to deposit slip total (".$deposit['Transaction']['amount'].")");
|
||||
|
||||
$this->addSideMenuLink('View',
|
||||
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->conditionAvailable() . ', 1, 0)) AS available';
|
||||
$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() . ', 1, 0)) / COUNT(unit.id) AS occupancy';
|
||||
$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';
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
@@ -4,31 +4,6 @@ class UtilController extends AppController {
|
||||
|
||||
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->autoRender = false;
|
||||
Configure::write('debug', '0');
|
||||
$script = preg_replace('%/webroot/index.php$%',
|
||||
'/build_'.$type.'box.cmd',
|
||||
$_SERVER['SCRIPT_FILENAME']);
|
||||
|
||||
// REVISIT <AP>: 20090828
|
||||
// Just use system call
|
||||
$handle = popen($script . ' 2>&1', 'r');
|
||||
$usrpass = '--user=perki2_pmgruser --password=pmgrauth';
|
||||
$boxdb = 'perki2_pmgr_' . $type;
|
||||
|
||||
$handle = popen("mysqldump $usrpass --opt perki2_pmgr" .
|
||||
" | mysql $usrpass --database=$boxdb", 'r');
|
||||
while (($read = fread($handle, 2096))) {
|
||||
// Do nothing
|
||||
}
|
||||
pclose($handle);
|
||||
|
||||
$url = $_SERVER['HTTP_REFERER'];
|
||||
if (empty($url))
|
||||
$url = "/";
|
||||
if (empty($url) || $url == 'undefined')
|
||||
$url = "/$type";
|
||||
|
||||
$this->redirect($url);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class Contact extends AppModel {
|
||||
|
||||
// If the user has entered all new data, we need to
|
||||
// save that as a brand new entry.
|
||||
if (!isset($item['id'])) {
|
||||
if (!isset($item['id']) || $item['source'] == 'new') {
|
||||
$I = new $class();
|
||||
$I->create();
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
$panelObj =& new $className();
|
||||
$panelObj = new $className();
|
||||
if (is_subclass_of($panelObj, 'DebugPanel') || is_subclass_of($panelObj, 'debugpanel')) {
|
||||
$this->panels[$panel] =& $panelObj;
|
||||
}
|
||||
@@ -456,7 +456,7 @@ class LogPanel extends DebugPanel {
|
||||
* @return array
|
||||
*/
|
||||
function _parseFile($filename) {
|
||||
$file =& new File($filename);
|
||||
$file = new File($filename);
|
||||
$contents = $file->read();
|
||||
$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);
|
||||
|
||||
@@ -30,14 +30,14 @@ $timers = DebugKitDebugger::getTimers();
|
||||
?>
|
||||
<h2><?php __('Timers'); ?></h2>
|
||||
<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)?>
|
||||
</p>
|
||||
|
||||
<?php foreach ($timers as $timerName => $timeInfo):
|
||||
$rows[] = array(
|
||||
$timeInfo['message'],
|
||||
$number->precision($timeInfo['time'], 6)
|
||||
sprintf(__('%.6s', true), $timeInfo['time'])
|
||||
);
|
||||
$headers = array(__('Message', true), __('time in seconds', true));
|
||||
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" .
|
||||
|
||||
// BEGIN method-div
|
||||
'<div id="'.$type.'-%{id}-method-div"' . "\n" .
|
||||
'<div id="'.$type.'-%{id}-method-div"' . '>' . "\n" .
|
||||
|
||||
$obj->element
|
||||
('form_table',
|
||||
@@ -131,14 +131,18 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) {
|
||||
elseif ($stype === 'new') {
|
||||
$fields = array
|
||||
('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."),
|
||||
'phone' => array('label_attributes' => array('class' => 'required empty'),
|
||||
'opts' => array('autocomplete' => 'off'),
|
||||
'after' => "Required: Phone number."),
|
||||
'ext' => array('name' => "Extension",
|
||||
'label_attributes' => array('class' => 'optional empty'),
|
||||
'opts' => array('autocomplete' => 'off'),
|
||||
'after' => "Optional: Extension number."),
|
||||
'comment' => array('label_attributes' => array('class' => 'optional empty'),
|
||||
'opts' => array('autocomplete' => 'off'),
|
||||
'after' => "Optional: Comments about this phone number."),
|
||||
);
|
||||
}
|
||||
@@ -167,17 +171,23 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) {
|
||||
elseif ($stype === 'new') {
|
||||
$fields = array
|
||||
('address' => array('label_attributes' => array('class' => 'required empty'),
|
||||
'opts' => array('autocomplete' => 'off'),
|
||||
'after' => "Required: First line of mailing address."),
|
||||
'city' => array('label_attributes' => array('class' => 'required empty'),
|
||||
'opts' => array('autocomplete' => 'off'),
|
||||
'after' => "Required."),
|
||||
'state' => array('label_attributes' => array('class' => 'required empty'),
|
||||
'opts' => array('autocomplete' => 'off'),
|
||||
'after' => "Required."),
|
||||
'postcode' => array('name' => 'Zip Code',
|
||||
'label_attributes' => array('class' => 'required empty'),
|
||||
'opts' => array('autocomplete' => 'off'),
|
||||
'after' => "Required."),
|
||||
'country' => array('label_attributes' => array('class' => 'optional empty'),
|
||||
'opts' => array('autocomplete' => 'off'),
|
||||
'after' => "Optional: USA is presumed."),
|
||||
'comment' => array('label_attributes' => array('class' => 'optional empty'),
|
||||
'opts' => array('autocomplete' => 'off'),
|
||||
'after' => "Optional: Comments about this mailing address."),
|
||||
);
|
||||
}
|
||||
@@ -208,8 +218,10 @@ function contactMethodTypeDiv($obj, $type, $stype, $values = null) {
|
||||
elseif ($stype === 'new') {
|
||||
$fields = array
|
||||
('email' => array('label_attributes' => array('class' => 'required empty'),
|
||||
'opts' => array('autocomplete' => 'off'),
|
||||
'after' => "Required: E-mail address."),
|
||||
'comment' => array('label_attributes' => array('class' => 'optional empty'),
|
||||
'opts' => array('autocomplete' => 'off'),
|
||||
'after' => "Optional: Comments about this email address."),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
*
|
||||
*/
|
||||
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