simple form for adding a user to the database, only available for admin users.

This commit is contained in:
Naomi 2010-12-17 17:56:01 -05:00
parent 2830137d23
commit 1fc21819cc
30 changed files with 445 additions and 222 deletions

View file

@ -63,6 +63,10 @@
<controllerFile controllerName="Api">
<actionMethod actionName="index"/>
</controllerFile>
<controllerFile controllerName="User">
<actionMethod actionName="index"/>
<actionMethod actionName="addUser"/>
</controllerFile>
</controllersDirectory>
<formsDirectory>
<formFile formName="Login"/>
@ -72,6 +76,7 @@
<formFile formName="EditAudioMD"/>
<formFile formName="AddShow"/>
<formFile formName="ScheduleShow"/>
<formFile formName="AddUser"/>
</formsDirectory>
<layoutsDirectory enabled="false"/>
<modelsDirectory/>
@ -198,6 +203,12 @@
<viewControllerScriptsDirectory forControllerName="Schedule">
<viewScriptFile forActionName="clearShow"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="User">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="User">
<viewScriptFile forActionName="addUser"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory>
<viewHelpersDirectory/>
<viewFiltersDirectory enabled="false"/>
@ -239,6 +250,7 @@
<testApplicationControllerFile filesystemName="LoginControllerTest.php"/>
<testApplicationControllerFile filesystemName="ScheduleControllerTest.php"/>
<testApplicationControllerFile filesystemName="ApiControllerTest.php"/>
<testApplicationControllerFile filesystemName="UserControllerTest.php"/>
</testApplicationControllerDirectory>
</testApplicationDirectory>
<testLibraryDirectory>

View file

@ -10,6 +10,7 @@ $ccAcl->addRole(new Zend_Acl_Role('guest'))
$ccAcl->add(new Zend_Acl_Resource('library'))
->add(new Zend_Acl_Resource('index'))
->add(new Zend_Acl_Resource('user'))
->add(new Zend_Acl_Resource('error'))
->add(new Zend_Acl_Resource('login'))
->add(new Zend_Acl_Resource('playlist'))
@ -27,9 +28,12 @@ $ccAcl->allow('guest', 'index')
->allow('guest', 'api')
->allow('host', 'plupload')
->allow('host', 'playlist')
->allow('host', 'schedule');
->allow('host', 'schedule')
->allow('admin', 'user');
$aclPlugin = new Zend_Controller_Plugin_Acl($ccAcl);
Zend_View_Helper_Navigation_HelperAbstract::setDefaultAcl($ccAcl);
$front = Zend_Controller_Front::getInstance();
$front->registerPlugin($aclPlugin);

View file

@ -10,12 +10,18 @@
$pages = array(
array(
'label' => 'Home',
'title' => 'Go Home',
'module' => 'default',
'controller' => 'index',
'action' => 'index',
'order' => -100 // make sure home is the first page
),
array(
'label' => 'Add User',
'module' => 'default',
'controller' => 'user',
'action' => 'add-user',
'resource' => 'user'
),
array(
'label' => 'Playlists',
'module' => 'default',
@ -62,7 +68,8 @@ $pages = array(
'label' => 'Schedule',
'module' => 'default',
'controller' => 'Schedule',
'action' => 'index'
'action' => 'index',
'resource' => 'schedule'
),
array(
'label' => 'Logout',

View file

@ -30,25 +30,23 @@ class LoginController extends Zend_Controller_Action
$authAdapter = $this->getAuthAdapter();
# get the username and password from the form
//get the username and password from the form
$username = $form->getValue('username');
$password = $form->getValue('password');
# pass to the adapter the submitted username and password
//pass to the adapter the submitted username and password
$authAdapter->setIdentity($username)
->setCredential($password);
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authAdapter);
# is the user a valid one?
if($result->isValid())
{
# all info about this user from the login table
# omit only the password, we don't need that
//all info about this user from the login table omit only the password
$userInfo = $authAdapter->getResultRowObject(null, 'password');
# the default storage is a session with namespace Zend_Auth
//the default storage is a session with namespace Zend_Auth
$authStorage = $auth->getStorage();
$authStorage->write($userInfo);

View file

@ -0,0 +1,36 @@
<?php
class UserController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action body
}
public function addUserAction()
{
$request = $this->getRequest();
$form = new Application_Form_AddUser();
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
$formdata = $form->getValues();
User::addUser($formdata);
$form->reset();
}
}
$this->view->form = $form;
}
}

View file

