Updates from lnApp

This commit is contained in:
Deon George
2011-07-14 08:59:32 +10:00
parent 5c9750e957
commit 46c3b9a075
31 changed files with 991 additions and 434 deletions

View File

@@ -246,21 +246,6 @@ class Auth_OSB extends Auth_ORM {
return FALSE;
}
/**
* Override the supplied find_salt() to enable disabling salt keys
*/
public function find_salt($password) {
$salt = '';
foreach ($this->_config['salt_pattern'] as $i => $offset) {
// Find salt characters, take a good long look...
if (is_numeric($offset))
$salt .= substr($password, $offset + $i, 1);
}
return $salt;
}
/**
* Determine if a user is authorised to view an account
*
@@ -280,12 +265,5 @@ class Auth_OSB extends Auth_ORM {
return TRUE;
}
/**
* Disable KO3 hash_password function
*/
public function hash_password($password,$salt = FALSE) {
return md5($password);
}
}
?>

View File

@@ -13,7 +13,7 @@ class Model_Account extends Model_Auth_UserDefault {
protected $_has_many = array(
'user_tokens' => array('model' => 'user_token'),
'group' => array('through' => 'account_group'),
'invoice' => array(),
'invoice' => array('far_key'=>'id'),
'payment'=>array(),
'service' => array(),
);

View File

@@ -17,7 +17,7 @@ class Model_Invoice extends ORMOSB {
'account'=>array()
);
protected $_has_many = array(
'invoice_item'=>array(),
'invoice_item'=>array('far_key'=>'id'),
'invoice_item_tax'=>array(),
'service'=>array('through'=>'invoice_item'),
'payment'=>array('through'=>'payment_item'),

View File

@@ -17,7 +17,7 @@ class Model_Invoice_Item extends ORMOSB {
'service'=>array()
);
protected $_has_many = array(
'invoice_item_tax'=>array()
'invoice_item_tax'=>array('far_key'=>'id')
);
protected $_updated_column = FALSE; // @todo No update columns
@@ -52,7 +52,7 @@ class Model_Invoice_Item extends ORMOSB {
return ($this->price_base+$this->price_setup)*$this->quantity+$this->tax_amt-$this->discount_amt;
}
public function save() {
public function save(Validation $validation = NULL) {
// Save the invoice item
parent::save();

View File

@@ -13,7 +13,7 @@
class Model_Product extends ORMOSB {
// @todo this doesnt have our site_id when getting the translation
protected $_has_many = array(
'product_translate'=>array(),
'product_translate'=>array('far_key'=>'id'),
);
protected $_sorting = array(

View File

@@ -276,18 +276,16 @@ GROUP BY DATE_FORMAT(DATE,"%%Y-%%m"),SID
// Process upload
// @todo This should be separated out by supplier in case each supplier has a different format
$files = Validate::factory($_FILES);
$files->rules('csv',array(
'Upload::valid'=>array(),
'Upload::not_empty'=>array(),
'Upload::type'=>array('Upload::type' => array('csv')),
'Upload::size'=>array('10M'))
);
if ($_FILES) {
$files = Validation::factory($_FILES)
->rule('csv','Upload::valid')
->rule('csv','Upload::not_empty')
->rule('csv','Upload::type',array(':value',array('csv')))
->rule('csv','Upload::size',array(':value','10M'));
if ($files->check()) {
foreach ($files as $file) {
$csv = $this->process($file);
}
if ($files->check())
foreach ($files as $file)
$csv = $this->process($file);
}
// @todo add a display if there are no items

View File

@@ -17,7 +17,7 @@ class Model_Service extends ORMOSB {
'adsl_plan'=>array('through'=>'service__adsl'),
);
protected $_has_one = array(
'service_adsl'=>array(),
'service_adsl'=>array('far_key'=>'id'),
);
protected $_belongs_to = array(
'product'=>array(),