Changeset 14
- Timestamp:
- 10/07/07 21:02:24 (11 months ago)
- Files:
-
- trunk/TODO (added)
- trunk/apps/frontend/modules/sfGuardAuth/actions/actions.class.php (modified) (2 diffs)
- trunk/apps/frontend/modules/sfGuardAuth/config (added)
- trunk/apps/frontend/modules/sfGuardAuth/config/security.yml (added)
- trunk/apps/frontend/modules/sfGuardAuth/templates/profileSuccess.php (added)
- trunk/apps/frontend/modules/sfGuardAuth/validate/createAccount.yml (modified) (3 diffs)
- trunk/apps/frontend/modules/sfGuardAuth/validate/profile.yml (added)
- trunk/apps/frontend/modules/sfSimpleForum/templates/_author_name.php (added)
- trunk/apps/frontend/templates/layout.php (modified) (1 diff)
- trunk/config/schema.yml (modified) (1 diff)
- trunk/lib/model/sfGuardUserProfile.php (added)
- trunk/lib/model/sfGuardUserProfilePeer.php (added)
- trunk/web/css/forum.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/apps/frontend/modules/sfGuardAuth/actions/actions.class.php
r6 r14 31 31 $user->save(); 32 32 33 $profile = new sfGuardUserProfile(); 34 $profile->setsfGuardUser($user); 35 $profile->setEmail($this->getRequestParameter('user_email')); 36 $profile->save(); 37 33 38 $this->getUser()->signin($user, $this->getRequestParameter('rememeber', true)); 34 39 … … 41 46 } 42 47 48 public function handleErrorProfile() 49 { 50 $this->profile = $this->getUser()->getGuardUser()->getProfile(); 51 return sfView::SUCCESS; 52 } 53 54 public function executeProfile() 55 { 56 if($this->getRequest()->getMethod() == sfRequest::POST) 57 { 58 $user = $this->getUser(); 59 $userProfile = $user->getGuardUser()->getProfile(); 60 $userProfile->setFirstName($this->getRequestParameter('first_name')); 61 $userProfile->setLastName($this->getRequestParameter('last_name')); 62 $userProfile->setEmail($this->getRequestParameter('email')); 63 $userProfile->save(); 64 65 $this->setFlash('profile_saved', true); 66 } 67 $this->profile = $this->getUser()->getGuardUser()->getProfile(); 68 } 43 69 } trunk/apps/frontend/modules/sfGuardAuth/validate/createAccount.yml
r6 r14 1 fillin: 2 enabled: true 3 1 4 methods: 2 5 post: [username, password, password2, user_email] … … 6 9 required: true 7 10 required_msg: Your username is required 8 validators: [userValidator ]11 validators: [userValidator, usernameValidator] 9 12 10 13 password: … … 29 32 unique_error: A user with this username already exists. Please choose another one. 30 33 34 usernameValidator: 35 class: sfRegexValidator 36 param: 37 match: false 38 pattern: /[\s\.]+/ 39 match_error: Usernames cannot have spaces or dots 40 41 31 42 passwordValidator: 32 43 class: sfCompareValidator trunk/apps/frontend/templates/layout.php
r12 r14 21 21 <li id="search_li"><?php echo link_to(__('Search'), 'sfLucene/search', 'id=search_link') ?></li> 22 22 <?php if ($sf_user->isAuthenticated()): ?> 23 <li><?php echo __('Signed in as %user%', array('%user%' => $sf_user->getGuardUser()->getUsername() )) ?>24 (<?php echo link_to(__('Sign out'), 'sfGuardAuth/signout') ?>)</li>23 <li><?php echo link_to(__('Profile'), 'sfGuardAuth/profile') ?></li> 24 <li><?php echo link_to(__('Sign out'), 'sfGuardAuth/signout') ?></li> 25 25 <?php else: ?> 26 26 <li><?php echo link_to(__('Sign in'), 'sfGuardAuth/signin') ?></li> trunk/config/schema.yml
r2 r14 1 propel: 2 sf_guard_user_profile: 3 _attributes: { phpName: sfGuardUserProfile } 4 id: 5 user_id: { type: integer, foreignTable: sf_guard_user, foreignReference: id, required: true, onDelete: cascade } 6 first_name: varchar(100) 7 last_name: varchar(100) 8 email: varchar(255) trunk/web/css/forum.css
r12 r14 74 74 } 75 75 76 /* User login */ 77 form#signin 76 form#signin, form#profile 78 77 { 79 78 width: 576px; … … 83 82 } 84 83 85 form#signin label 84 form#signin label, form#profile label 86 85 { 87 86 display: block; 88 87 margin-top: 5px; 89 }90 91 form#add_topic input#topic_submit92 {93 display: block;94 88 } 95 89 … … 114 108 } 115 109 110 form#add_topic input#topic_submit 111 { 112 display: block; 113 } 114 116 115 form.search-controls 117 116 {
