~fabiocbalbuquerque/sahana-agasti/web-services

« back to all changes in this revision

Viewing changes to lib/model/doctrine/agWebservicesPackage.moved/sfGuardUserProfile.class.php

  • Committer: Fabio Albuquerque
  • Date: 2011-08-13 13:46:26 UTC
  • Revision ID: fabiocbalbuquerque@gmail.com-20110813134626-6wter3kt09mzz8ew
Adding files removed unintentionally

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
 
3
 
/**
4
 
 * sfGuardUserProfile
5
 
 * 
6
 
 * This class has been auto-generated by the Doctrine ORM Framework
7
 
 * 
8
 
 * @package    AGASTI_CORE
9
 
 * @subpackage model
10
 
 * @author     CUNY SPS
11
 
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
12
 
 */
13
 
class sfGuardUserProfile extends PluginsfGuardUserProfile
14
 
{
15
 
    public function save(Doctrine_Connection $conn = null)
16
 
    {
17
 
        if (!$this->getToken())
18
 
        {
19
 
            if (!$this->getUserId())
20
 
            {
21
 
                throw new Exception("A profile must have a user id associated");
22
 
            }
23
 
            $user = Doctrine_Core::getTable('sfGuardUser')->findOneById();
24
 
            $this->setToken(sha1($user->getEmail().rand(111,999)));
25
 
        }
26
 
        return parent::save($conn);
27
 
    }
28
 
}