~fabiocbalbuquerque/sahana-agasti/web-services

« back to all changes in this revision

Viewing changes to apps/frontend/lib/packages/agWebservicesPackage/lib/model/doctrine/PluginsfGuardUserProfileTable.class.php

  • Committer: Clayton Kramer
  • Date: 2011-07-26 18:12:28 UTC
  • mto: (1.26.1 push-trunk)
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: clayton.kramer@mail.cuny.edu-20110726181228-ldpybh717xkhuq25
Added event facilities export to webservices

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 */
8
8
class PluginsfGuardUserProfileTable extends agDoctrineTable
9
9
{
 
10
 
10
11
    /**
11
12
     * Returns an instance of this class.
12
13
     *
16
17
    {
17
18
        return Doctrine_Core::getTable('PluginsfGuardUserProfile');
18
19
    }
19
 
    
 
20
 
 
21
    public function getByToken(array $parameters)
 
22
    {
 
23
        $user = Doctrine_Core::getTable('sfGuardUserProfile')->findOneByToken($parameters['token']);
 
24
        if (!$user || !$user->getIsWebserviceClient() || !$user->getIsActive()) {
 
25
            throw new sfError404Exception(sprintf('Client with token "%s" does not exist or is not activated.', $parameters['token']));
 
26
        }
 
27
        return $user;
 
28
    }
 
29
 
20
30
}
 
 
b'\\ No newline at end of file'