Changed use of active to status

This commit is contained in:
Deon George
2012-08-01 22:43:33 +10:00
parent e4d600b8d0
commit 4220ade8ac
40 changed files with 123 additions and 145 deletions

View File

@@ -226,7 +226,7 @@ class Auth_OSB extends Auth_ORM {
}
// If the passwords match, perform a login
if ($user->active AND $user->has_any('group',ORM::factory('group',array('name'=>'Registered Users'))->list_childgrps(TRUE)) AND $user->password === $password)
if ($user->status AND $user->has_any('group',ORM::factory('group',array('name'=>'Registered Users'))->list_childgrps(TRUE)) AND $user->password === $password)
{
if ($remember === TRUE)
{

View File

@@ -79,7 +79,7 @@ class Controller_Admin_Welcome extends Controller_TemplateDefault_Admin {
'order'=>1,
));
// Show un-applied payments
// Show un-applied payments
Block_Sub::add(array(
'title'=>'Unapplied Payments',
'body'=>Table::display(

View File

@@ -73,7 +73,7 @@ class Controller_Tree extends lnApp_Controller_Tree {
$subdata[$sub][$name]['name'] = preg_replace('/^(.*: )/','',$mmo->notes);
$subdata[$sub][$name]['id'] = sprintf('%s_%s',$mmo->module_id,$id);
$subdata[$sub][$name]['href'] = (empty($details['page']) ? $url : $details['page']);
} else {
// We dont want to show these items again, if we can through on a submenu
if (! $idx)

View File

@@ -41,7 +41,7 @@ tinyMCE.init({
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "iespell,media,advhr",
theme_advanced_toolbar_location : "bottom",
theme_advanced_toolbar_align : "center",
theme_advanced_toolbar_align : "center",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",

View File

@@ -20,7 +20,7 @@ class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {
public static function handler(Exception $e)
{
SystemMessage::add(array(
'title'=>_('Page not found'),
'title'=>_('Page not found'),
'type'=>'error',
'body'=>sprintf(_('The page [%s] you requested was not found?'),Request::detect_uri()),
));

View File

@@ -18,7 +18,7 @@ class Kohana extends Kohana_Core {
* unless each site has exactly the same modules enabled.
* This is because Kohana::$file is cached with the enabled modules
* and is not OSB multi-site aware.
*
*
* @todo It might be nice to cache the Kohana::$file site-aware for improved performance
*/
public static function shutdown_handler() {

View File

@@ -33,13 +33,13 @@ class lnApp_Controller_Login extends Controller_TemplateDefault {
if ($redir = Session::instance()->get('afterlogin')) {
Session::instance()->delete('afterlogin');
Request::current()->redirect($redir);
} else
Request::current()->redirect('user/welcome/index');
} else {
SystemMessage::add(array(
'title'=>_('Invalid username or password'),
'title'=>_('Invalid username or password'),
'type'=>'error',
'body'=>_('The username or password was invalid.')
));
@@ -81,7 +81,7 @@ class lnApp_Controller_Login extends Controller_TemplateDefault {
// Generic validation reason
default:
SystemMessage::add(array(
'title'=>_('Validation failed'),
'title'=>_('Validation failed'),
'type'=>'error',
'body'=>sprintf(_('The defaults on your submission were not valid for field %s (%s).'),$f,$r)
));
@@ -100,7 +100,7 @@ class lnApp_Controller_Login extends Controller_TemplateDefault {
}
SystemMessage::add(array(
'title'=>_('Already have an account?'),
'title'=>_('Already have an account?'),
'type'=>'info',
'body'=>_('If you already have an account, please login..')
));
@@ -184,7 +184,7 @@ class lnApp_Controller_Login extends Controller_TemplateDefault {
public function action_noaccess() {
SystemMessage::add(array(
'title'=>_('No access to requested resource'),
'title'=>_('No access to requested resource'),
'type'=>'error',
'body'=>_('You do not have access to the requested resource, please contact your administrator.')
));

View File

@@ -16,7 +16,7 @@ abstract class lnApp_PWgen {
throw new Kohana_Exception('No configuration for host or port (:host/:port)',array(':host'=>Kohana::Config('pwgen.host'),':port'=>Kohana::Config('pwgen.port')));
$ps = socket_create(AF_INET,SOCK_STREAM,0);
if (! socket_connect($ps,Kohana::Config('pwgen.host'),Kohana::Config('pwgen.port')))
if (! socket_connect($ps,Kohana::Config('pwgen.host'),Kohana::Config('pwgen.port')))
throw new Kohana_Exception('Unable to connect to password server');
// echo "Reading response:\n\n";

View File

@@ -24,15 +24,15 @@ class Model_Account extends Model_Auth_UserDefault {
);
protected $_display_filters = array(
'active'=>array(
array('StaticList_YesNo::display',array(':value')),
),
'date_orig'=>array(
array('Config::date',array(':value')),
),
'date_last'=>array(
array('Config::date',array(':value')),
),
'status'=>array(
array('StaticList_YesNo::display',array(':value')),
),
);
/**
@@ -67,7 +67,7 @@ class Model_Account extends Model_Auth_UserDefault {
}
public function country($name) {
return StaticList_Module::form($name,'country',$this->country_id,'id','name',array('active'=>'=:1'),FALSE,array('class'=>'form_button'));
return StaticList_Module::form($name,'country',$this->country_id,'id','name',array('status'=>'=:1'),FALSE,array('class'=>'form_button'));
}
/**
@@ -133,12 +133,12 @@ class Model_Account extends Model_Auth_UserDefault {
return $alo->saved();
}
private function _active() {
return $this->where('active','=',TRUE);
private function _where_active() {
return $this->where('status','=',TRUE);
}
public function list_active() {
return $this->_active()->order_by('company,last_name,first_name')->find_all();
return $this->_where_active()->order_by('company,last_name,first_name')->find_all();
}
public function list_affiliates() {
@@ -152,7 +152,7 @@ class Model_Account extends Model_Auth_UserDefault {
}
public function count_services($active=TRUE,$afid=NULL) {
return count($this->list_services($active,$afid));
return $this->list_services($active,$afid)->count();
}
/**
@@ -200,7 +200,7 @@ class Model_Account extends Model_Auth_UserDefault {
}
public function list_services($active=TRUE,$afid=NULL) {
$svs = $this->service->where('active','=',$active);
$svs = $this->service->where_active();
if ($afid)
$svs->where('affiliate_id','=',$afid);

View File

@@ -209,12 +209,22 @@ abstract class ORMOSB extends ORM {
return empty($mc[$key]) ? '' : $mc[$key];
}
protected function _active() {
return $this->where('active','=',TRUE);
protected function _where_active() {
return $this->where('status','=',TRUE);
}
public function where_active() {
return $this->_where_active();
}
public function list_active() {
return $this->_active()->find_all();
return $this->_where_active()->find_all();
}
public function list_count($active=TRUE) {
$a=($active ? $this->_where_active() : $this);
return $a->find_all()->count();
}
}
?>

View File

@@ -20,7 +20,7 @@ class Valid extends Kohana_Valid {
* @return boolean
*/
public static function matches_ifset($array, $field, $match)
{
{
return isset($array[$match]) ? ($array[$field] === $array[$match]) : TRUE;
}
}