Author: allyb
Date: 2010-02-20 19:07:13 +0100 (Sat, 20 Feb 2010)
New Revision: 28157
Modified:
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/filter/doctrine/PluginsfEasyAuthUserFormFilter.class.php
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserBase.php
Log:
The admin filter now works on credentials
Modified:
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/filter/doctrine/PluginsfEasyAuthUserFormFilter.class.php
===================================================================
---
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/filter/doctrine/PluginsfEasyAuthUserFormFilter.class.php
2010-02-20 16:53:44 UTC (rev 28156)
+++
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/filter/doctrine/PluginsfEasyAuthUserFormFilter.class.php
2010-02-20 18:07:13 UTC (rev 28157)
@@ -28,10 +28,12 @@
{
$fieldName = $this->getFieldName($field);
- if (is_array($values) && isset($values['text']) && '' != $values['text'])
+ $values = trim($values);
+
+ if (!empty($values))
{
$query->innerJoin(sprintf('%s.sfEasyAuthUserCredential c',
$query->getRootAlias()));
- $query->addWhere('c.credential = ?', $values['text']);
+ $query->addWhere('c.credential = ?', $values);
}
}
Modified:
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserBase.php
===================================================================
---
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserBase.php
2010-02-20 16:53:44 UTC (rev 28156)
+++
plugins/sfEasyAuthPlugin/branches/2010-02-18_integration-of-doctrine/lib/model/sfEasyAuthUserBase.php
2010-02-20 18:07:13 UTC (rev 28157)
@@ -218,7 +218,7 @@
public function removeCredential($credential)
{
// note: related profiles aren't deleted, just orphaned
- if ($userCredential =
sfEasyAuthUserCredentialPeer::retrieveByUserIdAndName($this->getId(),
$credential))
+ if ($userCredential =
Doctrine::getTable('sfEasyAuthUserCredential')->findByUserIdAndName/*&sfEasyAuthUserCredentialPeer::retrieveByUserIdAndName###Doctrine::getTable('sfEasyAuthUserCredential')->findByUserIdAndName&*/($this->getId(),
$credential))
{
$userCredential->delete();
}
@@ -259,7 +259,7 @@
$profileArray = array();
// get an array of profiles
- foreach (sfEasyAuthUserCredentialPeer::retrieveByUserId($this->getId()) as
$credential)
+ foreach
(Doctrine::getTable('sfEasyAuthUserCredential')->findByUserId/*&sfEasyAuthUserCredentialPeer::retrieveByUserId###Doctrine::getTable('sfEasyAuthUserCredential')->findByUserId&*/($this->getId())
as $credential)
{
$method = self::getProfileGetter($credential->getCredential());
@@ -372,7 +372,7 @@
}
// we need to pull out the ID from the extra credentials table
- if ($credential =
sfEasyAuthUserCredentialPeer::retrieveByUserIdAndName($this->getId(),
lcfirst($class)))
+ if ($credential =
Doctrine::getTable('sfEasyAuthUserCredential')->findByUserIdAndName/*&sfEasyAuthUserCredentialPeer::retrieveByUserIdAndName###Doctrine::getTable('sfEasyAuthUserCredential')->findByUserIdAndName&*/($this->getId(),
lcfirst($class)))
{
return $credential->getProfileId();
}
@@ -436,7 +436,7 @@
*/
public function setUserName($username)
{
- if ($eaUser = sfEasyAuthUserPeer::retrieveByUsername($username))
+ if ($eaUser =
Doctrine::getTable('sfEasyAuthUserCredential')->findByUserName/*&sfEasyAuthUserPeer::retrieveByUsername###Doctrine::getTable('sfEasyAuthUserCredential')->findByUserName&*/($username))
{
if ($eaUser->getId() !== $this->getId())
{
@@ -694,7 +694,7 @@
public function setCredentials(array $credentials)
{
// retrieve currently set credentials
- $credentialsToDelete =
sfEasyAuthUserCredentialPeer::retrieveByUserId($this->getId());
+ $credentialsToDelete =
Doctrine::getTable('sfEasyAuthUserCredential')->findByUserId/*&sfEasyAuthUserCredentialPeer::retrieveByUserId###Doctrine::getTable('sfEasyAuthUserCredential')->findByUserId&*/($this->getId());
// remove credentials in the $credentials array from the
$credentialsToDelete array
for ($i=0; $i<count($credentials); $i++)
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.