@ -117,6 +117,8 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
$this->_roleName = "guest";
}
Zend_View_Helper_Navigation_HelperAbstract::setDefaultRole($this->_roleName);
$resourceName = '';
if ($request->getModuleName() != 'default') {

View file

@ -0,0 +1,60 @@
<?php
class Application_Form_AddUser extends Zend_Form
{
public function init()
{
// Add login element
$this->addElement('text', 'login', array(
'label' => 'Username:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array('NotEmpty')
));
// Add password element
$this->addElement('text', 'password', array(
'label' => 'Password:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array('NotEmpty')
));
// Add first name element
$this->addElement('text', 'first_name', array(
'label' => 'Firstname:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array('NotEmpty')
));
// Add last name element
$this->addElement('text', 'last_name', array(
'label' => 'Lastname:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array('NotEmpty')
));
//Add type select
$this->addElement('select', 'type', array(
'required' => true,
'multiOptions' => array(
"A" => "admin",
"H" => "host",
"G" => "guest",
),
));
// Add the submit button
$this->addElement('submit', 'submit', array(
'ignore' => true,
'label' => 'Submit',
));
}
}

View file

@ -27,6 +27,18 @@ class User {
return $this->_userRole === 'A';
}
public static function addUser($data) {
$user = new CcSubjs();
$user->setDbLogin($data['login']);
$user->setDbPass(md5($data['password']));
$user->setDbFirstName($data['first_name']);
$user->setDbLastName($data['last_name']);
$user->setDbType($data['type']);
$user->save();
}
public static function getUsers($type=NULL) {
global $CC_DBC;

View file

@ -38,13 +38,14 @@ class CcSubjsTableMap extends TableMap {
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_subjs_id_seq');
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('LOGIN', 'Login', 'VARCHAR', true, 255, '');
$this->addColumn('PASS', 'Pass', 'VARCHAR', true, 255, '');
$this->addColumn('TYPE', 'Type', 'CHAR', true, 1, 'U');
$this->addColumn('REALNAME', 'Realname', 'VARCHAR', true, 255, '');
$this->addColumn('LASTLOGIN', 'Lastlogin', 'TIMESTAMP', false, null, null);
$this->addColumn('LASTFAIL', 'Lastfail', 'TIMESTAMP', false, null, null);
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
$this->addColumn('LOGIN', 'DbLogin', 'VARCHAR', true, 255, '');
$this->addColumn('PASS', 'DbPass', 'VARCHAR', true, 255, '');
$this->addColumn('TYPE', 'DbType', 'CHAR', true, 1, 'U');
$this->addColumn('FIRST_NAME', 'DbFirstName', 'VARCHAR', true, 255, '');
$this->addColumn('LAST_NAME', 'DbLastName', 'VARCHAR', true, 255, '');
$this->addColumn('LASTLOGIN', 'DbLastlogin', 'TIMESTAMP', false, null, null);
$this->addColumn('LASTFAIL', 'DbLastfail', 'TIMESTAMP', false, null, null);
// validators
} // initialize()

View file

@ -393,7 +393,7 @@ abstract class BaseCcAccess extends BaseObject implements Persistent
$this->modifiedColumns[] = CcAccessPeer::OWNER;
}
if ($this->aCcSubjs !== null && $this->aCcSubjs->getId() !== $v) {
if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) {
$this->aCcSubjs = null;
}
@ -533,7 +533,7 @@ abstract class BaseCcAccess extends BaseObject implements Persistent
public function ensureConsistency()
{
if ($this->aCcSubjs !== null && $this->owner !== $this->aCcSubjs->getId()) {
if ($this->aCcSubjs !== null && $this->owner !== $this->aCcSubjs->getDbId()) {
$this->aCcSubjs = null;
}
} // ensureConsistency
@ -1137,7 +1137,7 @@ abstract class BaseCcAccess extends BaseObject implements Persistent
if ($v === null) {
$this->setOwner(NULL);
} else {
$this->setOwner($v->getId());
$this->setOwner($v->getDbId());
}
$this->aCcSubjs = $v;

View file

@ -405,7 +405,7 @@ abstract class BaseCcAccessQuery extends ModelCriteria
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
return $this
->addUsingAlias(CcAccessPeer::OWNER, $ccSubjs->getId(), $comparison);
->addUsingAlias(CcAccessPeer::OWNER, $ccSubjs->getDbId(), $comparison);
}
/**

View file

@ -1167,7 +1167,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->modifiedColumns[] = CcFilesPeer::EDITEDBY;
}
if ($this->aCcSubjs !== null && $this->aCcSubjs->getId() !== $v) {
if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) {
$this->aCcSubjs = null;
}
@ -2273,7 +2273,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
public function ensureConsistency()
{
if ($this->aCcSubjs !== null && $this->editedby !== $this->aCcSubjs->getId()) {
if ($this->aCcSubjs !== null && $this->editedby !== $this->aCcSubjs->getDbId()) {
$this->aCcSubjs = null;
}
} // ensureConsistency
@ -3359,7 +3359,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if ($v === null) {
$this->setEditedby(NULL);
} else {
$this->setEditedby($v->getId());
$this->setEditedby($v->getDbId());
}
$this->aCcSubjs = $v;

View file

@ -1597,7 +1597,7 @@ abstract class BaseCcFilesQuery extends ModelCriteria
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
return $this
->addUsingAlias(CcFilesPeer::EDITEDBY, $ccSubjs->getId(), $comparison);
->addUsingAlias(CcFilesPeer::EDITEDBY, $ccSubjs->getDbId(), $comparison);
}
/**

View file

@ -160,7 +160,7 @@ abstract class BaseCcPerms extends BaseObject implements Persistent
$this->modifiedColumns[] = CcPermsPeer::SUBJ;
}
if ($this->aCcSubjs !== null && $this->aCcSubjs->getId() !== $v) {
if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) {
$this->aCcSubjs = null;
}
@ -295,7 +295,7 @@ abstract class BaseCcPerms extends BaseObject implements Persistent
public function ensureConsistency()
{
if ($this->aCcSubjs !== null && $this->subj !== $this->aCcSubjs->getId()) {
if ($this->aCcSubjs !== null && $this->subj !== $this->aCcSubjs->getDbId()) {
$this->aCcSubjs = null;
}
} // ensureConsistency
@ -851,7 +851,7 @@ abstract class BaseCcPerms extends BaseObject implements Persistent
if ($v === null) {
$this->setSubj(NULL);
} else {
$this->setSubj($v->getId());
$this->setSubj($v->getDbId());
}
$this->aCcSubjs = $v;

View file

@ -283,7 +283,7 @@ abstract class BaseCcPermsQuery extends ModelCriteria
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
return $this
->addUsingAlias(CcPermsPeer::SUBJ, $ccSubjs->getId(), $comparison);
->addUsingAlias(CcPermsPeer::SUBJ, $ccSubjs->getDbId(), $comparison);
}
/**

View file

@ -322,7 +322,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
$this->modifiedColumns[] = CcPlaylistPeer::EDITEDBY;
}
if ($this->aCcSubjs !== null && $this->aCcSubjs->getId() !== $v) {
if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) {
$this->aCcSubjs = null;
}
@ -501,7 +501,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
public function ensureConsistency()
{
if ($this->aCcSubjs !== null && $this->editedby !== $this->aCcSubjs->getId()) {
if ($this->aCcSubjs !== null && $this->editedby !== $this->aCcSubjs->getDbId()) {
$this->aCcSubjs = null;
}
} // ensureConsistency
@ -1127,7 +1127,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
if ($v === null) {
$this->setDbEditedby(NULL);
} else {
$this->setDbEditedby($v->getId());
$this->setDbEditedby($v->getDbId());
}
$this->aCcSubjs = $v;

View file

@ -374,7 +374,7 @@ abstract class BaseCcPlaylistQuery extends ModelCriteria
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
return $this
->addUsingAlias(CcPlaylistPeer::EDITEDBY, $ccSubjs->getId(), $comparison);
->addUsingAlias(CcPlaylistPeer::EDITEDBY, $ccSubjs->getDbId(), $comparison);
}
/**

View file

@ -144,7 +144,7 @@ abstract class BaseCcPref extends BaseObject implements Persistent
$this->modifiedColumns[] = CcPrefPeer::SUBJID;
}
if ($this->aCcSubjs !== null && $this->aCcSubjs->getId() !== $v) {
if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) {
$this->aCcSubjs = null;
}
@ -258,7 +258,7 @@ abstract class BaseCcPref extends BaseObject implements Persistent
public function ensureConsistency()
{
if ($this->aCcSubjs !== null && $this->subjid !== $this->aCcSubjs->getId()) {
if ($this->aCcSubjs !== null && $this->subjid !== $this->aCcSubjs->getDbId()) {
$this->aCcSubjs = null;
}
} // ensureConsistency
@ -812,7 +812,7 @@ abstract class BaseCcPref extends BaseObject implements Persistent
if ($v === null) {
$this->setSubjid(NULL);
} else {
$this->setSubjid($v->getId());
$this->setSubjid($v->getDbId());
}
$this->aCcSubjs = $v;

View file

@ -248,7 +248,7 @@ abstract class BaseCcPrefQuery extends ModelCriteria
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
return $this
->addUsingAlias(CcPrefPeer::SUBJID, $ccSubjs->getId(), $comparison);
->addUsingAlias(CcPrefPeer::SUBJID, $ccSubjs->getDbId(), $comparison);
}
/**

View file

@ -167,7 +167,7 @@ abstract class BaseCcSess extends BaseObject implements Persistent
$this->modifiedColumns[] = CcSessPeer::USERID;
}
if ($this->aCcSubjs !== null && $this->aCcSubjs->getId() !== $v) {
if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) {
$this->aCcSubjs = null;
}
@ -310,7 +310,7 @@ abstract class BaseCcSess extends BaseObject implements Persistent
public function ensureConsistency()
{
if ($this->aCcSubjs !== null && $this->userid !== $this->aCcSubjs->getId()) {
if ($this->aCcSubjs !== null && $this->userid !== $this->aCcSubjs->getDbId()) {
$this->aCcSubjs = null;
}
} // ensureConsistency
@ -856,7 +856,7 @@ abstract class BaseCcSess extends BaseObject implements Persistent
if ($v === null) {
$this->setUserid(NULL);
} else {
$this->setUserid($v->getId());
$this->setUserid($v->getDbId());
}
$this->aCcSubjs = $v;

View file

@ -262,7 +262,7 @@ abstract class BaseCcSessQuery extends ModelCriteria
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
return $this
->addUsingAlias(CcSessPeer::USERID, $ccSubjs->getId(), $comparison);
->addUsingAlias(CcSessPeer::USERID, $ccSubjs->getDbId(), $comparison);
}
/**

View file

@ -157,7 +157,7 @@ abstract class BaseCcShowHosts extends BaseObject implements Persistent
$this->modifiedColumns[] = CcShowHostsPeer::SUBJS_ID;
}
if ($this->aCcSubjs !== null && $this->aCcSubjs->getId() !== $v) {
if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) {
$this->aCcSubjs = null;
}
@ -233,7 +233,7 @@ abstract class BaseCcShowHosts extends BaseObject implements Persistent
if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) {
$this->aCcShow = null;
}
if ($this->aCcSubjs !== null && $this->subjs_id !== $this->aCcSubjs->getId()) {
if ($this->aCcSubjs !== null && $this->subjs_id !== $this->aCcSubjs->getDbId()) {
$this->aCcSubjs = null;
}
} // ensureConsistency
@ -843,7 +843,7 @@ abstract class BaseCcShowHosts extends BaseObject implements Persistent
if ($v === null) {
$this->setDbHost(NULL);
} else {
$this->setDbHost($v->getId());
$this->setDbHost($v->getDbId());
}
$this->aCcSubjs = $v;

View file

@ -299,7 +299,7 @@ abstract class BaseCcShowHostsQuery extends ModelCriteria
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
return $this
->addUsingAlias(CcShowHostsPeer::SUBJS_ID, $ccSubjs->getId(), $comparison);
->addUsingAlias(CcShowHostsPeer::SUBJS_ID, $ccSubjs->getDbId(), $comparison);
}
/**

View file

@ -52,11 +52,18 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
protected $type;
/**
* The value for the realname field.
* The value for the first_name field.
* Note: this column has a database default value of: ''
* @var string
*/
protected $realname;
protected $first_name;
/**
* The value for the last_name field.
* Note: this column has a database default value of: ''
* @var string
*/
protected $last_name;
/**
* The value for the lastlogin field.
@ -130,7 +137,8 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$this->login = '';
$this->pass = '';
$this->type = 'U';
$this->realname = '';
$this->first_name = '';
$this->last_name = '';
}
/**
@ -148,7 +156,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
*
* @return int
*/
public function getId()
public function getDbId()
{
return $this->id;
}
@ -158,7 +166,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
*
* @return string
*/
public function getLogin()
public function getDbLogin()
{
return $this->login;
}
@ -168,7 +176,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
*
* @return string
*/
public function getPass()
public function getDbPass()
{
return $this->pass;
}
@ -178,19 +186,29 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
*
* @return string
*/
public function getType()
public function getDbType()
{
return $this->type;
}
/**
* Get the [realname] column value.
* Get the [first_name] column value.
*
* @return string
*/
public function getRealname()
public function getDbFirstName()
{
return $this->realname;
return $this->first_name;
}
/**
* Get the [last_name] column value.
*
* @return string
*/
public function getDbLastName()
{
return $this->last_name;
}
/**
@ -202,7 +220,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getLastlogin($format = 'Y-m-d H:i:s')
public function getDbLastlogin($format = 'Y-m-d H:i:s')
{
if ($this->lastlogin === null) {
return null;
@ -235,7 +253,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getLastfail($format = 'Y-m-d H:i:s')
public function getDbLastfail($format = 'Y-m-d H:i:s')
{
if ($this->lastfail === null) {
return null;
@ -265,7 +283,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
* @param int $v new value
* @return CcSubjs The current object (for fluent API support)
*/
public function setId($v)
public function setDbId($v)
{
if ($v !== null) {
$v = (int) $v;
@ -277,7 +295,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
}
return $this;
} // setId()
} // setDbId()
/**
* Set the value of [login] column.
@ -285,7 +303,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
* @param string $v new value
* @return CcSubjs The current object (for fluent API support)
*/
public function setLogin($v)
public function setDbLogin($v)
{
if ($v !== null) {
$v = (string) $v;
@ -297,7 +315,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
}
return $this;
} // setLogin()
} // setDbLogin()
/**
* Set the value of [pass] column.
@ -305,7 +323,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
* @param string $v new value
* @return CcSubjs The current object (for fluent API support)
*/
public function setPass($v)
public function setDbPass($v)
{
if ($v !== null) {
$v = (string) $v;
@ -317,7 +335,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
}
return $this;
} // setPass()
} // setDbPass()
/**
* Set the value of [type] column.
@ -325,7 +343,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
* @param string $v new value
* @return CcSubjs The current object (for fluent API support)
*/
public function setType($v)
public function setDbType($v)
{
if ($v !== null) {
$v = (string) $v;
@ -337,27 +355,47 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
}
return $this;
} // setType()
} // setDbType()
/**
* Set the value of [realname] column.
* Set the value of [first_name] column.
*
* @param string $v new value
* @return CcSubjs The current object (for fluent API support)
*/
public function setRealname($v)
public function setDbFirstName($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->realname !== $v || $this->isNew()) {
$this->realname = $v;
$this->modifiedColumns[] = CcSubjsPeer::REALNAME;
if ($this->first_name !== $v || $this->isNew()) {
$this->first_name = $v;
$this->modifiedColumns[] = CcSubjsPeer::FIRST_NAME;
}
return $this;
} // setRealname()
} // setDbFirstName()
/**
* Set the value of [last_name] column.
*
* @param string $v new value
* @return CcSubjs The current object (for fluent API support)
*/
public function setDbLastName($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->last_name !== $v || $this->isNew()) {
$this->last_name = $v;
$this->modifiedColumns[] = CcSubjsPeer::LAST_NAME;
}
return $this;
} // setDbLastName()
/**
* Sets the value of [lastlogin] column to a normalized version of the date/time value specified.
@ -366,7 +404,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
* be treated as NULL for temporal objects.
* @return CcSubjs The current object (for fluent API support)
*/
public function setLastlogin($v)
public function setDbLastlogin($v)
{
// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
// -- which is unexpected, to say the least.
@ -406,7 +444,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
} // if either are not null
return $this;
} // setLastlogin()
} // setDbLastlogin()
/**
* Sets the value of [lastfail] column to a normalized version of the date/time value specified.
@ -415,7 +453,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
* be treated as NULL for temporal objects.
* @return CcSubjs The current object (for fluent API support)
*/
public function setLastfail($v)
public function setDbLastfail($v)
{
// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
// -- which is unexpected, to say the least.
@ -455,7 +493,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
} // if either are not null
return $this;
} // setLastfail()
} // setDbLastfail()
/**
* Indicates whether the columns in this object are only set to default values.
@ -479,7 +517,11 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
return false;
}
if ($this->realname !== '') {
if ($this->first_name !== '') {
return false;
}
if ($this->last_name !== '') {
return false;
}
@ -509,9 +551,10 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$this->login = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->pass = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->type = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->realname = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->lastlogin = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
$this->lastfail = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
$this->first_name = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->last_name = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
$this->lastlogin = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
$this->lastfail = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
$this->resetModified();
$this->setNew(false);
@ -520,7 +563,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$this->ensureConsistency();
}
return $startcol + 7; // 7 = CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 8; // 8 = CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcSubjs object", $e);
@ -720,7 +763,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$pk = BasePeer::doInsert($criteria, $con);
$affectedRows = 1;
$this->setId($pk); //[IMV] update autoincrement primary key
$this->setDbId($pk); //[IMV] update autoincrement primary key
$this->setNew(false);
} else {
$affectedRows = CcSubjsPeer::doUpdate($this, $con);
@ -946,25 +989,28 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
{
switch($pos) {
case 0:
return $this->getId();
return $this->getDbId();
break;
case 1:
return $this->getLogin();
return $this->getDbLogin();
break;
case 2:
return $this->getPass();
return $this->getDbPass();
break;
case 3:
return $this->getType();
return $this->getDbType();
break;
case 4:
return $this->getRealname();
return $this->getDbFirstName();
break;
case 5:
return $this->getLastlogin();
return $this->getDbLastName();
break;
case 6:
return $this->getLastfail();
return $this->getDbLastlogin();
break;
case 7:
return $this->getDbLastfail();
break;
default:
return null;
@ -989,13 +1035,14 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
{
$keys = CcSubjsPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getLogin(),
$keys[2] => $this->getPass(),
$keys[3] => $this->getType(),
$keys[4] => $this->getRealname(),
$keys[5] => $this->getLastlogin(),
$keys[6] => $this->getLastfail(),
$keys[0] => $this->getDbId(),
$keys[1] => $this->getDbLogin(),
$keys[2] => $this->getDbPass(),
$keys[3] => $this->getDbType(),
$keys[4] => $this->getDbFirstName(),
$keys[5] => $this->getDbLastName(),
$keys[6] => $this->getDbLastlogin(),
$keys[7] => $this->getDbLastfail(),
);
return $result;
}
@ -1028,25 +1075,28 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
{
switch($pos) {
case 0:
$this->setId($value);
$this->setDbId($value);
break;
case 1:
$this->setLogin($value);
$this->setDbLogin($value);
break;
case 2:
$this->setPass($value);
$this->setDbPass($value);
break;
case 3:
$this->setType($value);
$this->setDbType($value);
break;
case 4:
$this->setRealname($value);
$this->setDbFirstName($value);
break;
case 5:
$this->setLastlogin($value);
$this->setDbLastName($value);
break;
case 6:
$this->setLastfail($value);
$this->setDbLastlogin($value);
break;
case 7:
$this->setDbLastfail($value);
break;
} // switch()
}
@ -1072,13 +1122,14 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
{
$keys = CcSubjsPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setLogin($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setPass($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setType($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setRealname($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setLastlogin($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setLastfail($arr[$keys[6]]);
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDbLogin($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDbPass($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbType($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbFirstName($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDbLastName($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDbLastlogin($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setDbLastfail($arr[$keys[7]]);
}
/**
@ -1094,7 +1145,8 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
if ($this->isColumnModified(CcSubjsPeer::LOGIN)) $criteria->add(CcSubjsPeer::LOGIN, $this->login);
if ($this->isColumnModified(CcSubjsPeer::PASS)) $criteria->add(CcSubjsPeer::PASS, $this->pass);
if ($this->isColumnModified(CcSubjsPeer::TYPE)) $criteria->add(CcSubjsPeer::TYPE, $this->type);
if ($this->isColumnModified(CcSubjsPeer::REALNAME)) $criteria->add(CcSubjsPeer::REALNAME, $this->realname);
if ($this->isColumnModified(CcSubjsPeer::FIRST_NAME)) $criteria->add(CcSubjsPeer::FIRST_NAME, $this->first_name);
if ($this->isColumnModified(CcSubjsPeer::LAST_NAME)) $criteria->add(CcSubjsPeer::LAST_NAME, $this->last_name);
if ($this->isColumnModified(CcSubjsPeer::LASTLOGIN)) $criteria->add(CcSubjsPeer::LASTLOGIN, $this->lastlogin);
if ($this->isColumnModified(CcSubjsPeer::LASTFAIL)) $criteria->add(CcSubjsPeer::LASTFAIL, $this->lastfail);
@ -1123,7 +1175,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
*/
public function getPrimaryKey()
{
return $this->getId();
return $this->getDbId();
}
/**
@ -1134,7 +1186,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
*/
public function setPrimaryKey($key)
{
$this->setId($key);
$this->setDbId($key);
}
/**
@ -1143,7 +1195,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
*/
public function isPrimaryKeyNull()
{
return null === $this->getId();
return null === $this->getDbId();
}
/**
@ -1158,12 +1210,13 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
*/
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setLogin($this->login);
$copyObj->setPass($this->pass);
$copyObj->setType($this->type);
$copyObj->setRealname($this->realname);
$copyObj->setLastlogin($this->lastlogin);
$copyObj->setLastfail($this->lastfail);
$copyObj->setDbLogin($this->login);
$copyObj->setDbPass($this->pass);
$copyObj->setDbType($this->type);
$copyObj->setDbFirstName($this->first_name);
$copyObj->setDbLastName($this->last_name);
$copyObj->setDbLastlogin($this->lastlogin);
$copyObj->setDbLastfail($this->lastfail);
if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of
@ -1216,7 +1269,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$copyObj->setNew(true);
$copyObj->setId(NULL); // this is a auto-increment column, so set to default value
$copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value
}
/**
@ -2054,7 +2107,8 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$this->login = null;
$this->pass = null;
$this->type = null;
$this->realname = null;
$this->first_name = null;
$this->last_name = null;
$this->lastlogin = null;
$this->lastfail = null;
$this->alreadyInSave = false;

View file

@ -26,7 +26,7 @@ abstract class BaseCcSubjsPeer {
const TM_CLASS = 'CcSubjsTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 7;
const NUM_COLUMNS = 8;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@ -43,8 +43,11 @@ abstract class BaseCcSubjsPeer {
/** the column name for the TYPE field */
const TYPE = 'cc_subjs.TYPE';
/** the column name for the REALNAME field */
const REALNAME = 'cc_subjs.REALNAME';
/** the column name for the FIRST_NAME field */
const FIRST_NAME = 'cc_subjs.FIRST_NAME';
/** the column name for the LAST_NAME field */
const LAST_NAME = 'cc_subjs.LAST_NAME';
/** the column name for the LASTLOGIN field */
const LASTLOGIN = 'cc_subjs.LASTLOGIN';
@ -68,12 +71,12 @@ abstract class BaseCcSubjsPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Login', 'Pass', 'Type', 'Realname', 'Lastlogin', 'Lastfail', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'login', 'pass', 'type', 'realname', 'lastlogin', 'lastfail', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::LOGIN, self::PASS, self::TYPE, self::REALNAME, self::LASTLOGIN, self::LASTFAIL, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'LOGIN', 'PASS', 'TYPE', 'REALNAME', 'LASTLOGIN', 'LASTFAIL', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'login', 'pass', 'type', 'realname', 'lastlogin', 'lastfail', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbLogin', 'DbPass', 'DbType', 'DbFirstName', 'DbLastName', 'DbLastlogin', 'DbLastfail', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbLogin', 'dbPass', 'dbType', 'dbFirstName', 'dbLastName', 'dbLastlogin', 'dbLastfail', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::LOGIN, self::PASS, self::TYPE, self::FIRST_NAME, self::LAST_NAME, self::LASTLOGIN, self::LASTFAIL, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'LOGIN', 'PASS', 'TYPE', 'FIRST_NAME', 'LAST_NAME', 'LASTLOGIN', 'LASTFAIL', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'login', 'pass', 'type', 'first_name', 'last_name', 'lastlogin', 'lastfail', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
@ -83,12 +86,12 @@ abstract class BaseCcSubjsPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Login' => 1, 'Pass' => 2, 'Type' => 3, 'Realname' => 4, 'Lastlogin' => 5, 'Lastfail' => 6, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'login' => 1, 'pass' => 2, 'type' => 3, 'realname' => 4, 'lastlogin' => 5, 'lastfail' => 6, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::LOGIN => 1, self::PASS => 2, self::TYPE => 3, self::REALNAME => 4, self::LASTLOGIN => 5, self::LASTFAIL => 6, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'LOGIN' => 1, 'PASS' => 2, 'TYPE' => 3, 'REALNAME' => 4, 'LASTLOGIN' => 5, 'LASTFAIL' => 6, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'login' => 1, 'pass' => 2, 'type' => 3, 'realname' => 4, 'lastlogin' => 5, 'lastfail' => 6, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbLogin' => 1, 'DbPass' => 2, 'DbType' => 3, 'DbFirstName' => 4, 'DbLastName' => 5, 'DbLastlogin' => 6, 'DbLastfail' => 7, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbLogin' => 1, 'dbPass' => 2, 'dbType' => 3, 'dbFirstName' => 4, 'dbLastName' => 5, 'dbLastlogin' => 6, 'dbLastfail' => 7, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::LOGIN => 1, self::PASS => 2, self::TYPE => 3, self::FIRST_NAME => 4, self::LAST_NAME => 5, self::LASTLOGIN => 6, self::LASTFAIL => 7, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'LOGIN' => 1, 'PASS' => 2, 'TYPE' => 3, 'FIRST_NAME' => 4, 'LAST_NAME' => 5, 'LASTLOGIN' => 6, 'LASTFAIL' => 7, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'login' => 1, 'pass' => 2, 'type' => 3, 'first_name' => 4, 'last_name' => 5, 'lastlogin' => 6, 'lastfail' => 7, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
@ -164,7 +167,8 @@ abstract class BaseCcSubjsPeer {
$criteria->addSelectColumn(CcSubjsPeer::LOGIN);
$criteria->addSelectColumn(CcSubjsPeer::PASS);
$criteria->addSelectColumn(CcSubjsPeer::TYPE);
$criteria->addSelectColumn(CcSubjsPeer::REALNAME);
$criteria->addSelectColumn(CcSubjsPeer::FIRST_NAME);
$criteria->addSelectColumn(CcSubjsPeer::LAST_NAME);
$criteria->addSelectColumn(CcSubjsPeer::LASTLOGIN);
$criteria->addSelectColumn(CcSubjsPeer::LASTFAIL);
} else {
@ -172,7 +176,8 @@ abstract class BaseCcSubjsPeer {
$criteria->addSelectColumn($alias . '.LOGIN');
$criteria->addSelectColumn($alias . '.PASS');
$criteria->addSelectColumn($alias . '.TYPE');
$criteria->addSelectColumn($alias . '.REALNAME');
$criteria->addSelectColumn($alias . '.FIRST_NAME');
$criteria->addSelectColumn($alias . '.LAST_NAME');
$criteria->addSelectColumn($alias . '.LASTLOGIN');
$criteria->addSelectColumn($alias . '.LASTFAIL');
}
@ -299,7 +304,7 @@ abstract class BaseCcSubjsPeer {
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
$key = (string) $obj->getDbId();
} // if key === null
self::$instances[$key] = $obj;
}
@ -319,7 +324,7 @@ abstract class BaseCcSubjsPeer {
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof CcSubjs) {
$key = (string) $value->getId();
$key = (string) $value->getDbId();
} elseif (is_scalar($value)) {
// assume we've been passed a primary key
$key = (string) $value;

View file

@ -6,21 +6,23 @@
*
*
*
* @method CcSubjsQuery orderById($order = Criteria::ASC) Order by the id column
* @method CcSubjsQuery orderByLogin($order = Criteria::ASC) Order by the login column
* @method CcSubjsQuery orderByPass($order = Criteria::ASC) Order by the pass column
* @method CcSubjsQuery orderByType($order = Criteria::ASC) Order by the type column
* @method CcSubjsQuery orderByRealname($order = Criteria::ASC) Order by the realname column
* @method CcSubjsQuery orderByLastlogin($order = Criteria::ASC) Order by the lastlogin column
* @method CcSubjsQuery orderByLastfail($order = Criteria::ASC) Order by the lastfail column
* @method CcSubjsQuery orderByDbId($order = Criteria::ASC) Order by the id column
* @method CcSubjsQuery orderByDbLogin($order = Criteria::ASC) Order by the login column
* @method CcSubjsQuery orderByDbPass($order = Criteria::ASC) Order by the pass column
* @method CcSubjsQuery orderByDbType($order = Criteria::ASC) Order by the type column
* @method CcSubjsQuery orderByDbFirstName($order = Criteria::ASC) Order by the first_name column
* @method CcSubjsQuery orderByDbLastName($order = Criteria::ASC) Order by the last_name column
* @method CcSubjsQuery orderByDbLastlogin($order = Criteria::ASC) Order by the lastlogin column
* @method CcSubjsQuery orderByDbLastfail($order = Criteria::ASC) Order by the lastfail column
*
* @method CcSubjsQuery groupById() Group by the id column
* @method CcSubjsQuery groupByLogin() Group by the login column
* @method CcSubjsQuery groupByPass() Group by the pass column
* @method CcSubjsQuery groupByType() Group by the type column
* @method CcSubjsQuery groupByRealname() Group by the realname column
* @method CcSubjsQuery groupByLastlogin() Group by the lastlogin column
* @method CcSubjsQuery groupByLastfail() Group by the lastfail column
* @method CcSubjsQuery groupByDbId() Group by the id column
* @method CcSubjsQuery groupByDbLogin() Group by the login column
* @method CcSubjsQuery groupByDbPass() Group by the pass column
* @method CcSubjsQuery groupByDbType() Group by the type column
* @method CcSubjsQuery groupByDbFirstName() Group by the first_name column
* @method CcSubjsQuery groupByDbLastName() Group by the last_name column
* @method CcSubjsQuery groupByDbLastlogin() Group by the lastlogin column
* @method CcSubjsQuery groupByDbLastfail() Group by the lastfail column
*
* @method CcSubjsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcSubjsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -57,21 +59,23 @@
* @method CcSubjs findOne(PropelPDO $con = null) Return the first CcSubjs matching the query
* @method CcSubjs findOneOrCreate(PropelPDO $con = null) Return the first CcSubjs matching the query, or a new CcSubjs object populated from the query conditions when no match is found
*
* @method CcSubjs findOneById(int $id) Return the first CcSubjs filtered by the id column
* @method CcSubjs findOneByLogin(string $login) Return the first CcSubjs filtered by the login column
* @method CcSubjs findOneByPass(string $pass) Return the first CcSubjs filtered by the pass column
* @method CcSubjs findOneByType(string $type) Return the first CcSubjs filtered by the type column
* @method CcSubjs findOneByRealname(string $realname) Return the first CcSubjs filtered by the realname column
* @method CcSubjs findOneByLastlogin(string $lastlogin) Return the first CcSubjs filtered by the lastlogin column
* @method CcSubjs findOneByLastfail(string $lastfail) Return the first CcSubjs filtered by the lastfail column
* @method CcSubjs findOneByDbId(int $id) Return the first CcSubjs filtered by the id column
* @method CcSubjs findOneByDbLogin(string $login) Return the first CcSubjs filtered by the login column
* @method CcSubjs findOneByDbPass(string $pass) Return the first CcSubjs filtered by the pass column
* @method CcSubjs findOneByDbType(string $type) Return the first CcSubjs filtered by the type column
* @method CcSubjs findOneByDbFirstName(string $first_name) Return the first CcSubjs filtered by the first_name column
* @method CcSubjs findOneByDbLastName(string $last_name) Return the first CcSubjs filtered by the last_name column
* @method CcSubjs findOneByDbLastlogin(string $lastlogin) Return the first CcSubjs filtered by the lastlogin column
* @method CcSubjs findOneByDbLastfail(string $lastfail) Return the first CcSubjs filtered by the lastfail column
*
* @method array findById(int $id) Return CcSubjs objects filtered by the id column
* @method array findByLogin(string $login) Return CcSubjs objects filtered by the login column
* @method array findByPass(string $pass) Return CcSubjs objects filtered by the pass column
* @method array findByType(string $type) Return CcSubjs objects filtered by the type column
* @method array findByRealname(string $realname) Return CcSubjs objects filtered by the realname column
* @method array findByLastlogin(string $lastlogin) Return CcSubjs objects filtered by the lastlogin column
* @method array findByLastfail(string $lastfail) Return CcSubjs objects filtered by the lastfail column
* @method array findByDbId(int $id) Return CcSubjs objects filtered by the id column
* @method array findByDbLogin(string $login) Return CcSubjs objects filtered by the login column
* @method array findByDbPass(string $pass) Return CcSubjs objects filtered by the pass column
* @method array findByDbType(string $type) Return CcSubjs objects filtered by the type column
* @method array findByDbFirstName(string $first_name) Return CcSubjs objects filtered by the first_name column
* @method array findByDbLastName(string $last_name) Return CcSubjs objects filtered by the last_name column
* @method array findByDbLastlogin(string $lastlogin) Return CcSubjs objects filtered by the lastlogin column
* @method array findByDbLastfail(string $lastfail) Return CcSubjs objects filtered by the lastfail column
*
* @package propel.generator.campcaster.om
*/
@ -184,127 +188,149 @@ abstract class BaseCcSubjsQuery extends ModelCriteria
/**
* Filter the query on the id column
*
* @param int|array $id The value to use as filter.
* @param int|array $dbId The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
public function filterByDbId($dbId = null, $comparison = null)
{
if (is_array($id) && null === $comparison) {
if (is_array($dbId) && null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(CcSubjsPeer::ID, $id, $comparison);
return $this->addUsingAlias(CcSubjsPeer::ID, $dbId, $comparison);
}
/**
* Filter the query on the login column
*
* @param string $login The value to use as filter.
* @param string $dbLogin The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByLogin($login = null, $comparison = null)
public function filterByDbLogin($dbLogin = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($login)) {
if (is_array($dbLogin)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $login)) {
$login = str_replace('*', '%', $login);
} elseif (preg_match('/[\%\*]/', $dbLogin)) {
$dbLogin = str_replace('*', '%', $dbLogin);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcSubjsPeer::LOGIN, $login, $comparison);
return $this->addUsingAlias(CcSubjsPeer::LOGIN, $dbLogin, $comparison);
}
/**
* Filter the query on the pass column
*
* @param string $pass The value to use as filter.
* @param string $dbPass The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByPass($pass = null, $comparison = null)
public function filterByDbPass($dbPass = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($pass)) {
if (is_array($dbPass)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $pass)) {
$pass = str_replace('*', '%', $pass);
} elseif (preg_match('/[\%\*]/', $dbPass)) {
$dbPass = str_replace('*', '%', $dbPass);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcSubjsPeer::PASS, $pass, $comparison);
return $this->addUsingAlias(CcSubjsPeer::PASS, $dbPass, $comparison);
}
/**
* Filter the query on the type column
*
* @param string $type The value to use as filter.
* @param string $dbType The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByType($type = null, $comparison = null)
public function filterByDbType($dbType = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($type)) {
if (is_array($dbType)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $type)) {
$type = str_replace('*', '%', $type);
} elseif (preg_match('/[\%\*]/', $dbType)) {
$dbType = str_replace('*', '%', $dbType);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcSubjsPeer::TYPE, $type, $comparison);
return $this->addUsingAlias(CcSubjsPeer::TYPE, $dbType, $comparison);
}
/**
* Filter the query on the realname column
* Filter the query on the first_name column
*
* @param string $realname The value to use as filter.
* @param string $dbFirstName The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByRealname($realname = null, $comparison = null)
public function filterByDbFirstName($dbFirstName = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($realname)) {
if (is_array($dbFirstName)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $realname)) {
$realname = str_replace('*', '%', $realname);
} elseif (preg_match('/[\%\*]/', $dbFirstName)) {
$dbFirstName = str_replace('*', '%', $dbFirstName);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcSubjsPeer::REALNAME, $realname, $comparison);
return $this->addUsingAlias(CcSubjsPeer::FIRST_NAME, $dbFirstName, $comparison);
}
/**
* Filter the query on the last_name column
*
* @param string $dbLastName The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByDbLastName($dbLastName = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbLastName)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbLastName)) {
$dbLastName = str_replace('*', '%', $dbLastName);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcSubjsPeer::LAST_NAME, $dbLastName, $comparison);
}
/**
* Filter the query on the lastlogin column
*
* @param string|array $lastlogin The value to use as filter.
* @param string|array $dbLastlogin The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByLastlogin($lastlogin = null, $comparison = null)
public function filterByDbLastlogin($dbLastlogin = null, $comparison = null)
{
if (is_array($lastlogin)) {
if (is_array($dbLastlogin)) {
$useMinMax = false;
if (isset($lastlogin['min'])) {
$this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $lastlogin['min'], Criteria::GREATER_EQUAL);
if (isset($dbLastlogin['min'])) {
$this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $dbLastlogin['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($lastlogin['max'])) {
$this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $lastlogin['max'], Criteria::LESS_EQUAL);
if (isset($dbLastlogin['max'])) {
$this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $dbLastlogin['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@ -314,28 +340,28 @@ abstract class BaseCcSubjsQuery extends ModelCriteria
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $lastlogin, $comparison);
return $this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $dbLastlogin, $comparison);
}
/**
* Filter the query on the lastfail column
*
* @param string|array $lastfail The value to use as filter.
* @param string|array $dbLastfail The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByLastfail($lastfail = null, $comparison = null)
public function filterByDbLastfail($dbLastfail = null, $comparison = null)
{
if (is_array($lastfail)) {
if (is_array($dbLastfail)) {
$useMinMax = false;
if (isset($lastfail['min'])) {
$this->addUsingAlias(CcSubjsPeer::LASTFAIL, $lastfail['min'], Criteria::GREATER_EQUAL);
if (isset($dbLastfail['min'])) {
$this->addUsingAlias(CcSubjsPeer::LASTFAIL, $dbLastfail['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($lastfail['max'])) {
$this->addUsingAlias(CcSubjsPeer::LASTFAIL, $lastfail['max'], Criteria::LESS_EQUAL);
if (isset($dbLastfail['max'])) {
$this->addUsingAlias(CcSubjsPeer::LASTFAIL, $dbLastfail['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@ -345,7 +371,7 @@ abstract class BaseCcSubjsQuery extends ModelCriteria
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSubjsPeer::LASTFAIL, $lastfail, $comparison);
return $this->addUsingAlias(CcSubjsPeer::LASTFAIL, $dbLastfail, $comparison);
}
/**
@ -806,7 +832,7 @@ abstract class BaseCcSubjsQuery extends ModelCriteria
public function prune($ccSubjs = null)
{
if ($ccSubjs) {
$this->addUsingAlias(CcSubjsPeer::ID, $ccSubjs->getId(), Criteria::NOT_EQUAL);
$this->addUsingAlias(CcSubjsPeer::ID, $ccSubjs->getDbId(), Criteria::NOT_EQUAL);
}
return $this;

View file

@ -0,0 +1,3 @@
<?php
echo $this->form;

View file

@ -0,0 +1 @@
<br /><br /><center>View script for controller <b>User</b> and script/action name <b>index</b></center>

View file

@ -248,13 +248,14 @@
</unique>
</table>
<table name="cc_subjs" phpName="CcSubjs">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="login" phpName="Login" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="pass" phpName="Pass" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="type" phpName="Type" type="CHAR" size="1" required="true" defaultValue="U"/>
<column name="realname" phpName="Realname" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="lastlogin" phpName="Lastlogin" type="TIMESTAMP" required="false"/>
<column name="lastfail" phpName="Lastfail" type="TIMESTAMP" required="false"/>
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="login" phpName="DbLogin" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="pass" phpName="DbPass" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="type" phpName="DbType" type="CHAR" size="1" required="true" defaultValue="U"/>
<column name="first_name" phpName="DbFirstName" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="last_name" phpName="DbLastName" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="lastlogin" phpName="DbLastlogin" type="TIMESTAMP" required="false"/>
<column name="lastfail" phpName="DbLastfail" type="TIMESTAMP" required="false"/>
<unique name="cc_subjs_id_idx">
<unique-column name="id"/>
</unique>

View file

@ -393,7 +393,8 @@ CREATE TABLE "cc_subjs"
"login" VARCHAR(255) default '' NOT NULL,
"pass" VARCHAR(255) default '' NOT NULL,
"type" CHAR(1) default 'U' NOT NULL,
"realname" VARCHAR(255) default '' NOT NULL,
"first_name" VARCHAR(255) default '' NOT NULL,
"last_name" VARCHAR(255) default '' NOT NULL,
"lastlogin" TIMESTAMP,
"lastfail" TIMESTAMP,
PRIMARY KEY ("id"),